On Thu, Jul 10, 2003 at 02:33:25PM +0100, Ross Paterson wrote:
> Subclasses in Haskell cover a range of relationships, including this
> sense where things in the subclass automatically belong to the superclass.
> Other examples include Eq => Ord and Functor vs Monad.  In such cases it
> would be handy if the subclass could define defaults for the superclass
> methods (e.g. Ord defining (==)), so that the superclass instance could
> be optional.

I agree, but this needs to be carefully thought out.  For instance,
remember to consider the case that there is more than one default
instance for a given method of a superclass.  I am reminded of
multiple inheritance considerations.

(These difficulties came up before when I was thinking about the
numeric heirarchy, and was the reason I proposed a heirarchy which was
much less fine-grained than, e.g., in Mechvelliani's proposal.)

Peace,
        Dylan

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to