standalone 'let' in do notation does not parse
When describing to a friend "do notation" syntactic equivalence some days ago I picked the following example:
-- valid for ghc
main = do let z = 1
print z
and tried to make it one-line for lambdabot:
-- seems to be allowed explicitly by the spec
-- http://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-470003.14
main = do { let z = 1; print z }
Bug neither ghc-7.6.3 nor ghc-7.8.1-rc2 seem to accept it as valid:
[1 of 1] Compiling Main ( a.hs, a.o )
a.hs:1:32: parse error on input ‘}’
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |