
#9359: Deriving clause failure with polymorphic kinds -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
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.
New description: 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. Reported on [http://www.haskell.org/pipermail/glasgow-haskell- users/2014-July/025145.html glasgow-haskell-users]. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9359#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler