A system of constructor classes: overloading and implicit higher-order polymorphism
- 1 January 1995
- journal article
- research article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 5 (1) , 1-35
- https://doi.org/10.1017/s0956796800001210
Abstract
This paper describes a flexible type system that combines overloading and higher-order polymorphism in an implicitly typed language using a system of constructor classes—a natural generalization of type classes in Haskell. We present a range of examples to demonstrate the usefulness of such a system. In particular, we show how constructor classes can be used to support the use of monads in a functional language. The underlying type system permits higher-order polymorphism but retains many of the attractive features that have made Hindley/Milner type systems so popular. In particular, there is an effective algorithm that can be used to calculate principal types without the need for explicit type or kind annotations. A prototype implementation has been developed providing, amongst other things, the first concrete implementation of monad comprehensions known to us at the time of writing.Keywords
This publication has 13 references indexed in Scilit:
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Building interpreters by composing monadsPublished by Association for Computing Machinery (ACM) ,1994
- A gentle introduction to HaskellACM SIGPLAN Notices, 1992
- Report on the programming language HaskellACM SIGPLAN Notices, 1992
- The essence of functional programmingPublished by Association for Computing Machinery (ACM) ,1992
- Parametric type classesPublished by Association for Computing Machinery (ACM) ,1992
- A functional theory of exceptionsScience of Computer Programming, 1990
- How to make ad-hoc polymorphism less ad hocPublished by Association for Computing Machinery (ACM) ,1989
- Modules for standard MLPublished by Association for Computing Machinery (ACM) ,1984
- A Machine-Oriented Logic Based on the Resolution PrincipleJournal of the ACM, 1965