Idris 2: Quantitative Type Theory in Practice

04/01/2021
by   Edwin Brady, et al.
1

Dependent types allow us to express precisely what a function is intended to do. Recent work on Quantitative Type Theory (QTT) extends dependent type systems with linearity, also allowing precision in expressing when a function can run. This is promising, because it suggests the ability to design and reason about resource usage protocols, such as we might find in distributed and concurrent programming, where the state of a communication channel changes throughout program execution. As yet, however, there has not been a full-scale programming language with which to experiment with these ideas. Idris 2 is a new version of the dependently typed language Idris, with a new core language based on QTT, supporting linear and dependent types. In this paper, we introduce Idris 2, and describe how QTT has influenced its design. We give examples of the benefits of QTT in practice including: expressing which data is erased at run time, at the type level; and, resource tracking in the type system leading to type-safe concurrent programming with session types.

READ FULL TEXT

page 1

page 2

page 6

page 7

page 13

page 14

page 23

page 25

research
04/02/2019

FreeST: Context-free Session Types in a Functional Language

FreeST is an experimental concurrent programming language. Based on a co...
research
06/15/2021

Introducing Type Properties

In type theory, we can express many practical ideas by attributing some ...
research
05/31/2019

A Role for Dependent Types in Haskell (Extended version)

Modern Haskell supports zero-cost coercions, a mechanism where types tha...
research
05/13/2021

On the Monitorability of Session Types, in Theory and Practice (Extended Version)

In concurrent and distributed systems, software components are expected ...
research
11/08/2020

A graded dependent type system with a usage-aware semantics (extended version)

Graded Type Theory provides a mechanism to track and reason about resour...
research
04/11/2020

What Kind of Programming Language Best Suits Integrative AGI?

What kind of programming language would be most appropriate to serve the...
research
11/24/2021

CircuitFlow: A Domain Specific Language for Dataflow Programming (with appendices)

Dataflow applications, such as machine learning algorithms, can run for ...

Please sign up or login with your details

Forgot password? Click here to reset