Type classes and code generation

Hal Daume III hdaume@ISI.EDU
Tue, 17 Jun 2003 07:50:23 -0700 (PDT)


(Moved to the Cafe)

> Yes, exactly.  Every class is translated to a data type declaration, 
> and every instance is translated to an element of that data type - a 
> dictionary.  (Note that you can't actually write those declarations in 
> Haskell 98 in general, because they can have polymorphic fields; but 
> this is a simple extension to the language).

Keith, could you elaborate on this parenthetical?  Under what
circumstances can you not create the dictionary datatype for a class in
Haskell 98 (where the class itself is H98 :P)?

 - Hal