Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,248
    • Issues 4,248
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10775

Closed
Open
Opened 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
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#10775