Women in Technology

Hear us Roar



Article:
  Introduction to Haskell, Part 2: Pure Functions
Subject:   Order
Date:   2007-08-02 05:54:11
From:   renosky
What I find confusing about the code you posted is not related to Haskell but to the order it is written: it's as annoying as reading people top-posting in Usenet..
Instead of
total cart = subtotal + tax
where
subtotal = sum cart
taxable = filter isTaxable cart
tax = (sum taxable) * taxRate


,this look much easier to read for me:
subtotal = sum cart
taxable = filter isTaxable cart
tax = (sum taxable) * taxRate
total cart = subtotal + tax


Of course, style is a personnal preference..