
From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Nicholls, Mark
The open case (as in OO) seems to be more like the Haskell class construct, i.e. if new types declare themselves to be members of a class then they must satisfy certain constaints....I can then specify "equals" with the class and leave the onus on the implementor to implement it....the data construct seems more analogous to a OO class definition...which is closed in the same way.
This may or may not help, but anyway... As Henning has pointed out, this is a FAQ. However, his recommended page (OOP_vs_type_classes) is quite involved. As a counterpoint, I really liked Lennart's example and summary from a couple of years ago: http://www.haskell.org/pipermail/haskell/2005-June/016058.html (I've added it to section 5 of this page: http://www.haskell.org/haskellwiki/Existential_type) The key point (IMO): "with the object oriented way it's easier to add a new kind of shape and with the functional way it's easier to add a new operation." Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************