• Home
  • Search
  • Type inference, principal typings, and let-polymorphism for first-class mixin modules
  • Open Access IconOpen Access
  • https://doi.org/10.1145/1090189.1086386Copy DOI Icon

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

Show More
  • Abstract
  • Literature Map
  • References
  • Similar Papers
Abstract

A mixin module is a programming abstraction that simultaneously generalizes λ-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 λ-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.

Similar Papers
  • Research Article

From ML type inference to stratified type inference

  • Sep 12, 2005
  • ACM SIGPLAN Notices
  • François Pottier
  • Conference Article
  • Citations123

A system of constructor classes

  • Jul 01, 1993
  • Mark P Jones
  • Book Chapter

Type Inference in Java: Characteristics and Limitations

  • Jan 01, 2021
  • Neha Kumari +1
  • Conference Article
  • Citations30

Polymorphic type inference for machine code

  • Jun 02, 2016
  • Matt Noonan +2
  • Research Article
  • Citations10

Polymorphic type inference for machine code

  • Jun 02, 2016
  • ACM SIGPLAN Notices
  • Matt Noonan +2
  • Conference Article
  • Citations412

Refinement types for ML

  • Jan 01, 1991
  • Tim Freeman +1
  • Conference Article
  • Citations42

Type inference for COBOL systems

  • Oct 12, 1998
  • A Van Deursen +1
  • Conference Article
  • Citations98

Type inference for record concatenation and multiple inheritance

  • Jun 05, 1989
  • M Wand
  • Conference Article
  • Citations10

From ML to ML F

  • Sep 20, 2008
  • Didier Rémy +1
  • Research Article
  • Citations3

Relating typability and expressiveness in finite-rank intersection type systems (extended abstract)

  • Sep 01, 1999
  • ACM SIGPLAN Notices
  • Assaf J Kfoury +3
  • Conference Article
  • Citations21

Type inference for datalog and its application to query optimisation

  • Jun 09, 2008
  • Oege De Moor +3
  • Conference Article
  • Citations4

Bidirectional data-flow analyses, type-systematically

  • Jan 19, 2009
  • Maria João Frade +2
  • Conference Article
  • Citations1

Efficient Counter-factual Type Error Debugging

  • Jul 01, 2019
  • Sheng Chen +1
  • Conference Article
  • Citations128

What are principal typings and what are they good for?

  • Jan 01, 1996
  • Trevor Jim
  • Research Article
  • Citations11

Probability type inference for flexible approximate programming

  • Oct 23, 2015
  • ACM SIGPLAN Notices
  • Brett Boston +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.