#2905: require -XGADTs in order to pattern-match GADTs
-----------------------------+----------------------------------------------
Reporter:  guest             |          Owner:                         
    Type:  proposal          |         Status:  new                    
Priority:  normal            |      Component:  Compiler (Type checker)
 Version:  6.10.1            |       Severity:  normal                 
Keywords:                    |       Testcase:                         
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple       
-----------------------------+----------------------------------------------
 Without -XGADTs, pattern-matching GADTs causes weird typechecking problems
 (due to the lack of implied -XRelaxedPolyRec), see this thread
 http://thread.gmane.org/gmane.comp.lang.haskell.glasgow.user/16064 , and
 some history in bug #2004

 I propose that pattern-matching against any constructor that uses
 sufficient GADT features that it's particularly confused without
 -XRelaxedPolyRec, should require -XGADTs

 (I don't understand the issue well enough to know if what I'm saying makes
 sense.  I guess ordinary data and mere existentials don't need it, even
 when defined with GADT syntax...?)

 Alternately we could just require -XRelaxedPolyRec, but that seems even
 more confusing (and it wouldn't help make code portable to other
 compilers, as GADTs are definitely being used).  Or if Haskell-prime ever
 comes around and makes -XRelaxedPolyRec default (is it planning to?), then
 the issue might be moot.  I don't think the argument (against requiring
 -XGADTs) by parallel to -XOverlappingInstances is particularly strong...
 -XOverlappingInstances has an implicit effect on a module's class
 definitions... also I don't necessarily agree with that we made that
 decision for existing flags either :-)


 --Isaac Dupree

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2905>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to