[Haskell-cafe] new recursive do notation (ghc 6.12.x) spoils layout

John Lask jvlask at hotmail.com
Mon Jun 21 13:18:19 EDT 2010


Whilst I have nothing against the change in syntax for recursive do aka

http://old.nabble.com/Update-on-GHC-6.12.1-td26103595.html

Instead of writing

   mdo
     a <- getChar
     b <- f c
     c <- g b
     putChar c
     return b

you would write

   do
     a <- getChar
     rec { b <- f c
           ; c <- g b }
     putChar c
     return b

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.

Why can't we have this?



More information about the Haskell-Cafe mailing list