
29 Dec
2007
29 Dec
'07
4:02 a.m.
G'day all.
Quoting alex
(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