• Home
  • Search
  • From ML type inference to stratified type inference
  • https://doi.org/10.1145/1090189.1086367Copy DOI Icon

From ML type inference to stratified type inference

Show More
  • Abstract
  • Literature Map
  • Similar Papers
Abstract

Hindley and Milner's type system, in its purest form, allows what one might call full type inference. Even when a program contains no explicit type information, its very structure gives rise to a conjunction of type equations (or, more generally, to a constraint) whose resolution allows reconstructing the type of every variable and of every sub-expression. Actual programming languages based on this type system, such as Standard ML, Objective Caml, and Haskell, do allow users to provide explicit type information via optional type annotations. Yet, this extra information does not make type inference any easier: it simply gives rise to extra equations, leading to a more specific constraint.There are extensions of Hindley and Milner's type system where full type inference becomes undecidable or intractable. Then, it is common to require explicit type information, via mandatory type annotations. Polymorphic recursion is a simple and well-known instance of this phenomenon. This talk presents two more elaborate instances, commonly known as arbitrary-rank polymorphism and generalized algebraic data types.In both cases, type inference is made tractable thanks to mandatory type annotations. There is a twist, though: these required annotations are often numerous and redundant. So, it seems desirable to make them optional again, and to set up a distinct mechanism to guess some of the elided annotations. This mechanism, referred to as elaboration, can be heuristic. It must be predictable. In the two cases considered in this talk, it is a form of local type inference.This approach leads to a so-called stratified type inference system, where type information is propagated first in a local, ad hoc manner during elaboration, then in a possibly nonlocal, but well-specified manner during constraint solving. This appears to be one of the less displeasing ways of describing type inference systems that are able to exploit optional type annotations to infer better (or different) types.

Similar Papers
  • Conference Article
  • Citations412

Refinement types for ML

  • Jan 01, 1991
  • Tim Freeman +1
  • Research Article
  • Citations3

Deriving a complete type inference for Hindley–Milner and vector sizes using expansion

  • Mar 25, 2014
  • Science of Computer Programming
  • Axel Simon
  • Research Article

Let Generalization, Polymorphic Recursion, and Variable Minimization in Boolean-Kinded Type Systems

  • Jan 08, 2026
  • Proceedings of the ACM on Programming Languages
  • Joseph Zullo
  • Research Article
  • Citations49

The ins and outs of gradual type inference

  • Jan 18, 2012
  • ACM SIGPLAN Notices
  • Aseem Rastogi +2
  • Conference Article
  • Citations42

Type inference for COBOL systems

  • Oct 12, 1998
  • A Van Deursen +1
  • Conference Article
  • Citations123

A system of constructor classes

  • Jul 01, 1993
  • Mark P Jones
  • Research Article
  • Citations3

Relating typability and expressiveness in finite-rank intersection type systems (extended abstract)

  • Sep 01, 1999
  • ACM SIGPLAN Notices
  • Assaf J Kfoury +3
  • Conference Article
  • Citations30

Polymorphic type inference for machine code

  • Jun 02, 2016
  • Matt Noonan +2
  • Research Article
  • Citations10

Polymorphic type inference for machine code

  • Jun 02, 2016
  • ACM SIGPLAN Notices
  • Matt Noonan +2
  • Research Article

Type inference, principal typings, and let-polymorphism for first-class mixin modules

  • Sep 12, 2005
  • ACM SIGPLAN Notices
  • Henning Makholm +1
  • Single Book
  • Citations8

Programming Languages

  • Oct 27, 2022
  • Norman Ramsey
  • Book Chapter

Afterword

  • Oct 27, 2022
  • Norman F Ramsey
  • Conference Article
  • Citations24

Improved type specialization for dynamic scripting languages

  • Oct 28, 2013
  • Madhukar N Kedlaya +4
  • Book Chapter

Type Inference in Java: Characteristics and Limitations

  • Jan 01, 2021
  • Neha Kumari +1
  • Conference Article
  • Citations18

Implicit self-adjusting computation for purely functional programs

  • Sep 19, 2011
  • Yan Chen +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.