[Haskell-cafe] Re: How to present the commonness of some objects?

Maurí­cio briqueabraque at yahoo.com
Fri Jul 3 11:39:46 EDT 2009

>> Wow, this complex.... Thank you. I will try that.

> No, don't!  There is an easier way.
> (...)  This is the point at 
> which you are forced to move away from OO thinking.

This seems to be worth clearing a little bit. I usually read
people saying that this kind of misundestanding is a confusion
with object oriented background, when actually I believe it
is not.

Magicloud's assumption are all correct, in the Haskell
way of thinking. Classes do behave the way he thinks it
does. The problem was only that you can't (without existential
quantification) build lists of elements with diferent types for
each element -- as you also can't do in languages like C++. The
way to achieve that in C++ is to use a list of pointers, while
in Haskell you can use existential quantification.

(Confusion with OO is less of a problem than people use to
think it is. I've already been told that something I wanted was
OO specific, and I later realized what I needed is available
in Haskell and is called associated type, as in type families.)


More information about the Haskell-Cafe mailing list