Local type inference
Benjamin C. Pierce, David N. Turner · ACM Transactions on Programming Languages and Systems · 2000
We study two partial type inference methods for a language combining subtyping and impredicative polymorphism. Both methods are local in the sense that missing annotations are recovered using only information from adjacent nodes in the syntax tree, without long-distance constraints such as unification variables. One method infers type arguments in polymorphic applications using a local constraint solver. The other infers annotations on bound variables in function abstractions by propagating type constraints downward from enclosing application nodes. We motivate our design choices by a statistical analysis of the uses of type inference in a sizable body of existing ML code.
Cited by 287 works. doi:10.1145/345099.345100 Open-access PDF
Authors
References
- On understanding types, data abstraction, and polymorphism
- Towards a theory of type structure
- A unification algorithm for typed λ-calculus
- Pizza into Java
- Complete Type Inference for Simple Objects
- Formal description of programming concepts
- Making the future safe for the past
- Type checking records and variants in a natural extension of ML
- Type inclusion constraints and type inference
- Elf: a language for logic definition and verified metaprogramming