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,248
    • Issues 5,248
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 562
    • Merge requests 562
  • 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
  • #12088
Closed
Open
Issue created May 19, 2016 by alexvieth@trac-alexvieth

Type/data family instances in kind checking

See

  • Artem's blog post about this stuff; it's very helpful.
  • This wiki page, written in response to this ticket
  • This later wiki page, also written in response to this ticket

In TcEnv.hs there is a note AFamDataCon: not promoting data family constructors. It states that we can't use a promoted data family instance constructor because we would have to interleave the checking of instances and data types. But with the fix of #11348 (closed), we now do exactly this. In the example from the note

data family T a
data instance T Int = MkT
data Proxy (a :: k)
data S = MkS (Proxy 'MkT)

-ddump-rn-trace shows these groups

rnTycl dependency analysis made groups
 [[data family T a_apG]
 []
 [data instance T Int = MkT],
 [data Proxy (a_apF :: k_apE)]
 []
 [],
 [data S = MkS (Proxy MkT)]
 []
 []]

That's to say, the instance T Int will in fact be checked before S. So let's remove this restriction.

See also (NB: "closed" means "closed because #12088 takes precendence")

  • #11348 (closed)
  • #16693
  • #16410 (closed)
  • #16448 (closed)
  • #19527
  • #19611 (closed)
  • #20875 (closed)
  • #20885 (closed)
  • #21172 (closed)
  • #22257
Trac metadata
Trac field Value
Version 8.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related #11348 (closed)
Blocking
CC
Operating system
Architecture
Edited Oct 06, 2022 by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking