[GHC] #5462: Deriving clause for arbitrary classes

GHC cvs-ghc at haskell.org
Fri Sep 16 22:27:12 CEST 2011


#5462: Deriving clause for arbitrary classes
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.2.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by guest):

 Replying to [comment:12 simonpj]:

 >the compiler will fill in a bunch of defaults from the class decl, or
 error thunks if you supplied none.  It's just not usually ''useful'' to do
 so.

 proposed sounds perfectly reasonable - but just to ask about the more
 liberal option: while a collection of error thunks is far more likely a
 programmer mistake than the intended effect of putting an arbitrary class
 into the deriving clause (dterei didn't expect it could even work, nor did
 I), I'd think getting a boring instance of default methods is precisely
 what s/he would expect if deriving from a class w/o any default method
 signatures. So why not let him/her have it? Apart from probable
 uselessness, is there a price to be payed by such a choice?

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



More information about the Glasgow-haskell-bugs mailing list