[GHC] #9359: Deriving clause failure with polymorphic kinds

GHC ghc-devs at haskell.org
Thu Jul 24 11:45:41 UTC 2014


#9359: Deriving clause failure with polymorphic kinds
-------------------------------------+-------------------------------------
       Reporter:  simonpj            |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.2
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 Consider
 {{{
 {-# Language GADTs, PolyKinds, TypeFamilies, DataKinds #-}
 module Fam where

 data Cmp a where
  Sup ::      Cmp a
  V   :: a -> Cmp a
  deriving (Show, Eq)

 data family   CmpInterval (a :: Cmp k) (b :: Cmp k) :: *
 data instance CmpInterval (V c)         Sup          = Starting c
   deriving( Show )
 }}}
 GHC 7.8.3 gives
 {{{
 Fam.hs:12:13:
     Can't make a derived instance of ‘Show (CmpInterval ('V c) 'Sup)’:
       No family instance for ‘CmpInterval ('V c) 'Sup’
     In the data instance declaration for ‘CmpInterval’
 }}}
 which is obviously wrong.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9359>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list