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

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Sun Jun 20 20:57:33 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
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 kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkweuP0ACgkQIn7hlCsL25XifQCgzvfvf9utQxkb2gdmVRPyhea2
iIUAnRT8XUhTKds0wrVkFaccyzAKTA9v
=YjX6
-----END PGP SIGNATURE-----


More information about the Glasgow-haskell-users mailing list