[Haskell-cafe] Specializing classes with classes

ajb at spamcop.net ajb at spamcop.net
Sat Dec 29 04:02:14 EST 2007


G'day all.

Quoting alex <maskif at yahoo.com.au>:

> (Presumably you meant "instance Alg Sometype",
> "instance Vec Sometype" etc.)

Yes, most likely.  Obviously I didn't try to compile the code.

> Now I know what they meant what they meant by "leave
> your OO at the door".

To be fair, Haskell typeclasses are no less OO than DCOM or CORBA, and
have similar limitations.  Haskell gives you interface inheritance, with
a couple of things that were easy to implement to make your life a bit
easier.

And, of course, the inability to declare a subclass and get the superclass
instances for free is considered by pretty much everyone to be a limitation
which will be fixed, once the tricky cases are worked out.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list