[GHC] #2851: Deriving doesn't work when type families are involved

GHC trac at galois.com
Mon Dec 8 06:13:12 EST 2008


#2851: Deriving doesn't work when type families are involved
-----------------------------+----------------------------------------------
Reporter:  guest             |          Owner:                  
    Type:  feature request   |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.1            |       Severity:  minor           
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 The following does not work:

 {{{
 type family F a :: *

 data D a = D (F a)
     deriving (Show)
 }}}

 The natural way of adding an instance does work (with enough extensions
 turned on):

 {{{
 instance (Show (F a)) => Show (D a) where
     show (D x) = "D " ++ show x
 }}}

 It would be nice if the deriving mechanism could derive this code.

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


More information about the Glasgow-haskell-bugs mailing list