Polymorphic type inference and abstract data types
- 1 September 1994
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 16 (5) , 1411-1430
- https://doi.org/10.1145/186025.186031
Abstract
Many statically typed programming languages provide an abstract data type construct, such as the module in Modula-2. However, in most of these languages, implementations of abstract data types are not first-class values. Thus, they cannot be assigned to variables, passed as function parameters, or returned as function results. Several higher-order functional languages feature strong and static type systems, parametric polymorphism, algebraic data types, and explicit type variables. Most of them rely on Hindley-Milner type inference instead of requiring explicit type declarations for identifiers. Although some of these languages support abstract data types, it appears that none of them directly provides light-weight abstract data types whose implementations are first-class values. We show how to add significant expressive power to statically typed functional languages with explicit type variables by incorporating first-class abstract types as an extension of algebraic data types. Furthermore, we extend record types to allow abstract components. The components of such abstract records are selected using the dot notation. Following Mitchell and Plotkin, we formalize abstract types in terms of existentially quantified types. We give a syntactically sound and complete type inference algorithm and prove that our type system is semantically sound with respect to standard denotational semantics.Keywords
This publication has 7 references indexed in Scilit:
- Simple type-theoretic foundations for object-oriented programmingJournal of Functional Programming, 1994
- The Formal Semantics of Programming LanguagesPublished by MIT Press ,1993
- Report on the programming language HaskellACM SIGPLAN Notices, 1992
- Dynamics in MLPublished by Springer Nature ,1991
- Abstract types have existential typeACM Transactions on Programming Languages and Systems, 1988
- An ideal model for recursive polymorphic typesInformation and Control, 1986
- On understanding types, data abstraction, and polymorphismACM Computing Surveys, 1985