Hindley–Milner type system
Builds on Simply typed lambda calculusType inferenceSubstitutionUnification
Definition
Fix a set of type variables and a set of type constructors containing the arrow . The monotypes are , where is a type constructor of arity ; in particular is a monotype. The type schemes are . The terms are . A context assigns type schemes to finitely many variables. A monotype is an instance of if for some monotypes . The typing relation of the Hindley–Milner type system is the least relation closed under these rules.
- Variable: if is in and is an instance of , then .
- Application: if and , then .
- Abstraction: if with a monotype, then .
- Let: if and , then .
Here , where are the type variables free in but not free in .
Remarks
Example: . The check: rule 3 gives , and rule 4 gives the scheme . By rule 1 the first gets the instance and the second gets , so rule 2 gives .
Non-example: has no type. Rule 3 gives the bound variable a single monotype , and would need , which no monotype satisfies. So polymorphism is available for -bound names but not for -bound ones.
Algorithm W of Damas and Milner computes a principal type of every typable term by unification of monotypes. This makes type inference decidable for the system.
Reading path
To understand this page from the ground up, read these 28 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Element definition
- Intuitionistic logic concept
- Lambda calculus concept
- Proposition concept
- Set concept
- Substitution concept
- Type system concept
- Unification concept
- Set definition
- Conjunction definition
- Disjunction definition
- Implication definition
- Negation definition
- Type inference concept
- Biconditional definition
- Truth table concept
- Modus ponens concept
- Mathematical proof concept
- Propositional logic concept
- Tautology definition
- Logical equivalence definition
- Double negation law statement
- Proof by contradiction concept
- Russell's paradox statement
- Type theory concept
- Curry–Howard correspondence concept
- Simply typed lambda calculus concept
- Hindley–Milner type system definition
Further reading
About this page
| Tag | APWK8VAXGD |
|---|---|
| URI | m2://APWK8VAXGD |
| Kind | definition |
| Writing | W0 stub |
| MSC | 68N18, 68N15, 03B40 |
| Defines | Hindley–Milner type system |
| Uses | Simply typed lambda calculus, Type inference, Substitution, Unification |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.