Row and Bounded Polymorphism via Disjoint Polymorphism


Ningning Xie and Bruno C. d. S. Oliveira and Xuan Bi and Tom Schrijvers.
34th European Conference on Object-Oriented Programming, ECOOP 2020, November 15-17, 2020, Berlin, Germany (Virtual Conference).
Robert Hirschfeld and Tobias Pape, eds.
pp. 27:1--27:30, Schloss Dagstuhl - Leibniz-Zentrum f\"ur Informatik, 2020.

Abstract

Polymorphism and subtyping are important features in mainstream OO languages. The most common way to integrate the two is via Fsub style bounded quantification. A closely related mechanism is row polymorphism, which provides an alternative to subtyping, while still enabling many of the same applications. Yet another approach is to have type systems with intersection types and polymorphism. A recent addition to this design space are calculi with disjoint intersection types and disjoint polymorphism. With all these alternatives it is natural to wonder how they are related. This paper provides an answer to this question. We show that disjoint polymorphism can recover forms of both row polymorphism and bounded polymorphism, while retaining key desirable properties, such as type-safety and decidability. Furthermore, we identify the extra power of disjoint polymorphism which enables additional features that cannot be easily encoded in calculi with row polymorphism or bounded quantification alone. Ultimately we expect that our work is useful to inform language designers about the expressive power of those common features, and to simplify implementations and metatheory of feature-rich languages with polymorphism and subtyping.

BibTeX

@inproceedings{ecoop2020,
  author = {Ningning Xie and
               Bruno C. d. S. Oliveira and
               Xuan Bi and
               Tom Schrijvers},
  editor = {Robert Hirschfeld and
               Tobias Pape},
  title = {Row and Bounded Polymorphism via Disjoint Polymorphism},
  booktitle = {34th European Conference on Object-Oriented Programming, {ECOOP} 2020,
               November 15-17, 2020, Berlin, Germany (Virtual Conference)},
  series = {LIPIcs},
  volume = {166},
  pages = {27:1--27:30},
  publisher = {Schloss Dagstuhl - Leibniz-Zentrum f{\"{u}}r Informatik},
  year = {2020},
  abstract = {Polymorphism and subtyping are important features in mainstream OO languages. The most common way to integrate the two is via Fsub style bounded quantification. A closely related mechanism is row polymorphism, which provides an alternative to subtyping, while still enabling many of the same applications. Yet another approach is to have type systems with intersection types and polymorphism. A recent addition to this design space are calculi with disjoint intersection types and disjoint polymorphism. With all these alternatives it is natural to wonder how they are related. This paper provides an answer to this question. We show that disjoint polymorphism can recover forms of both row polymorphism and bounded polymorphism, while retaining key desirable properties, such as type-safety and decidability. Furthermore, we identify the extra power of disjoint polymorphism which enables additional features that cannot be easily encoded in calculi with row polymorphism or bounded quantification alone. Ultimately we expect that our work is useful to inform language designers about the expressive power of those common features, and to simplify implementations and metatheory of feature-rich languages with polymorphism and subtyping.
},
}