[Haskell-cafe] Re: OOPer?

David Leimbach leimy2k at gmail.com
Mon Nov 17 15:36:02 EST 2008


On Mon, Nov 17, 2008 at 10:39 AM, Maurí­cio <briqueabraque at yahoo.com> wrote:

> (...)
>
>> GHC says that the type of the result of 'function' is both determined by
>>> the "rigid type" from MyClass and  the "rigid type" from MyData. But why
>>> can't both be the same?
>>>
>>
>> are you OOPer? :)
>>
>>
> What is an OOPer?
>

I think, from the OOP point of view, that it is useful to think of classes
as collections of generic functions that may apply to different types, if
they happen to implement that class of functions.   (Would it then be fair
to equate a Haskell class to a Java Interface, but not to a Java class?)

Type are more about a range of values allowed than about functionality, as
they are in OOP languages when defined by OOP classes.

The class/data type system in Haskell really does feel to me to be more like
CLOS than like C++/Java.  But then I barely touched CLOS for a brief moment
in time to feel that way, so it's not a strong feeling :-)

Dave


>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081117/4c7484f4/attachment.htm


More information about the Haskell-Cafe mailing list