
In OO languages I try not to use inheritance just because I want
re-use - I tend to lean more towards having an instance of class A
contain or wrap around an instance of class B - I will only use
inheritance if A truly is a more specific version of B. Even then I
try to make sure there aren't clearer ways of expressing what I want.
This approach applies perfectly well to types in Haskell - compound
types can be composed of values of other types.
But there is not a way to easily say (in Haskell) "type A is
everything that type B is plus these other things here ...". Haskell
is not an OO language.
Antoine
On Mon, Dec 13, 2010 at 11:16 AM, C K Kashyap
Hi, In oops, one can do reuse code by extending a parent class. What is the equivalent in Haskell? Regards, Kashyap
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners