concept clause in category haskell

appears as: clause, clauses
Get Programming with Haskell

This is an excerpt from Manning's book Get Programming with Haskell.

The first thing that should strike you as interesting is that a where clause reverses the normal order used to write variables. In most programming languages, variables are declared before they’re used. This convention in most programming languages is partially the byproduct of being able to change state. Variable order matters because you can always reassign the value of something after you’ve assigned it. In Haskell, because of referential transparency, this isn’t an issue. There’s also a readability gain with the Haskell approach: if you read the algorithm, the intention is clear right away.

Haskell has an alternative to where clauses called let expressions. A let expression allows you to combine the readability of a where clause with the power of your lambda function. Figure 3.3 shows the sumSquareOrSquareSum function using let.