Lune

OOPSLA2021Top-tier venue

Relational nullable types with Boolean unification

Magnus Madsen, Jaco van de Pol

Abstract

We present a simple, practical, and expressive relational nullable type system. A relational nullable type system captures whether an expression may evaluate to null based on its type, but also based on the type of other related expressions. The type system extends the Hindley-Milner type system with Boolean constraints, supports parametric polymorphism, and preserves principal types modulo Boolean equivalence. We show how to support full Hindley-Milner style type inference with an extension of Algorithm W.

We conduct a preliminary study of open source projects showing that there is a need for relational nullable type systems across a wide range of programming languages. The most important findings from the study are: (i) programmers use programming patterns where the nullability of one expression depends on the nullability of other related expressions, (ii) such invariants are commonly enforced with run-time exceptions, and (iii) reasoning about these programming patterns requires not only knowledge of when an expression may evaluate to null, but also when it may evaluate to a non-null value. We incorporate these observations in the design of the proposed relational nullable type system.

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.

3 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

  • Qualified Types with Boolean Algebras cites Qualifying System F<: Some Terms and Conditions May Apply
  • Qualified Types with Boolean Algebras cites Polymorphic types and effects with Boolean unification
  • Qualified Types with Boolean Algebras cites Fixpoints for the masses: programming with first-class Datalog constraints
  • Qualified Types with Boolean Algebras cites Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect Systems
  • Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect Systems cites Polymorphic types and effects with Boolean unification
  • Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect Systems cites Fixpoints for the masses: programming with first-class Datalog constraints
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect SystemsMagnus Madsen, Jaco van de Pol, Troels HenriksenOOPSLA 2023 · 5 citations
  2. Qualifying System F<: Some Terms and Conditions May ApplyEdward Lee, Yaoyu Zhao, Ondrej Lhoták, James You et al.OOPSLA 2024 · 2 citations
  3. Qualified Types with Boolean AlgebrasEdward Lee, Jonathan Lindegaard Starup, Ondrej Lhoták, Magnus MadsenOOPSLA 2025 · 1 citation

Builds on2

  1. Fixpoints for the masses: programming with first-class Datalog constraintsMagnus Madsen, Ondrej LhotákOOPSLA 2020 · 22 citations
  2. Polymorphic types and effects with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2020 · 18 citations

Related papers

  1. Let Generalization, Polymorphic Recursion, and Variable Minimization in Boolean-Kinded Type SystemsJoseph A. ZulloPOPL 2026 · 1 citation
  2. Pluggable Type Inference for FreeMartin Kellogg, Daniel Daskiewicz, Loi Ngo Duc Nguyen, Muyeed Ahmed et al.ASE 2023 · 4 citations
  3. Principal Type Inference under a Prefix: A Fresh Look at Static OverloadingDaan Leijen, Wenjia YePLDI 2025 · 2 citations
  4. Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 15 citations
  5. Verifying the Option Type with Rely-Guarantee ReasoningJames Yoo, Michael D. Ernst, René JustASE 2024
Dusk over the sea between two cliffs drawn in fine vertical lines