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… 

Figures from this paper

Type-safe cast
TLDR
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
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
TLDR
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
TLDR
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
TLDR
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
TLDR
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
The limitations of type classes as subtyped implicits (short paper)
TLDR
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 )
TLDR
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
TLDR
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
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
A Theory of Type Polymorphism in Programming
  • R. Milner
  • Computer Science
    J. Comput. Syst. Sci.
  • 1978
Abstract types have existential types
TLDR
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
TLDR
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
TLDR
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
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
TLDR
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
TLDR
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
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
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
...
...