[GHC] #8840: standalone 'let' in do notation does not parse

GHC ghc-devs at haskell.org
Mon Mar 3 10:51:04 UTC 2014


#8840: standalone 'let' in do notation does not parse
------------------------------------+-------------------------------------
       Reporter:  slyfox            |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 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 ‘}’
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8840>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list