Changes between Version 1 and Version 2 of DefaultSuperclassInstances


Ignore:
Timestamp:
Mar 10, 2011 12:37:56 AM (4 years ago)
Author:
pigworker
Comment:

hiding instance added

Legend:

Unmodified
Added
Removed
Modified
  • DefaultSuperclassInstances

    v1 v2  
    5151}}} 
    5252we override the default (>>) but keep the (<*>) in the spawned Applicative instance. 
     53  * to inhibit default-spawning with the syntax 
     54{{{ 
     55    instance Sub x where 
     56      ... 
     57      hiding instance Super 
     58}}} 
     59which acts to prevent the generation of instances for Super and all of Super's intrinsic superclasses in turn. We need this, so that we can write 
     60{{{ 
     61    instance Monad Blah where 
     62      return x = ... 
     63      ba >>= bf = ... 
     64      hiding instance Functor 
     65 
     66    instance Traversable Blah where 
     67      traverse f bx = ...  -- inducing a default implementation of Functor 
     68}}} 
     69or indeed to turn off all the defaults and provide a standalone Functor instance. 
     70