Changes between Version 11 and Version 12 of DefaultSuperclassInstances


Ignore:
Timestamp:
Mar 13, 2011 11:30:50 AM (3 years ago)
Author:
pigworker
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DefaultSuperclassInstances

    v11 v12  
    44 
    55We may distinguish two uses of superclasses (not necessarily exclusive).  
    6  * A class can ''widen'' its superclass, extending its interface with new functionality (e.g., adding an inverse to a monoid to obtain a group -- inversion seldom provides an implementation of composition).  
    7  * A class can ''deepen'' its superclass (e.g., an implementation of Traversable f delivers at least enough technology to deliver Foldable f and Functor f).  
     6 * A class can ''widen'' its superclass, extending its interface with new functionality (e.g., adding an inverse to a monoid to obtain a group -- inversion seldom provides an implementation of composition). The subclass methods provide extra functionality, but do not induce a standard implementation of the superclass. Num provides arithmetic operations, widening Eq, but does not induce an implementation of {{{(==)}}}. 
     7 * A class can ''deepen'' its superclass, providing methods at least as expressive, admitting a default implementation of superclass functionality (e.g., the {{{compare}}} function from an Ord instance can be used to give an Eq instance; {{{traverse}}} from Traversable f can be instantiated to {{{foldMapDefault}}} for Foldable f and {{{fmapDefault}}} for Functor f).  
    88 
    99('''SLPJ''' I don't understand this distinction clearly.)