一级亚型
First-Class Subtypes
摘要:
第一类类型等式,以广义代数数据类型(GADT)的形式,在函数程序中很常见。然而,类型之间的其他关系的第一级表示,如子类型,在大多数函数式程序设计语言中还没有直接支持。我们提出了几个编码的第一类子类型使用现有的功能的OCaml语言(更方便的建议模块化implementation扩展),显示任何这样的编码是相互转换的,并说明了实用程序的编码与几个例子。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。