vix.ing · top · new · best · stats · spec

First-Class Subtypes

2019/05/16 by Jeremy Yallop, Stephen Dolan
Computer Science · #cs.PL

paper · pdf · doi:10.4204/eptcs.294.4

published as EPTCS 294, 2019, pp. 74-85 · In Proceedings ML 2017, arXiv:1905.05909

arxiv created 2019/05/16 · arxiv updated 2019/05/17

Abstract

First class type equalities, in the form of generalized algebraic data types (GADTs), are commonly found in functional programs. However, first-class representations of other relations between types, such as subtyping, are not yet directly supported in most functional programming languages. We present several encodings of first-class subtypes using existing features of the OCaml language (made more convenient by the proposed modular implicits extension), show that any such encodings are interconvertible, and illustrate the utility of the encodings with several examples.

Citations