Lune

POPL2024Top-tier venue

Polymorphic Type Inference for Dynamic Languages

Giuseppe Castagna, Mickaël Laurent, Kim Nguyen

Abstract

We present a type system that combines, in a controlled way, first-order polymorphism with intersection types, union types, and subtyping, and prove its safety. We then define a type reconstruction algorithm that is sound and terminating. This yields a system in which unannotated functions are given polymorphic types (thanks to Hindley-Milner) that can express the overloaded behavior of the functions they type (thanks to the intersection introduction rule) and that are deduced by applying advanced techniques of type narrowing (thanks to the union elimination rule). This makes the system a prime candidate to type dynamic languages.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Implementing Set-Theoretic Types cites MLstruct: principal type inference in a Boolean algebra of structural types
  • Implementing Set-Theoretic Types cites Type Inference for Functional and Imperative Dynamic Languages
  • Implementing Set-Theoretic Types cites Polymorphic Records for Dynamic Languages
  • Bidirectional Higher-Rank Polymorphism with Intersection and Union Types cites MLstruct: principal type inference in a Boolean algebra of structural types
  • Bidirectional Higher-Rank Polymorphism with Intersection and Union Types cites A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F⋈
  • Type Inference for Functional and Imperative Dynamic Languages cites MLstruct: principal type inference in a Boolean algebra of structural types
  • A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F⋈ cites On type-cases, union elimination, and occurrence typing
  • Polymorphic Records for Dynamic Languages cites MLstruct: principal type inference in a Boolean algebra of structural types
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Bidirectional Higher-Rank Polymorphism with Intersection and Union TypesShengyi Jiang, Chen Cui, Bruno C. d. S. OliveiraPOPL 2025 · 2 citations
  2. Polymorphic Records for Dynamic LanguagesGiuseppe Castagna, Loïc PeyrotOOPSLA 2025 · 2 citations
  3. Implementing Set-Theoretic TypesMickaël Laurent, Kim NguyễnOOPSLA 2026 · 1 citation
  4. Type Inference for Functional and Imperative Dynamic LanguagesMickaël Laurent, Jan VitekOOPSLA 2026 · 1 citation

Builds on3

  1. MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 31 citations
  2. On type-cases, union elimination, and occurrence typingGiuseppe Castagna, Mickaël Laurent, Kim Nguyen, Matthew LutzePOPL 2022 · 13 citations
  3. A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F⋈Nick Rioux, Xuejing Huang, Bruno C. d. S. Oliveira, Steve ZdancewicPOPL 2023 · 10 citations

Related papers

  1. Resolution as intersection subtyping via Modus PonensKoar Marntirosian, Tom Schrijvers, Bruno C. d. S. Oliveira, Georgios KarachaliasOOPSLA 2020 · 5 citations
  2. The Logic of Intersection SubtypingOlivier LaurentLICS 2026
  3. Intensional datatype refinement: with application to scalable verification of pattern-match safetyEddie Jones, Steven J. RamsayPOPL 2021 · 3 citations
  4. FreezeML: complete and easy type inference for first-class polymorphismFrank Emrich, Sam Lindley, Jan Stolarek, James Cheney et al.PLDI 2020 · 13 citations
  5. When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class PolymorphismLionel Parreaux, Aleksander Boruch-Gruszecki, Andong Fan, Chun Yin ChauPOPL 2024 · 13 citations
Dusk over the sea between two cliffs drawn in fine vertical lines