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

GHC ghc-devs at haskell.org
Wed Oct 17 15:19:36 UTC 2018


#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


More information about the ghc-tickets mailing list