Changes between Version 12 and Version 13 of DefaultSuperclassInstances


Ignore:
Timestamp:
Aug 15, 2011 8:08:44 AM (3 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DefaultSuperclassInstances

    v12 v13  
    3232=== Default superclass instances === 
    3333 
    34 First, we allow a class declaration to include a '''default superclass instance delcaration''' for some, none, or all of its superclass constraints. We say that superclasses with default implementations are '''intrinsic''' superclasses. Example: 
     34First, we allow a class declaration to include a '''default superclass instance declaration''' for some, none, or all of its superclass constraints. We say that superclasses with default implementations are '''intrinsic''' superclasses. Example: 
    3535{{{ 
    3636    class Functor f => Applicative f where 
     
    4444        fmap = (<*>) . return 
    4545}}} 
    46 Note the `instance` declaration nested inside the `class` declaration. This is the default superclass instance declaration, and `Functor` thereby becomes an intrisic superclass of `Applicative`.  Moreover, note that the definition of `fmap` uses the `<*>` operation of `Applicative`; that is the whole point! 
     46Note the `instance` declaration nested inside the `class` declaration. This is the default superclass instance declaration, and `Functor` thereby becomes an intrinsic superclass of `Applicative`.  Moreover, note that the definition of `fmap` uses the `<*>` operation of `Applicative`; that is the whole point! 
    4747 
    4848Here is another example: