[Haskell-beginners] Trouble with formatting, Real World Haskell example

Kurt Hutchinson kelanslists at gmail.com
Mon Nov 24 09:23:49 EST 2008

On Sun, Nov 23, 2008 at 12:10 AM, Steven Ashley
<steven.e.ashley at gmail.com> wrote:
> The contents of the do block must be indented at-least as much as
> mainWith on the previous line.

> main = mainWith myFunction
> ....where mainWith function = do
> ....................args <- getArgs

This is the reason that I format 'where' clauses like so:

main = mainWith myFunction
....mainWith f = do
........args <- getArgs

etc. I think one more line of vertical space is worth all of the
horizontal space you end up saving.


More information about the Beginners mailing list