seeking ideas for short lecture on type classes

John Hörnkvist john@toastedmarshmallow.com
Sun, 26 Jan 2003 20:50:37 +0100


On Saturday, January 25, 2003, at 04:14 AM, Andrew J Bromage wrote:

> G'day all.
>
> On Fri, Jan 24, 2003 at 06:13:29PM -0500, Norman Ramsey wrote:
>
>> In a fit of madness, I have agreed to deliver a 50-minute lecture
>> on type classes to an audience of undergraduate students.  These
>> students will have seen some simple typing rules for F2 and will
>> have some exposure to Hindley-Milner type inference in the context
>> of ML.
>
> Will they have had exposure to more "traditional" OO programming?  If
> so, it might be useful to note the difference between Haskell type
> classes and C++/Java/whatever classes, namely that Haskell decouples
> types and the interfaces that they support.  The advantage is that you
> can extend a type with a new interface at any point, not just when you
> define the type.

While Java and C++ don't support it other object oriented languages do.

Extending and amending the capabilities of existing classes is 
important in Objective-C (through categories and posing) and TOM.

Smalltalk also supports it.

Regards,
John Hornkvist