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,398
    • Issues 5,398
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • 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
  • #9999
Closed
Open
Issue created Jan 16, 2015 by shachaf@trac-shachaf

Typeable deriving behavior different between data families and associated data types

With AutoDeriveTypeable, data families get a Typeable instance, but associated data types in a class don't (and even standalone deriving doesn't work for them).

λ> data family Foo a
λ> typeRep (Proxy :: Proxy Foo)
Foo
λ> class K a where { data Bar a }
λ> typeRep (Proxy :: Proxy Bar)

<interactive>:6:1:
    No instance for (Typeable Bar) arising from a use of ‘typeRep’
    In the expression: typeRep (Proxy :: Proxy Bar)
    In an equation for ‘it’: it = typeRep (Proxy :: Proxy Bar)
λ> deriving instance Typeable Bar

<interactive>:7:1:
    Can't make a derived instance of ‘Typeable Bar’:
      Deriving Typeable is not allowed for family instances;
      derive Typeable for ‘Bar’ alone
    In the stand-alone deriving instance for ‘Typeable Bar’
Trac metadata
Trac field Value
Version 7.8.4
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