Understanding Haskell-style Overloading via Open Data and Open Functions

📅 2025-07-21
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Haskell’s type-class overloading lacks a unified, formal semantics, hindering rigorous reasoning and implementation. Existing approaches—relying on dictionary passing or ad hoc type-equality axioms—fail to cleanly encode advanced features such as multi-parameter type classes, functional dependencies, and associated types. Method: We introduce System F$_mathrm{D}$, a core calculus that models overloading natively via *open data types* and *open functions*, eliminating the need for external type-equality axioms. Contribution/Results: System F$_mathrm{D}$ fully and faithfully encodes Haskell’s type-class system, including higher-order extensions. Its metatheory—including type safety and semantic consistency—is fully mechanized in Lean 4. Compared to prior systems, System F$_mathrm{D}$ offers greater expressiveness, conceptual simplicity, and a verified formal foundation. It establishes a new paradigm for both the formal study of type classes and their principled compiler implementation.

Technology Category

Application Category

📝 Abstract
We present a new, uniform semantics for Haskell-style overloading. We realize our approach in a new core language, System F$_mathrm{D}$, whose metatheory we mechanize in the Lean4 interactive theorem prover. System F$_mathrm{D}$ is distinguished by its open data types and open functions, each given by a collection of instances rather than by a single definition. We show that System F$_mathrm{D}$ can encode advanced features of Haskell's of type class systems, more expressively than current semantics of these features, and without assuming additional type equality axioms.
Problem

Research questions and friction points this paper is trying to address.

Develops a new semantics for Haskell-style overloading
Introduces System F$_mathrm{D}$ with open data and functions
Encodes advanced Haskell type class features more expressively
Innovation

Methods, ideas, or system contributions that make the work stand out.

Open data types for flexible instance collections
Open functions enabling dynamic overloading semantics
System F$_mathrm{D}$ core language with Lean4 mechanization
🔎 Similar Papers
No similar papers found.