Set-theoretic Types for Erlang

02/24/2023
by   Albert Schimpf, et al.
0

Erlang is a functional programming language with dynamic typing. The language offers great flexibility for destructing values through pattern matching and dynamic type tests. Erlang also comes with a type language supporting parametric polymorphism, equi-recursive types, as well as union and a limited form of intersection types. However, type signatures only serve as documentation, there is no check that a function body conforms to its signature. Set-theoretic types and semantic subtyping fit Erlang's feature set very well. They allow expressing nearly all constructs of its type language and provide means for statically checking type signatures. This article brings set-theoretic types to Erlang and demonstrates how existing Erlang code can be statically typechecked without or with only minor modifications to the code. Further, the article formalizes the main ingredients of the type system in a small core calculus, reports on an implementation of the system, and compares it with other static typecheckers for Erlang.

READ FULL TEXT
research
11/05/2021

Programming with union, intersection, and negation types

In this essay, I present the advantages and, I dare say, the beauty of p...
research
04/16/2021

A Gradual Type System for Elixir

Elixir is a functional programming language with dynamic typing. We prop...
research
07/12/2019

Revisiting Occurrence Typing

We revisit occurrence typing, a technique to refine the type of variable...
research
04/06/2019

Type-Level Computations for Ruby Libraries

Many researchers have explored ways to bring static typing to dynamic la...
research
05/17/2019

Simple and Effective Relation-Based Approaches To XPath and XSLT Type Checking (Technical Report, Bad Honnef 2015)

XPath is a language for addressing parts of an XML document. We give an ...
research
06/10/2023

The Design Principles of the Elixir Type System

Elixir is a dynamically-typed functional language running on the Erlang ...
research
03/03/2022

Implicit Polarized F: local type inference for impredicativity

System F, the polymorphic lambda calculus, features the principle of imp...

Please sign up or login with your details

Forgot password? Click here to reset