[GHC] #15763: GHC forbids kind signatures in data family instances

#15763: GHC forbids kind signatures in data family instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If I say {{{#!hs class C (a :: k) instance (C :: Type -> Constraint) a }}} GHC is happy. Note that this is actually useful to do. But if I say {{{#!hs data family D (a :: k) data instance (D :: Type -> Type) a }}} GHC is unhappy: {{{ Malformed head of type or class declaration: (D :: Type -> Type) a }}} Fixing this will require a change to the `FamEqn` type, which doesn't have enough flexibility to deal with a kind signature there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15763 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15763: GHC forbids kind signatures in data family instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Should we also permit `data (D :: Type -> Type) a`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15763#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15763: GHC forbids kind signatures in data family instances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): No. `data` is a declaration (binding site) and has its own, restrictive syntax. On the other hand, the head of a `data instance` is a type, containing only occurrences, not binding sites. (Even the type variables are occurrences. They are magically and invisibly bound by an implicit `forall`.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15763#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC