[Haskell-cafe] let vs. where

Henning Thielemann lemming at henning-thielemann.de
Tue Nov 13 14:50:41 EST 2007


On Tue, 13 Nov 2007, John Lato wrote:

> Hello,
>
> I know there are several important differences between let-expressions
> and where-clauses regarding scoping and the restriction of "where" to
> a top-level definition.  However, frequently I write code in which
> either one would be allowed, and I was wondering if there were any
> guidelines or preferences for one structure over the other.  Currently
> my choice is guided by aesthetics more than anything else ( I prefer
> the look and ordering of a where clause).  Is there anything else I
> should consider?  What do veteran Haskell programmers prefer?

This depends on whether you are an "expression style" or "declaration
style" programmer.
  http://www.haskell.org/haskellwiki/Declaration_vs._expression_style
  http://www.haskell.org/haskellwiki/Let_vs._Where


More information about the Haskell-Cafe mailing list