
2009/3/2 7stud
I get indenting errors with the following attempts to use let:
... three failed exaopmles and a good one ... But I would like to know how to use let. From beginner to beginner, they look to me more as syntax errors than indentation problem. The syntax for let is let { decl ; ... decl } in expression or in layout format let decl ... decl in expression and your attempts do not respect this syntax. In all three cases, after the keyword 'in' you need a full expression, and neither a where clause nor a set of matches are a full expression by themselves. An expression is either a function apllication or a 'statement' like if or case, or maybe something more I can't recall. In my haskell exercises I really appreciate the fact that the haskell mode of emacs has syntax hints (also function hints for functions in the prelude). Even now that I know haskell basic syntax, I find it helpful. Don't know of any other editors with the same capability for haskell, though, and if you are not an emacs user, learning the not-so-standard ways of emacs might offset the benefits of having syntax hints. Ciao --------- FB