Structural Subtyping as Parametric Polymorphism
Wenhao Tang, Daniel Hillerström, James McKinna, Michel Steuwer, Ornela Dardha, Rongxiao Fu, Sam Lindley
摘要
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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper1
问问它们各自怎么用它它引用的顶会 Paper3
- MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 被引用 31 次
- FreezeML: complete and easy type inference for first-class polymorphismFrank Emrich, Sam Lindley, Jan Stolarek, James Cheney 等PLDI 2020 · 被引用 13 次
- Making a Type Difference: Subtraction on Intersection Types as Generalized Record OperationsHan Xu, Xuejing Huang, Bruno C. d. S. OliveiraPOPL 2023 · 被引用 7 次
相关 Paper
- Parametric Subtyping for Structural Parametric PolymorphismHenry DeYoung, Andreia Mordido, Frank Pfenning, Ankush DasPOPL 2024 · 被引用 3 次
- Revisiting Row Polymorphism for Set-Theoretic TypesMickaël Laurent, Pierre Donat-Bouillud, Filip Křikava, Jan VitekOOPSLA 2026
- The Simple Essence of MonomorphizationMatthew Lutze, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025 · 被引用 2 次
- Extensible Data Types with Ad-Hoc PolymorphismMatthew Toohey, Yanning Chen, Ara Jamalzadeh, Ningning XiePOPL 2026 · 被引用 1 次
- Space-Efficient Polymorphic Gradual Typing, Mostly ParametricAtsushi Igarashi, Shota Ozaki, Taro Sekiyama, Yudai TanabePLDI 2024 · 被引用 2 次
