[GHC] #5682: Properly parse kind operators (from promoted type operators) (was: Cannot parse (:) in a KindSignature with -XPolyKinds)

GHC cvs-ghc at haskell.org
Tue Dec 20 15:05:46 CET 2011


#5682: Properly parse kind operators (from promoted type operators)
---------------------------------------+------------------------------------
 Reporter:  lunaris                    |          Owner:  dreixel             
     Type:  bug                        |         Status:  new                 
 Priority:  normal                     |      Component:  Compiler            
  Version:  7.3                        |       Keywords:  PolyKinds, ghc-kinds
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple    
  Failure:  GHC rejects valid program  |       Testcase:                      
Blockedby:                             |       Blocking:                      
  Related:                             |  
---------------------------------------+------------------------------------
Changes (by dreixel):

 * cc: jpm@… (added)


Comment:

 We need to handle kind operators properly in the parser. This is not
 restricted to the wired-in promoted types; consider, for instance:
 {{{
 data a :+: b = LEFT a | RIGHT b
 }}}

 Currently, the following all fail to parse:
 {{{
 data Sum0 :: * :+: * -> *
 data Sum1 :: * ':+: * -> *
 data Sum2 :: '(:+:) * * -> *
 data Sum3 :: ':+: * * -> *
 }}}

 I guess that `Sum3` should indeed fail to parse, but all the others should
 work.

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



More information about the Glasgow-haskell-bugs mailing list