Hostname: page-component-89b8bd64d-r6c6k Total loading time: 0 Render date: 2026-05-07T14:11:52.853Z Has data issue: false hasContentIssue false

A system of constructor classes: overloading and implicit higher-order polymorphism

Published online by Cambridge University Press:  07 November 2008

Mark P. Jones
Affiliation:
Department of Computer Science, Yale University, PO Box 208285, New Haven, CT 06520-8285, USA (e-mail: jones-mark@cs.yale.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1995
Submit a response

Discussions

No Discussions have been published for this article.