FreezeML: complete and easy type inference for first-class polymorphism
Frank Emrich, Sam Lindley, Jan Stolarek, James Cheney, Jonathan Coates
摘要
ML is remarkable in providing statically typed polymorphism without the programmer ever having to write any type annotations. The cost of this parsimony is that the programmer is limited to a form of polymorphism in which quantifiers can occur only at the outermost level of a type and type variables can be instantiated only with monomorphic types.
Type inference for unrestricted System F-style polymorphism is undecidable in general. Nevertheless, the literature abounds with a range of proposals to bridge the gap between ML and System F.
We put forth a new proposal, FreezeML, a conservative extension of ML with two new features. First, let-and lambdabinders may be annotated with arbitrary System F types. Second, variable occurrences may be frozen, explicitly disabling instantiation. FreezeML is equipped with type-preserving translations back and forth between System F and admits a type inference algorithm, an extension of algorithm W, that is sound and complete and which yields principal types.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Bidirectional Higher-Rank Polymorphism with Intersection and Union Types 引用了 When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class Polymorphism
- Local Contextual Type Inference 引用了 Bidirectional Higher-Rank Polymorphism with Intersection and Union Types
- Local Contextual Type Inference 引用了 When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class Polymorphism
- Practical Type Inference with Levels 引用了 When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class Polymorphism
引用它的顶会 Paper5
- When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class PolymorphismLionel Parreaux, Aleksander Boruch-Gruszecki, Andong Fan, Chun Yin ChauPOPL 2024 · 13 次引用
- Structural Subtyping as Parametric PolymorphismWenhao Tang, Daniel Hillerström, James McKinna, Michel Steuwer 等OOPSLA 2023 · 3 次引用
- Practical Type Inference with LevelsAndong Fan, Han Xu, Ningning XiePLDI 2025 · 3 次引用
- Bidirectional Higher-Rank Polymorphism with Intersection and Union TypesShengyi Jiang, Chen Cui, Bruno C. d. S. OliveiraPOPL 2025 · 2 次引用
- Local Contextual Type InferenceXu Xue, Chen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraPOPL 2026
相关 Paper
- Principal Type Inference under a Prefix: A Fresh Look at Static OverloadingDaan Leijen, Wenjia YePLDI 2025 · 2 次引用
- Polymorphic types and effects with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2020 · 18 次引用
- The Undecidability of System F Typability and Type Checking for ReductionistsAndrej DudenhefnerLICS 2021 · 1 次引用
- Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 9 次引用
- Polymorphic Type Inference for Dynamic LanguagesGiuseppe Castagna, Mickaël Laurent, Kim NguyenPOPL 2024 · 12 次引用
