Type classes in Haskell

This article defines a set of type inference rules for resolving overloading introduced by type classes, as used in the functional programming language Haskell. Programs including type classes are transformed into ones which may be typed by standard Hindley-Milner inference rules. In contrast to other work on type classes, the rules presented here relate directly to Haskell programs. An innovative aspect of this work is the use of second-order lambda calculus to record type information in the transformed program.

[1]  Tobias Nipkow,et al.  Type Classes and Overloading Resolution via Order-Sorted Unification , 1991, FPCA.

[2]  Tobias Nipkow,et al.  Type checking type classes , 1993, POPL '93.

[3]  François Rouaix,et al.  Safe run-time overloading , 1989, POPL '90.

[4]  Stephen Blott,et al.  Implementing Haskell Type Classes , 1989, Functional Programming.

[5]  Robin Milner,et al.  Commentary on standard ML , 1990 .

[6]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[7]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[8]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[9]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[10]  John C. Reynolds,et al.  Three Approaches to Type Structure , 1985, TAPSOFT, Vol.1.

[11]  Kevin Hammond Efficient Type Inference Using Monads (Summary) , 1991, Functional Programming.

[12]  Paul Hudak,et al.  Parametric type classes , 1992, LFP '92.

[13]  Geoffrey Smith,et al.  On the Complexity of ML Typability with Overloading , 1991, FPCA.

[14]  Kung Chen A parametric extension of Haskell's type classes , 1994 .

[15]  Gérard Huet,et al.  Logical Foundations of Functional Programming , 1990 .

[16]  Lennart Augustsson,et al.  Implementing Haskell overloading , 1993, FPCA '93.

[17]  Mark P. Jones A Theory of Qualified Types , 1992, ESOP.

[18]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[19]  Luca Cardelli,et al.  Basic Polymorphic Typechecking , 1987, Sci. Comput. Program..

[20]  Gordon V. Cormack,et al.  Type-dependent parameter inference , 1990, PLDI '90.

[21]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[22]  Martin Odersky,et al.  Polymorphic type inference and abstract data types , 1994, TOPL.

[23]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[24]  Martin Odersky,et al.  Type Classes are Signatures of Abstract Types , 1991, Declarative Programming.

[25]  Mark P. Jonesy A Theory of Qualiied Types , 1992 .

[26]  Simon L. Peyton Jones,et al.  Type Classes in Haskell , 1994, ESOP.

[27]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[28]  Mark P. Jones A system of constructor classes: overloading and implicit higher-order polymorphism , 1993, FPCA '93.

[29]  Mark P. Jones Simplifying and improving qualified types , 1995, FPCA '95.

[30]  Robin Milner,et al.  Definition of standard ML , 1990 .

[31]  D. A. Turner,et al.  Miranda: A Non-Strict Functional language with Polymorphic Types , 1985, FPCA.

[32]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[33]  WadlerPhilip,et al.  Report on the programming language Haskell , 1992 .