Coming to Terms with Your Choices: An Existential Take on Dependent Types

11/15/2020
by   Georg Stefan Schmid, et al.
0

Type-level programming is an increasingly popular way to obtain additional type safety. Unfortunately, it remains a second-class citizen in the majority of industrially-used programming languages. We propose a new dependently-typed system with subtyping and singleton types whose goal is to enable type-level programming in an accessible style. At the heart of our system lies a non-deterministic choice operator. We argue that embracing non-determinism is crucial for bringing dependent types to a broader audience of programmers, since real-world programs will inevitably interact with imprecisely-typed, or even impure code. Furthermore, we show that singleton types combined with the choice operator can serve as a replacement for many type functions of interest in practice. We establish the soundness of our approach using the Coq proof assistant. Our soundness approach models non-determinism using additional function arguments to represent choices. We represent type-level computation using singleton types and existential types that quantify over choice arguments. To demonstrate the practicality of our type system, we present an implementation as a modification of the Scala compiler. We provide a case study in which we develop a strongly-typed wrapper for Spark datasets.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/05/2022

Implementing Dependent Types in pi-forall

These lecture notes describe the design of a minimal dependently-typed l...
research
04/17/2019

On Resolving Non-determinism in Choreographies

Choreographies specify multiparty interactions via message passing. A re...
research
03/29/2021

A simpler encoding of indexed types

In functional programming languages, generalized algebraic data types (G...
research
09/26/2020

Applying Type Oriented Programming to the PGAS Memory Model

The Partitioned Global Address Space memory model has been popularised b...
research
03/03/2019

Oxide: The Essence of Rust

Rust is a major advancement in industrial programming languages due in l...
research
01/05/2023

The Usability of Advanced Type Systems: Rust as a Case Study

Advanced type systems that enforce various correctness and safety guaran...
research
02/24/2022

Strict universes for Grothendieck topoi

Hofmann and Streicher famously showed how to lift Grothendieck universes...

Please sign up or login with your details

Forgot password? Click here to reset