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

John Lask jvlask at
Mon Jun 21 13:44:08 EDT 2010

> 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".

for the record ...

 > t2 =
 >  do rec
 >       a <- getChar
 >       b <- f c
 >       c <- g b
 >       putChar c
 >       return b

 > f = return . (const 'a')
 > g = return

     The last statement in a 'do' construct must be an expression
Failed, modules loaded: none.

so I suppose it is not so far from "recognising" the construct and yet 
too far!

More information about the Glasgow-haskell-users mailing list