About

Log in?

DTU users get better search results including licensed content and discounts on order fees.

Anyone can log in and get personalized features such as favorites, tags and feeds.

Log in as DTU user Log in as non-DTU user No thanks

DTU Findit

Journal article ยท Conference paper

Type inference, principal typings, and let-polymorphism for first-class mixin modules

From

Department of Informatics and Mathematical Modeling, Technical University of Denmark1

A mixin module is a programming abstraction that simultaneously generalizes lambda-abstractions, records, and mutually recursive definitions. Although various mixin module type systems have been developed, no one has investigated principal typings or developed type inference for first-class mixin modules, nor has anyone added Milner's let-polymorphism to such a system.

This paper proves that typability is NP-complete for the naive approach followed by previous mixin module type systems. Because a lambda-calculus extended with record concatenation is a simple restriction of our mixin module calculus, we also prove the folk belief that typability is NP-complete for the naive early type systems for record concatenation.

To allow feasible type inference, we present Martini, a new system of simple types for mixin modules with principal typings. Martini is conceptually simple, with no subtyping and a clean and balanced separation between unification-based type inference with type and row variables and constraint solving for safety of linking and field extraction.

We have implemented a type inference algorithm and we prove its complexity to be O(n(2)), or O(n) given a fixed bound on the number of field labels.' To prove the complexity, we need to present an algorithm for row unification that may have been implemented by others, but which we could not find written down anywhere.

Because Martini has principal typings, we successfully extend it with Milner's let-polymorphism.

Language: English
Publisher: Association for Computing Machinery (ACM)
Year: 2005
Pages: 156-167
Proceedings: 10th ACM SIGPLAN International Conference on Functional Programming
ISSN: 15581160 and 03621340
Types: Journal article and Conference paper
DOI: 10.1145/1090189.1086386

DTU users get better search results including licensed content and discounts on order fees.

Log in as DTU user

Access

Analysis