Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,359
    • Issues 5,359
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 573
    • Merge requests 573
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2905
Closed
Open
Issue created Jan 01, 2009 by guest@trac-guest

require -XGADTs in order to pattern-match GADTs

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 (closed)

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

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC id@isaac.cedarswampstudios.org
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking