#4083: Generalized newtype deriving fails for newtypes that are type family
instances
----------------------------------------+-----------------------------------
    Reporter:  RANDY Ruler of Zexernet  |       Owner:              
        Type:  bug                      |      Status:  new         
    Priority:  normal                   |   Component:  Compiler    
     Version:  6.12.1                   |    Keywords:              
          Os:  Unknown/Multiple         |    Testcase:              
Architecture:  Unknown/Multiple         |     Failure:  None/Unknown
----------------------------------------+-----------------------------------
 With FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving,
 StandaloneDeriving, & TypeFamilies the following code produces an
 "impossible" error (genDerivBinds: bad derived class):
 {{{
 data family F a
 newtype instance F [a] = Maybe a
 class C a where data D a
 deriving instance C (Maybe a) => C (F [a])
 }}}

 Whereas I expected something like this (which works):
 {{{
 instance C (Maybe a) => C (F [a]) where newtype D (F [a]) = SomeCon (D
 (Maybe a))
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4083>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to