seeking ideas for short lecture on type classes
Nick Name
nick.name@inwind.it
Mon, 27 Jan 2003 02:32:53 +0100
On Sun, 26 Jan 2003 19:07:01 -0500 (EST)
Dean Herington <heringto@cs.unc.edu> wrote:
> What may distinguish Haskell from typical OO languages (I'm not an
> expert on them) is that in Haskell such polymorphic functions could
> (always or at least nearly so) be specialized statically for their
> uses at different types.
Without existential types, one big difference from an OO language and
haskell is that in haskell you can't have a datastructure such as a
list, made up of elements of a certain type class but of different
types, whereas in an OO language (say eiffel) you can have a List[A]
wich can contain any sublcass of A.
In general, even with existential types, haskell lacks a subtype
relation. I always wonder if there really is no need for subtypes (and
would appreciate any pointer to a discussion on the topic).
Vincenzo
--=20
Fedeli alla linea, anche quando non c'=E8 Quando l'imperatore =E8
malato, quando muore,o =E8 dubbioso, o =E8 perplesso. Fedeli alla linea
la linea non c'=E8. [CCCP]