Hostname: page-component-8448b6f56d-c4f8m Total loading time: 0 Render date: 2024-04-24T00:48:59.449Z Has data issue: false hasContentIssue false

Type-checking multi-parameter type classes

Published online by Cambridge University Press:  22 March 2002

DOMINIC DUGGAN
Affiliation:
Department of Computer Science, Stevens Institute of Technology, Castle Point on the Hudson, Hoboken, NJ 07030, USA
JOHN OPHEL
Affiliation:
Department of Computer Science and Computer Engineering, La Trobe University, Bundoora, Victoria 3083, Australia
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.

Type classes are a novel combination of parametric polymorphism and constrained types. Although most implementations restrict type classes to be single-parameter, the generalization to multi-parameter type classes has gained increasing attention. A problem with multi-parameter type classes is the increased possibilities they introduce for ambiguity in inferred types, impacting their usefulness in many practical situations. A new type-checking strategy, domain-driven unifying resolution, is identified as an approach to solve these problems. Domain-driven unifying resolution is simple, efficient, and practically useful. However, even with severe restrictions on instance definitions, it is not possible to guarantee that type-checking with unifying resolution terminates. This is in contrast with the naive generalization of single parameter resolution strategies. Domain-driven unifying resolution is guaranteed to terminate if the type class constraints are satisfiable; however satisfiability is undecidable even with severe restrictions on instance definitions. These results shed some light on ambiguity problems with multi-parameter type classes.

Type
Research Article
Copyright
© 2002 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.