[Haskell-cafe] Unifcation and matching in Abelian groups

Neil Mitchell ndmitchell at gmail.com
Wed Aug 19 06:51:33 EDT 2009


> I've given up on using if-then-else in do expressions.  They confuse
> emacs.  There is a proposal for Haskell' to fix the problem, but until
> then, I will not use them in do expressions.

It's a shame, there are ways of indenting them that work, but they're
not as natural. It's a wart, but it will be fixed.

> I'm so glad new languages do not use the offset rule.

F# is new and has the offset rule. Haskell is old and has the optional
offset rule:

do { prob <- getLine
     ; test prob
     ; main}

Now your indentation is your own :-)

Some people prefer this style. Simon Peyton Jones uses it in the book
beautiful code. I much prefer indentation only.



More information about the Haskell-Cafe mailing list