[ ghc-Bugs-1191681 ] parse error on input
SourceForge.net
noreply at sourceforge.net
Thu Apr 28 12:05:41 EDT 2005
Bugs item #1191681, was opened at 2005-04-28 15:07
Message generated for change (Comment added) made by wthaller
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1191681&group_id=8032
Category: Compiler
Group: 6.4
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: parse error on input
Initial Comment:
On GHC 6.4 on Mac OS X 10.3.9, the one-line file (t.hs) with
exactly the following contents
module A where m=(\n->n+)
incorrectly produces a syntax error:
~/working/bugs% ghc -c t.hs
t.hs:1:25: parse error on input `)'
The + can be replaced with - or * or > and will still produce the
same error.
AND the following one-line file (t1.hs)
module A where m=\n->n
produces the error
t1.hs:1:19: parse error on input `->'
BUT, adding a space after the = produces no error (t2.hs):
module A where m= \n->n
(Maybe =\ is parsed as one token. But that doesn't explain t.hs,
to which a space can be added and the problem doesn't go
away.)
--
Robin Bate Boerop
robin at bateboerop.name
----------------------------------------------------------------------
>Comment By: Wolfgang Thaller (wthaller)
Date: 2005-04-28 18:05
Message:
Logged In: YES
user_id=566359
\n->n+ is not correct Haskell. If you want to write an operator section, you
need parantheses there: \n->(n+)
As for the second case, yes, =\ is one token.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1191681&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list