[Haskell-cafe] Re: OOP'er with (hopefully) trivial questions.....

Bayley, Alistair Alistair_Bayley at invescoperpetual.co.uk
Mon Dec 17 08:30:07 EST 2007

> From: haskell-cafe-bounces at haskell.org 
> [mailto:haskell-cafe-bounces at 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:

(I've added it to section 5 of this page:

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

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.

More information about the Haskell-Cafe mailing list