GADT Strangeness

Isaac Dupree isaacdupree at charter.net
Mon Dec 29 15:00:52 EST 2008


Simon Peyton-Jones wrote:
> This is a nasty corner I agree.  GHC requires -XGADTs for you to *define* a GADT. Perhaps it should also require -XGADTs for you to *match against* one (as you are doing here).  That would avoid this particular hole.  If you think that would be a step forward, do put forward a Trac feature request, and encourage others to support it.

Does GHC require any flags to pattern-match against an 
existential constructor? (does it require type-system 
complication?)

(and what if GADT syntax was used for an ordinary data type? 
or for an ordinary existential?)

but I'd support requiring -XGADTs in any such pattern-match 
in which XRelaxedPolyRec could make a difference.  Somehow 
it doesn't seem fair for a module to imply that it *doesn't* 
use GADTs, if it cannot even by type-checked without 
understanding them.
also see http://hackage.haskell.org/trac/ghc/ticket/2004

-Isaac


More information about the Glasgow-haskell-users mailing list