The essence of ML

John C. Mitchell, Robert Harper

1988 · 106 citations · 29 references

Concepts

TL;DR

Standard ML offers polymorphic expressions, a flexible module system, and an algorithm that allows type information to be omitted. The authors investigate the implicitly‑typed expression language by defining a syntactically isomorphic explicitly‑typed polymorphic function calculus. They construct this calculus using type levels (universes) and incorporate module signatures, structures, functors, and sharing constraints, providing a unified framework for the language’s features. The resulting pure ML calculus has straightforward semantics and proves termination of recursion‑free programs, but relaxing type‑level restrictions causes inconsistency, and ML features cannot be added to impredicative calculi without assuming a type of all types.

Abstract

Standard ML is a useful programming language with polymorphic expressions and a flexible module facility. One notable feature of the expression language is an algorithm which allows type information to be omitted. We study the implicitly-typed expression language by giving a “syntactically isomorphic” explicitly-typed, polymorphic function calculus. Unlike the Girard-Reynolds polymorphic calculus, for example, the types of our ML calculus may be built-up by induction on type levels (universes). For this reason, the pure ML calculus has straightforward set-theoretic, recursion-theoretic and domain-theoretic semantics, and operational properties such as the termination of all recursion-free programs may be proved relatively simply. The signatures, structures, and functors of the module language are easily incorporated into the typed ML calculus, providing a unified framework for studying the major features of the language (including the novel “sharing constraints” on functor parameters). We show that, in a precise sense, the language becomes inconsistent if restrictions imposed by type levels are relaxed. More specifically, we prove that the important programming features of ML cannot be added to any impredicative language, such as the Girard-Reynolds calculus, without implicitly assuming a type of all types.

References

29