ghc misreports the error line

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Wed Oct 24 07:09:03 EDT 2001


> > chars = "
> > foo
> > bar"

> You *are* violating the Haskell 98 spec, I'm afraid :)

No he isn't.  At least, I can't find anything in the Report which
disallows literal newline characters in a string literal.
Oh, hold on.  The production

    string -> "  { graphic_<"|`> | space | escape | gap }  "

does seem to disallow newline characters.  But it also disallows
literal tab characters!  I submit that this is a bug in the Haskell'98
Report, and it should really say

    string -> "  { graphic_<"|`> | whitechar | escape | gap }  "

Regards,
    Malcolm




More information about the Glasgow-haskell-bugs mailing list