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
  • #11732
Closed
Open
Issue created Mar 21, 2016 by Richard Eisenberg@raeDeveloper

Deriving Generic1 interacts poorly with TypeInType

From @RyanGlScott, ticket:11357#comment:117922:

Vanilla datatypes and data family instances are still inconsistent w.r.t. which type variables are considered "instantiated" in a Generic1 instance. For instance, this is rejected:

λ> data Proxy k (a :: k) = ProxyCon deriving Generic1
<interactive>:32:43: error:
    • Can't make a derived instance of ‘Generic1 (Proxy *)’:
        Proxy must not be instantiated; try deriving `Proxy k a' instead
    • In the data declaration for ‘Proxy’

And rightfully so, since the visible kind binder k is instantiated to *. But now it's possible to have an equivalent instance for a data family that squeaks past this check!

λ> data family ProxyFam (a :: y) (b :: z)
λ> data instance ProxyFam k (a :: k) = ProxyFamCon deriving Generic1

==================== Derived instances ====================
Derived instances:
  instance GHC.Generics.Generic1 (Ghci13.ProxyFam *) where
    ...

[Ryan needs] to investigate further to see why this is the case.

Trac metadata
Trac field Value
Version 8.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