Bulat Ziganshin <[EMAIL PROTECTED]> writes:

[...]

| Moreover, Haskell type classes supports inheritance. Run-time
| polymorphism together with inheritance are often seen as OOP
| distinctive points, so during long time i considered type classes as a
| form of OOP implementation. but that's wrong! Haskell type classes
| build on different basis, so they are like C++ templates with added
| inheritance and run-time polymorphism! And this means that usage of
| type classes is different from using classes, with its own strong and
| weak points.

Roughly Haskell type classes correspond to parameterized abstract
classes in C++ (i.e. class templates with virtual functions 
representing the operations).  Instance declarations correspond to
derivation and implementations of those parameterized classes.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to