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,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 579
    • Merge requests 579
  • 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
  • #13105
Closed
Open
Issue created Jan 11, 2017 by Richard Eisenberg@raeDeveloper

Allow type families in RuntimeReps

Conal Elliott provided me with this puzzle:

type family RepRep a ∷ RuntimeRep

class HasRep a where
  type Rep a ∷ TYPE (RepRep a)
  repr ∷ a → Rep a
  abst ∷ Rep a → a

type instance RepRep Int = IntRep

instance HasRep Int where
  type Rep Int = Int#
  abst n = I# n
  repr (I# n) = n

I think we should accept. However, doing so (even with my solution to #12809 (closed) complete) is hard, because we frequently consult a kind in order to determine a runtime representation. When that kind is TYPE (RepRep Int), the code generator throws up its arms in despair.

The solution here is either to teach the code generator how to normalise types (requiring propagating the FamInstEnvs) or to do a whole-program transformation at some point (zonker? desugarer? maybe we can wait until !CorePrep or even unarisation?) to change ids whose types have kinds like TYPE (RepRep Int) into ids with types with kinds like TYPE IntRep.

But I don't want to let this hold me up at the moment, so I'm posting here as a reminder to revisit this problem.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
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