Open Access. Powered by Scholars. Published by Universities.®
Programming Languages and Compilers Commons™
Open Access. Powered by Scholars. Published by Universities.®
Articles 1 - 2 of 2
Full-Text Articles in Programming Languages and Compilers
Constrained Type Families, J. Garrett Morris, Richard A. Eisenberg
Constrained Type Families, J. Garrett Morris, Richard A. Eisenberg
Computer Science Faculty Research and Scholarship
We present an approach to support partiality in type-level computation without compromising expressiveness or type safety. Existing frameworks for type-level computation either require totality or implicitly assume it. For example, type families in Haskell provide a powerful, modular means of defining type-level computation. However, their current design implicitly assumes that type families are total, introducing nonsensical types and significantly complicating the metatheory of type families and their extensions. We propose an alternative design, using qualified types to pair type-level computations with predicates that capture their domains. Our approach naturally captures the intuitive partiality of type families, simplifying their metatheory. As …
A Specification For Dependent Types In Haskell, Stephanie Weirich, Antoine Voizard, Pedro Henrique Azevedo De Amorim, Richard A. Eisenberg
A Specification For Dependent Types In Haskell, Stephanie Weirich, Antoine Voizard, Pedro Henrique Azevedo De Amorim, Richard A. Eisenberg
Computer Science Faculty Research and Scholarship
We propose a core semantics for Dependent Haskell, an extension of Haskell with full-spectrum dependent types. Our semantics consists of two related languages. The first is a Curry-style dependently-typed language with nontermination, irrelevant arguments, and equality abstraction. The second, inspired by the Glasgow Haskell Compiler’s core language FC, is its explicitly-typed analogue, suitable for implementation in GHC. All of our results -- chiefly, type safety, along with theorems that relate these two languages -- have been formalized using the Coq proof assistant. Because our work is backwards compatible with Haskell, our type safety proof holds in the presence of nonterminating …