Lune

OOPSLA2025Top-tier venue

Liberating Merges via Apartness and Guarded Subtyping

Han Xu, Xuejing Huang, Bruno C. d. S. Oliveira

Abstract

The merge operator is a powerful construct in programming languages, enabling flexible composition of various components such as functions, records, or classes. Unfortunately, its application often leads to ambiguity and non-determinism, especially when dealing with overlapping types. To prevent ambiguity, approaches such as disjoint intersection types have been proposed. However, disjointness imposes strict constraints to ensure determinism, at the cost of limiting expressiveness, particularly for function overloading. This paper introduces a novel concept called type apartness, which relaxes the strict disjointness constraints, while maintaining type safety and determinism. Type apartness allows some overlap for overloaded functions as long as the calling contexts of those functions can be used to disambiguate upcasts in function calls. By incorporating the notion of guarded subtyping to prevent ambiguity when upcasting, our approach is the first to support function overloading, return type overloading, extensible records, and nested composition in a single calculus while preserving determinism. We formalize our calculi and proofs using Coq and prove their type soundness and determinism. Additionally, we demonstrate how type normalization and type difference provide more convenience and help resolve conflicts, enhancing the flexibility and expressiveness of the merge operator.

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.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Making a Type Difference: Subtraction on Intersection Types as Generalized Record Operations cites Resolution as intersection subtyping via Modus Ponens
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on4

  1. 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
  2. Making a Type Difference: Subtraction on Intersection Types as Generalized Record OperationsHan Xu, Xuejing Huang, Bruno C. d. S. OliveiraPOPL 2023 · 7 citations
  3. Resolution as intersection subtyping via Modus PonensKoar Marntirosian, Tom Schrijvers, Bruno C. d. S. Oliveira, Georgios KarachaliasOOPSLA 2020 · 5 citations
  4. Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional TypingWenjia Ye, Yaozhu Sun, Bruno C. d. S. OliveiraOOPSLA 2024 · 1 citation

Related papers

  1. Merging Gradual TypingWenjia Ye, Bruno C. d. S. Oliveira, Matías ToroOOPSLA 2024 · 2 citations
  2. Polymorphic Type Inference for Dynamic LanguagesGiuseppe Castagna, Mickaël Laurent, Kim NguyenPOPL 2024 · 12 citations
  3. Polymorphic Records for Dynamic LanguagesGiuseppe Castagna, Loïc PeyrotOOPSLA 2025 · 2 citations
  4. AdapTT: Functoriality for Dependent Type CastsArthur Adjedj, Meven Lennon-Bertrand, Thibaut Benjamin, Kenji MaillardPOPL 2026 · 1 citation
  5. MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 31 citations
Dusk over the sea between two cliffs drawn in fine vertical lines