Coherent Explicit Dictionary Application for Haskell: Formalisation and Coherence Proof
Thomas Winant, Dominique Devriese

TL;DR
This paper introduces a formalized approach for explicit dictionary application in Haskell, ensuring coherence and global uniqueness, and includes a prototype implementation in GHC.
Contribution
It presents a novel design that allows explicit dictionary application in Haskell without sacrificing coherence or global uniqueness, supported by formal proofs and a prototype.
Findings
Formalization and proof of coherence for the new design
Implementation of a prototype in GHC
Enabling local dictionaries in Haskell
Abstract
Type classes are one of Haskell's most popular features and extend its type system with ad-hoc polymorphism. Since their conception, there were useful features that could not be offered because of the desire to offer two correctness properties: coherence and global uniqueness of instances. Coherence essentially guarantees that program semantics are independent from type-checker internals. Global uniqueness of instances is relied upon by libraries for enforcing, for example, that a single order relation is used for all manipulations of an ordered binary tree. The features that could not be offered include explicit dictionary application and local instances, which would be highly useful in practice. We propose a new design for offering explicit dictionary application, without compromising coherence and global uniqueness. We introduce a novel criterion based on GHC's type argument roles…
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.
Taxonomy
TopicsLogic, programming, and type systems · Security and Verification in Computing · Formal Methods in Verification
