[Haskell-cafe] Layout rule (was Re: PrefixMap: code reviewrequest)

Brian Hulley brianh at metamilk.com
Thu Mar 2 17:15:54 EST 2006

Brian Hulley wrote:
> So any solutions welcome :-)

Thank to everyone who replied to my queries about this whole layout issue.

One other thing I've been wanting to ask (not to change! :-)) for a while 
is: how is the following acceptable according to the rules in the Haskell98 
report where "where" is one of the lexemes, which when followed by a line 
more indented than the line the layout-starting-lexeme is on, should start 
an implicit block:

       module M where
       data T = .....            -- not indented!

According to my understanding of the layout algorithm, the above code would 
have to be written:

       module M where
              data T = ....

Can anyone shed some light on what the formal rule is that allows the first 
(and very useful) way of laying out code to be ok?

Thanks, Brian.

More information about the Haskell-Cafe mailing list