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,399
    • Issues 5,399
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 592
    • Merge requests 592
  • 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
  • #10775
Closed
Open
Issue created Aug 15, 2015 by Ryan Scott@RyanGlScottMaintainer

Enable PolyKinds in GHC.Generics

As suggested in this Haskell libraries mailing list thread. Among other benefits, this would allow use of generic functions with Proxy t when t is of a kind other than *.

There seem to be more changes required than just putting {-# LANGUAGE PolyKinds #-} in GHC.Generics, however, since I tried doing that myself and found myself unable to properly derive Generic(1) instances in GHC.Generics. Here is a snippet of the resulting error message:

libraries/base/GHC/Generics.hs:826:1: error:
    Couldn't match type ‘M1 i0 c0 (M1 i1 c1 U1) p0’ with ‘M1 D x’
    Expected type: Rep (Proxy t) x
      Actual type: M1 i0 c0 (M1 i1 c1 U1) p0
    Relevant bindings include
      from :: Proxy t -> Rep (Proxy t) x
        (bound at libraries/base/GHC/Generics.hs:826:1)
    In the expression: M1 (M1 U1)
    In an equation for ‘from’: from Proxy = M1 (M1 U1)
    When typechecking the code for ‘from’
      in a derived instance for ‘Generic (Proxy t)’:
      To see the code I am typechecking, use -ddump-deriv

libraries/base/GHC/Generics.hs:826:1: error:
    Couldn't match type ‘M1 t0 t1 (M1 t3 t4 U1) t2’ with ‘M1 D x’
    Expected type: Rep (Proxy t) x
      Actual type: M1 t0 t1 (M1 t3 t4 U1) t2
    Relevant bindings include
      to :: Rep (Proxy t) x -> Proxy t
        (bound at libraries/base/GHC/Generics.hs:826:1)
    In the pattern: M1 (M1 U1)
    In an equation for ‘to’: to (M1 (M1 U1)) = Proxy
    When typechecking the code for ‘to’
      in a derived instance for ‘Generic (Proxy t)’:
      To see the code I am typechecking, use -ddump-deriv
    In the instance declaration for ‘Generic (Proxy t)’
Trac metadata
Trac field Value
Version 7.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC dreixel
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