English

Typing Classes and Mixins with Intersection Types

Programming Languages 2015-03-18 v1 Logic in Computer Science Software Engineering

Abstract

We study an assignment system of intersection types for a lambda-calculus with records and a record-merge operator, where types are preserved both under subject reduction and expansion. The calculus is expressive enough to naturally represent mixins as functions over recursively defined classes, whose fixed points, the objects, are recursive records. In spite of the double recursion that is involved in their definition, classes and mixins can be meaningfully typed without resorting to neither recursive nor F-bounded polymorphic types. We then adapt mixin construct and composition to Java and C#, relying solely on existing features in such a way that the resulting code remains typable in the respective type systems. We exhibit some example code, and study its typings in the intersection type system via interpretation into the lambda-calculus with records we have proposed.

Keywords

Cite

@article{arxiv.1503.04911,
  title  = {Typing Classes and Mixins with Intersection Types},
  author = {Jan Bessai and Boris Düdder and Andrej Dudenhefner and Tzu-Chun Chen and Ugo de'Liguoro},
  journal= {arXiv preprint arXiv:1503.04911},
  year   = {2015}
}

Comments

In Proceedings ITRS 2014, arXiv:1503.04377

R2 v1 2026-06-22T08:54:49.712Z