#1588: unrequested generalized newtype deriving?
-------------------------+--------------------------------------------------
    Reporter:  SamB      |        Owner:         
        Type:  bug       |       Status:  new    
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.6.1  
    Severity:  normal    |   Resolution:         
    Keywords:            |   Difficulty:  Unknown
          Os:  Unknown   |     Testcase:         
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
Changes (by Isaac Dupree):

  * version:  6.6 => 6.6.1

Comment:

 Hugs gives
 {{{
 ERROR "t.hs":3 - Illegal Haskell 98 class constraint in derived instance
 *** Instance   : Eq (MaybeT a b)
 *** Constraint : Eq (a (Maybe b))
 }}}
 Which is much clearer (to me at least) than ghc's
 {{{
 t.hs:4:8:
     No instance for (Eq (m (Maybe a)))
       arising from the 'deriving' clause of a data type declaration
       at t.hs:4:8
     Possible fix: add an instance declaration for (Eq (m (Maybe a)))
     When deriving the instance for `Eq (MaybeT' m a)'
 }}}
 That is to say, Hugs refuses even the first one, as well as the second
 one.  Your problem is that GHC is treating newtypes differently from data
 (neither of which fall within Haskell98 in this case). (I have no idea if
 this is a bug. It happens on 6.6.1 at least.)

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