A Simple Semantics for Haskell Overloading
J. Garrett Morris

TL;DR
This paper introduces a new semantics for Haskell overloading that captures non-parametric behaviors introduced by advanced type class features, aligning formal understanding with practical language behavior.
Contribution
It proposes a semantics interpreting polymorphic expressions through their ground instances, accommodating non-parametric features like overlapping instances and functional dependencies.
Findings
The semantics accurately models non-parametric behaviors.
It aligns formal semantics with practical Haskell language features.
Provides a foundation for reasoning about complex type class extensions.
Abstract
As originally proposed, type classes provide overloading and ad-hoc definition, but can still be understood (and implemented) in terms of strictly parametric calculi. This is not true of subsequent extensions of type classes. Functional dependencies and equality constraints allow the satisfiability of predicates to refine typing; this means that the interpretations of equivalent qualified types may not be interconvertible. Overlapping instances and instance chains allow predicates to be satisfied without determining the implementations of their associated class methods, introducing truly non-parametric behavior. We propose a new approach to the semantics of type classes, interpreting polymorphic expressions by the behavior of each of their ground instances, but without requiring that those behaviors be parametrically determined. We argue that this approach both matches the intuitive…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
