Costs of a class hierarchy
Dylan Thurston
dpt@math.harvard.edu
Thu, 10 Jul 2003 12:08:24 -0400
--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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
--C7zPtVaVf+AK4Oqc
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/DY93Veybfhaa3tcRAlK5AKCDwGJ8Dgq0thavgKJvoPHaHeOR3ACeOx8G
JNYwOLB0YQqJrVIcy4pWXDI=
=Vx7s
-----END PGP SIGNATURE-----
--C7zPtVaVf+AK4Oqc--