Changes between Version 1 and Version 2 of DerivedInstances


Ignore:
Timestamp:
Dec 1, 2005 10:24:17 PM (8 years ago)
Author:
loeh@…
Comment:

some additional shortcomings of the current "deriving" mechanism

Legend:

Unmodified
Added
Removed
Modified
  • DerivedInstances

    v1 v2  
    55  * Automatic derivation is only available for certain classes defined in the Prelude and standard libraries. 
    66  * There is no way to specify how to derive a user-defined class in the general case. 
     7  * There is no way to derive an instance of a class for a data type that is defined elsewhere (in another module). 
     8  * There is no easy way to refer to the definitions that would have been derived when defining an explicit instance. 
     9  * Deriving fails for some Haskell-98 data types. Try 
     10{{{ 
     11data Rose f a = Fork a (f (Rose f a)) deriving Show 
     12}}} 
     13    as an example. 
    714  * Even in the absence of user-defined deriving, it should be easy for a 'newtype' decl to inherit some of the instances of its parent type, no matter where the class was defined, but this is currently only available as a ghc extension to haskell'98. 
    815