[Haskell-cafe] Re: layout problem

Benjamin Franksen benjamin.franksen at bessy.de
Thu Nov 17 05:05:31 EST 2005

On Thursday 17 November 2005 03:44, Cale Gibbard wrote:
> On 16/11/05, Stefan Monnier <monnier at iro.umontreal.ca> wrote:
> > >> Indeed!  I always use braces and semicolons with do-notation. 
> > >> You are free to do so too!  Nothing requires you to use layout.
> > >> Indeed, you can freely mix the two.
> > >
> > > I would not recommend braces and semicolons, because these allow
> > > a bad layout (easy to parse for a compiler, but hard to read for
> > > a human), unless you invest the time to make a tidy layout
> > > despite the braces and semicolons. (So why not only make a tidy
> > > layout?)
> >
> > Unless you use a simplistic text editor, the braces and semi-colons
> > allow the text editor to do the layout for you.  While I find the
> > layout notation attractively clean, I find the redundancy of
> > autolayout+braces+semicolons to save me from a lot of trouble.
> If your editor is a little smarter still, it can do the Haskell
> layout without braces automatically too. The emacs mode helps with
> this. Yi/hIDE should be able to do it perfectly once it's in a
> generally usable state. :)

Hmm, how would your super intelligent text editor layout the ambigous 
example of the OP? Well, never mind: either way might be the wrong one, 
depending on what the program is /supposed/ to do.


More information about the Haskell-Cafe mailing list