First-Class Subtypes

Autor: Jeremy Yallop, Stephen Dolan
Jazyk: angličtina
Rok vydání: 2019
Předmět:
Zdroj: Electronic Proceedings in Theoretical Computer Science, Vol 294, Iss Proc. ML 2017, Pp 74-85 (2019)
Druh dokumentu: article
ISSN: 2075-2180
DOI: 10.4204/EPTCS.294.4
Popis: 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.
Databáze: Directory of Open Access Journals