#4530: Deriving Data for existentially quantified types
---------------------------------+------------------------------------------
    Reporter:  mitar             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.1               |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 I cannot derive Data for:

 {{{
 data EqBox where
   EB :: forall e . (Data e, Eq e) => e -> EqBox
 }}}

 I am getting such error:

 {{{
    Ambiguous type variable `e' in the constraints:
       (Eq e) arising from a use of `EB' at Test.hs:11:1-28
       (Data e) arising from a use of `k' at Test.hs:11:1-28
     Probable fix: add a type signature that fixes these type variable(s)
     In the first argument of `z', namely `EB'
     In the first argument of `k', namely `z EB'
     In the expression: k (z EB)
     When typechecking the code for  `gunfold'
       in a standalone derived instance for `Data EqBox':
       To see the code I am typechecking, use -ddump-deriv
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4530>
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