[GHC] #7849: Error on pattern matching of an existential whose context includes a type function

GHC cvs-ghc at haskell.org
Mon Apr 22 14:53:15 CEST 2013


#7849: Error on pattern matching of an existential whose context includes a type
function
-----------------------------+----------------------------------------------
Reporter:  guest             |          Owner:                         
    Type:  bug               |         Status:  new                    
Priority:  normal            |      Component:  Compiler (Type checker)
 Version:  7.4.2             |       Keywords:                         
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple       
 Failure:  None/Unknown      |      Blockedby:                         
Blocking:                    |        Related:                         
-----------------------------+----------------------------------------------

Comment(by goldfire):

 I agree that this is an obscure type error and needs some attention, but
 the needs for {{{-XGADTs}}} is sensible to me, here. After all, your
 {{{ASubj}}} datatype is a GADT, albeit using weird syntax. The
 prototypical GADT is like this:

 {{{
 data Foo a where
   FInt :: Foo Int
 }}}

 But, you could write that same datatype like this:

 {{{
 data Foo a = (a ~ Int) => FInt
 }}}

 A GADT really is just a normal datatype with equality constraints on its
 parameter(s). So, pattern matching on such a datatype should indeed
 require {{{-XGADTs}}}.

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



More information about the ghc-tickets mailing list