Constrained Type Families

06/29/2017
by   J. Garrett Morris, et al.
0

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 evidence, we present the first complete proof of consistency for a language with closed type families.

READ FULL TEXT
research
08/30/2017

Type Safe Redis Queries: A Case Study of Type-Level Programming in Haskell

Redis is an in-memory data structure store, often used as a database, wi...
research
12/20/2022

Pragmatic isomorphism proofs between Coq representations: application to lambda-term families

There are several ways to formally represent families of data, such as l...
research
07/20/2022

Constraint-based type inference for FreezeML

FreezeML is a new approach to first-class polymorphic type inference tha...
research
08/07/2019

Sized Types for low-level Quantum Metaprogramming

One of the most fundamental aspects of quantum circuit design is the con...
research
09/21/2023

Stratified Type Theory

To exploit the expressivity of being able to refer to the type of types,...
research
07/02/2021

Dependent Type Systems as Macros

We present Turnstile+, a high-level, macros-based metaDSL for building d...
research
02/11/2022

An inductive-recursive universe generic for small families

We show that it is possible to construct a universe in all Grothendieck ...

Please sign up or login with your details

Forgot password? Click here to reset