[Haskell-beginners] let indenting problems

Francesco Bochicchio bieffe62 at gmail.com
Tue Mar 3 05:05:53 EST 2009

2009/3/2 7stud <bbxx789_05ss at yahoo.com>

> 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
      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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090303/63defd80/attachment-0001.htm

More information about the Beginners mailing list