Nothing Special   »   [go: up one dir, main page]

skip to main content
Polymorphic type inference and abstract data types
Publisher:
  • New York University
  • 202 Tisch Hall Washington Square New York, NY
  • United States
Order Number:UMI Order No. GAX93-06782
Reflects downloads up to 16 Nov 2024Bibliometrics
Skip Abstract Section
Abstract

Many statically-typed programming languages provide an abstract data type construct, such as the package in Ada, the cluster in CLU, and the module in Modula2. However, in most of these languages, instances of abstract data types are not first-class values. Thus they cannot be assigned to a variable, passed as a function parameter or returned as a function result.

The higher-order functional language ML has a strong and static type system with parametric polymorphism. In addition, ML provides type reconstruction and consequently does not require type declarations for identifiers. Although the ML module system supports abstract data types, their instances cannot be used as first-class values for type-theoretic reasons.

In this dissertation, we describe a family of extensions of ML. While retaining ML's static type discipline, type reconstruction, and most of its syntax, we add significant expressive power to the language by incorporating first-class abstract types as an extension of ML's free algebraic datatypes. In particular, we are now able to express (1) multiple implementations of a given abstract type, (2) heterogeneous aggregates of different implementations of the same abstract type, and (3) dynamic dispatching of operations with respect to the implementation type.

Following Mitchell and Plotkin, we formalize abstract types in terms of existentially quantified types. We prove that our type system is semantically sound with respect to a standard denotational semantics.

We then present an extension of Haskell, a non-strict functional language that uses type classes to capture systematic overloading. This language results from incorporating existentially quantified types into Haskell and gives us first-class abstract types with type classes as their interfaces. We can now express heterogeneous structures over type classes. The language is statically typed and offers comparable flexibility to object-oriented languages. Its semantics is defined through a type-preserving translation to a modified version of our ML extension.

We have implemented a prototype of an interpreter for our language, including the type reconstruction algorithm, in Standard ML.

Contributors
  • Loyola University Chicago
Please enable JavaScript to view thecomments powered by Disqus.

Recommendations