# How to make ad-hoc polymorphism less ad hoc

@inproceedings{Wadler1989HowTM, title={How to make ad-hoc polymorphism less ad hoc}, author={Philip Wadler and Stephen Blott}, booktitle={POPL '89}, year={1989} }

This paper presents type classes, a new approach to ad-hoc polymorphism. Type classes permit overloading of arithmetic operators such as multiplication, and generalise the “eqtype variables” of Standard ML. Type classes extend the Hindley/Milner polymorphic type system, and provide a new approach to issues that arise in object-oriented programming, bounded type quantification, and abstract data types. This paper provides an informal introduction to type classes, and defines them formally by…

## 903 Citations

Type-safe cast

- Computer ScienceJ. Funct. Program.
- 2004

This paper demonstrates the solution to eliminate overhead in the naive implementation of a function to convert a term from one abstract type to another using higher-order type abstraction using intensional type analysis and type classes.

Type Reconstruction for Type Classes 1

- Mathematics

We study the type inference problem for a system with type classes as in the functional programming language Haskell. Type classes are an extension of ML-style polymorphism with overloading. We…

Type Reconstruction for Type Classes

- MathematicsJ. Funct. Program.
- 1995

A new uniCation algorithm is presented which is an extension of syntactic uni cation with constraint solving and the existence of principal types follows from an analysis of this uni Cation algorithm.

An ad hoc approach to the implementation of polymorphism

- Computer ScienceTOPL
- 1991

A new technique is described which can implement all forms of polymorphism, use a conventional machine architecture and support non-uniform data representations and ensures that any extra cost of implementation applies to polymorphic forms only and allows them to persist over program invocations.

Type checking type classes

- Computer SciencePOPL '93
- 1993

A new unification algorithm is presented which is an extension of syntactic unification with constraint solving and the existence of principal types follows from an analysis of this unification algorithm.

Type Classes and Constraint Handling Rules

- Computer ScienceArXiv
- 2000

Constraint Handling Rules is proposed to employ as a tool to study and develop type class systems in a uniform way to allow extensions to be characterised and studied rigorously.

Using kinds to type partially-polymorphic methods

- Computer ScienceElectron. Notes Theor. Comput. Sci.
- 2002

The limitations of type classes as subtyped implicits (short paper)

- Computer ScienceSCALA@SPLASH
- 2017

This paper describes instances of this problem and shows that they are not merely theoretical but often arise in practice, and discusses and compares the space of solutions to this problem in Scala today and in the future.

Unifying Nominal and Structural Ad-hoc Polymorphism ( Extended Version )

- Computer Science
- 2004

An expressive language that supports both forms of ad-hoc polymorphism in a single framework, the ability to define both “open” and “closed” operations with a single mechanism, and new mechanisms for defining higher-order polytypism and manipulating generative type definitions.

Encoding Intensional Type Analysis

- Computer ScienceESOP
- 2001

This paper observes that specialized operators in intensional type analysis need not be intrinsic to the language, and in fact, their operation may be simulated through standard encodings of iteration in the polymorphic lambda calculus, which may be more easily added to complicated languages via translation, instead of language extension.

## References

SHOWING 1-10 OF 28 REFERENCES

Three Approaches to Type Structure

- Computer ScienceTAPSOFT, Vol.1
- 1985

We examine three disparate views of the type structure of programming languages: Milner's type deduction system and polymorphic let construct, the theory of subtypes and generic operators, and the…

Abstract types have existential types

- Computer SciencePOPL
- 1985

This work uses a second-order typed lambda calculus SOL to show how data algebras may be given types, passed as parameters, and returned as results of function calls.

Abstract types have existential type

- Computer ScienceTOPL
- 1988

This work uses a second-order typed lambda calculus SOL to show how data algebras may be given types, passed as parameters, and returned as results of function calls.

On understanding types, data abstraction, and polymorphism

- Computer ScienceCSUR
- 1985

A λ-calculus-based model for type systems that allows us to explore the interaction among the concepts of type, data abstraction, and polymorphism in a simple setting, unencumbered by complexities of production programming languages is developed.

Miranda: A Non-Strict Functional language with Polymorphic Types

- Computer ScienceFPCA
- 1985

data types Many of the data types which in other languages would have to be expressed as abstract data types can be represented in Miranda as algebraic data types with associated laws. Nevertheless…

Structural subtyping and the notion of power type

- Computer SciencePOPL '88
- 1988

The mixing of value and type levels becomes a considerable obstacle when considering compiled languages, or languages extended with imperative features, which must make a clear distinction between compile-time and run-time phases.

Definition of standard ML

- Computer Science
- 1990

This book provides a formal definition of Standard ML for the benefit of all concerned with the language, including users and implementers, and the authors have defined their semantic objects in mathematical notation that is completely independent of StandardML.

The Principal Type-Scheme of an Object in Combinatory Logic

- Philosophy
- 1969

One of the aims of combinatory logic is to study the most basic properties of functions and other concepts, with as few restrictions as possible; hence in the simplest form of combinatory logic there…

Principal type-schemes for functional programs

- GeologyPOPL '82
- 1982

Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of…