A Role for Dependent Types in Haskell (Extended version)
Stephanie Weirich, Pritam Choudhury, Antoine Voizard, Richard A., Eisenberg

TL;DR
This paper explores integrating dependent types into Haskell's type system, ensuring safe zero-cost coercions through roles, and provides formal proofs of soundness using Coq, laying groundwork for future dependently-typed language features.
Contribution
It introduces a formal framework for combining roles with dependent types in Haskell and proves its soundness, facilitating safer type conversions in dependently-typed languages.
Findings
Formal system for roles and dependent types in Haskell
Proof of soundness using Coq
Foundation for adding dependent types to GHC
Abstract
Modern Haskell supports zero-cost coercions, a mechanism where types that share the same run-time representation may be freely converted between. To make sure such conversions are safe and desirable, this feature relies on a mechanism of roles to prohibit invalid coercions. In this work, we show how to integrate roles with dependent type systems and prove, using the Coq proof assistant, that the resulting system is sound. We have designed this work as a foundation for the addition of dependent types to the Glasgow Haskell Compiler, but we also expect that it will be of use to designers of other dependently-typed languages who might want to adopt Haskell's safe coercions feature.
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
