[GHC] #4043: Parsing of guards, and type signatures

GHC cvs-ghc at haskell.org
Thu May 6 15:48:54 EDT 2010


#4043: Parsing of guards, and type signatures
----------------------------------+-----------------------------------------
    Reporter:  igloo              |        Owner:              
        Type:  bug                |       Status:  new         
    Priority:  normal             |    Milestone:  _|_         
   Component:  Compiler (Parser)  |      Version:  6.12.2      
    Keywords:                     |   Difficulty:              
          Os:  Unknown/Multiple   |     Testcase:              
Architecture:  Unknown/Multiple   |      Failure:  None/Unknown
----------------------------------+-----------------------------------------
Changes (by simonpj):

  * milestone:  6.14.1 => _|_


Comment:

 The intention in language definition is to avoid the ambiguity of
 {{{
 case e1 of
   Just y | e2 :: Bool -> Int -> True
 }}}
 by requiring a guard to be an infixexp.  But sadly a 'let' is an infixexp
 too:
 {{{
 case e1 of
   Just y | let z=e3 in e2 :: Bool -> Int -> True
 }}}
 so the problem is still there in the language definition.

 In GHC's parser the same productions are used for guard and for qualifiers
 in list comprehensions, which are not subject to the same constraints.  I
 am reluctant to meddle with the parser (always delicate) for a corner case
 that (a) is unlikely to be encountered in practice and (b) is arguably
 still a mess in the language definition.

 So I propose to do nothing.  If anyone feels motivated to take up the
 cudgels and look at the parser, we'll happily entertain a patch.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4043#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list