FW: Layout indentation marking

Simon Peyton-Jones simonpj@microsoft.com
Tue, 12 Mar 2002 04:08:56 -0800


I agree with Ian here (and not just because of what GHC does!)

Does anyone disagree?

Simon

-----Original Message-----
From: Ian Lynagh [mailto:igloo@earth.li]=20
Sent: 10 March 2002 15:23
To: Haskell list
Subject: Layout indentation marking



Given this module

    module Main where

    main :: IO()
    main =3D putStrLn $ show $ foo

    foo :: Int
    foo =3D x + y
      where x =3D 6
            s =3D "foo\
      \bar" y =3D 7

nhc98 and hugs correctly (as per the revised report) print 13. ghc gives

    q.lhs:11: parse error on input `=3D'

I think ghc is in the right here and the report should be updated to
read

      + Where the start of a lexeme does not follow the end of a lexeme
on
        the same line, this lexeme is preceded by <n> where n is the
        indentation of the lexeme, provided that it is not, as a
        consequence of the first two rules, preceded by {n}. (A string
        literal may span multiple lines -- Section 2.6.)

(it currently reads

      + Where the start of a lexeme does not follow a complete lexeme on
        the same line, this lexeme is preceded by <n> where n is the
        indentation of the lexeme, provided that it is not, as a
        consequence of the first two rules, preceded by {n}. (A string
        literal may span multiple lines -- Section 2.6.)

where I have altered only the first line).


Thanks
Ian

_______________________________________________
Haskell mailing list
Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell