Polymorphism for Imperative Languages without Imperative Types
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
The simple and elegant Hindley/Milner polymorphic type discipline is the basis of the type system of Standard ML, but ML's imperative features are a blight on this otherwise clean landscape. Polymorphism and imperative features cannot freely coexist without compromising type safety, hence Standard MLassigns imperative types of limited polymorphism to procedures that use references, exceptions, or continuations. Several other solutions exist, but all introduce new kinds of types that complicate the type system, contaminate module signatures, and violate abstraction by revealing the pure or imperative nature of a procedure in its type. We propose a seemingly radical alternative: by restricting polymorphism to values, imperative procedures have the same types as their behaviorally equivalent functional counterparts. Although the resulting type system does not accept all expressions typable in the purely functional sublanguage, this limitation is seldom encountered in practice. The vast majority of ML code already satisfies the restriction of polymorphism to values, and simple syntactic modifications fix the few non-conforming programs.
Description
Advisor
Degree
Type
Keywords
Citation
Wright, Andrew. "Polymorphism for Imperative Languages without Imperative Types." (1993) https://hdl.handle.net/1911/96432.