[GHC] #4815: Instance constraints should be used when deriving on associated data types

GHC cvs-ghc at haskell.org
Thu Dec 16 09:51:03 CET 2010


#4815: Instance constraints should be used when deriving on associated data types
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  6.12.3      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by simonpj):

 It's not clear that you always want this.  Suppose your data decl was
 {{{
 instance Foo a => Foo (Maybe a) where
     data Associated (Maybe a) = AssociatedMaybe a
                               deriving (Eq)
 }}}
 Here, `Eq a` would be enough. Wouldn't you expect this
 {{{
 instance Eq a => Eq (Associated (Maybe a))
 }}}
 rather than
 {{{
 instance Foo a => Eq (Associated a)
 }}}
 ?  Maybe standalone deriving is the Right Way, not just a workaround.

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



More information about the Glasgow-haskell-bugs mailing list