ComputingComputer ScienceCompilersProgramming LanguagesSyntaxAnnotationData TypesType CheckingType SystemsPolymorphic Type SystemsScopeType Inference
As type inference systems become more sophisticated, it becomes increasingly important to allow the programmer to give type annotations that both document the program and guide type inference. In Haskell 98, it is not possible to write certain type annotations, because they must mention a type that is “in scope” and the language provides no way to name such types. The obvious solution is to provide language support for lexicallyscoped type variables, an area whose design space has not been systematically explored. Our contribution is to bring together the relevant folk lore, in coherent form, and make it accessible to a much larger community than hitherto. In particular, we describe and contrast two main alternative designs — the “type-lambda” approach of SML 97, and an alternative “type-sharing” approach which is used by GHC and OCaml — and survey some alternative design choices. Scoped type variables will play a key role in the type systems of the future; they can no longer be added as an afterthought to language implementations.
9
A theory of type polymorphism in programming
Robin Milner · Journal of Computer and System Sciences · 1978 · 2.2K citations · Full text
The system F of variable types, fifteen years later
Jean-Yves Girard · Theoretical Computer Science · 1986 · 356 citations
R. M. Burstall, David MacQueen, Donald Sannella · 1980 · 351 citations
Putting type annotations to work
Martin Odersky, Konstantin Läufer · 1996 · 165 citations · Full text