[GHC] #5462: Deriving clause for arbitrary classes

GHC cvs-ghc at haskell.org
Fri Sep 9 11:28:26 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 simonpj):

 The question is '''what should the 'list of requirements' be?'''.

 Remember it is '''always''' legal to say
 {{{
 instance C (T a) where {}
 }}}
 becuase 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.

 When it is useful?  Really only the programmer can tell us.  I was
 proposing above that a clue might be that s/he provided at least one
 default-method signature (using the new Pedro stuff) since that is our
 main route to providing non-trivial defaults.

 Yes it'd be a little smoother to allow `deriving( Generic, C )`.  But it
 needs design.

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



More information about the Glasgow-haskell-bugs mailing list