Structural Subtyping as Parametric Polymorphism
Structural Subtyping as Parametric Polymorphism
复制标题
作为参数多态性的结构子类型
DOI:
10.1145/3622836
复制
发表时间:
2023
影响因子:
--
通讯作者:
Tang W
中科院分区:
文献类型:
--
作者:
Tang W
Structural subtyping and parametric polymorphism provide similar flexibility and reusability to programmers. For example, both features enable the programmer to provide a wider record as an argument to a function that expects a narrower one. However, the means by which they do so differs substantially, and the precise details of the relationship between them exists, at best, as folklore in literature.In this paper, we systematically study the relative expressive power of structural subtyping and parametric polymorphism. We focus our investigation on establishing the extent to which parametric polymorphism, in the form of row and presence polymorphism, can encode structural subtyping for variant and record types. We base our study on various Church-style λ-calculi extended with records and variants, different forms of structural subtyping, and row and presence polymorphism.We characterise expressiveness by exhibiting compositional translations between calculi. For each translation we prove a type preservation and operational correspondence result. We also prove a number of non-existence results. By imposing restrictions on both source and target types, we reveal further subtleties in the expressiveness landscape, the restrictions enabling otherwise impossible translations to be defined. More specifically, we prove that full subtyping cannot be encoded via polymorphism, but we show that several restricted forms of subtyping can be encoded via particular forms of polymorphism.
登录
查看更多内容
影响因子:
1
作者:
V. Tannen;T. Coquand;Carl A. Gunter;A. Scedrov
通讯作者:
A. Scedrov
DOI:
--
发表时间:
1990
期刊:
影响因子:
--
作者:
R. Harper;B. Pierce
通讯作者:
B. Pierce
DOI:
--
发表时间:
1987
期刊:
Logic in Computer Science
影响因子:
--
作者:
M. Wand
通讯作者:
M. Wand
影响因子:
2
作者:
B. Liskov
通讯作者:
B. Liskov
DOI:
--
发表时间:
2005
期刊:
Symposium on Trends in Functional Programming
影响因子:
--
作者:
Daan Leijen
通讯作者:
Daan Leijen