When type classes were rst introduced in Haskell they were regarded as a fairly experimental language feature, and therefore warranted a fairly conservative design. Since that time, practical experience has convinced many programmers of the bene ts and convenience of type classes. However, on occasion, these same programmers have discovered examples where seemingly natural applications for type class overloading are prevented by the restrictions imposed by the Haskell design. It is possible to extend the type class mechanism of Haskell in various ways to overcome these limitations, but such proposals must be designed with great care. For example, several di erent extensions have been implemented in Gofer. Some of these, particularly the support for multi-parameter classes, have proved to be very useful, but interactions between other aspects of the design have resulted in a type system that is both unsound and undecidable. Another illustration is the introduction of constructor classes in Haskell 1.3, which came without the proper generalization of the notion of a context. As a consequence, certain quite reasonable programs are not typable. In this paper we review the rationale behind the design of Haskell's class system, we identify some of the weaknesses in the current situation, and we explain the choices that we face in attempting to remove them.
[1]
Mark P. Jones.
Simplifying and improving qualified types
,
1995,
FPCA '95.
[2]
Philip Wadler,et al.
How to make ad-hoc polymorphism less ad hoc
,
1989,
POPL '89.
[3]
Paul Hudak,et al.
Monad transformers and modular interpreters
,
1995,
POPL '95.
[4]
Mark P. Jones.
A system of constructor classes: overloading and implicit higher-order polymorphism
,
1993,
FPCA '93.
[5]
Paul Hudak,et al.
Parametric type classes
,
1992,
LFP '92.
[6]
Mark P. Jones,et al.
The implementation of the Gofer functional programming system
,
1994
.
[7]
Martin Odersky,et al.
A second look at overloading
,
1995,
FPCA '95.
[8]
Mark P. Jones,et al.
Functional Programming with Overloading and Higher-Order Polymorphism
,
1995,
Advanced Functional Programming.
[9]
Paul Hudak,et al.
Functional reactive animation
,
1997,
ICFP '97.
[10]
Stefan Kaes,et al.
Parametric Overloading in Polymorphic Programming Languages
,
1988,
ESOP.
[11]
Chris Okasaki.
Purely Functional Data Structures: Lazy Evaluation
,
1998
.
[12]
Dale Miller,et al.
A Logic Programming Language with Lambda-Abstraction, Function Variables, and Simple Unification
,
1991,
J. Log. Comput..
[13]
Simon Peyton-Jones.
Bulk Types With Class
,
1997
.