new recursive do notation (ghc 6.12.x) spoils layout

Brandon S Allbery KF8NH allbery at
Sun Jun 20 20:57:33 EDT 2010

Hash: SHA1

On 6/21/10 13:18 , John Lask wrote:
> it does spoil the nice layout - it would be nice to just be able to write
> (which does not parse)
>   do rec
>     a <- getChar
>     b <- f c
>     c <- g b
>     putChar c
>     return b
> I don't particularly care that the only recursive statements are #2,#3 - I
> just want my nice neat layout back. I have just spent an inordinate amount
> of time updating code when if the parser recognised "do rec" as a recursive
> group it would have been a drop in replacement and taken me one tenth of the
> time.

I think this would just require the lex layout rules already in place for
do/let in GHC; my guess is that your example would work if the body were
indented past the "r" of "rec".

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at
system administrator  [openafs,heimdal,too many hats]  allbery at
electrical and computer engineering, carnegie mellon university      KF8NH
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla -


More information about the Glasgow-haskell-users mailing list