Set-theoretic Types for Erlang

Albert Schimpf, Stefan Wehr, and Annette Bieniusa

In Proc. of IFL 2022. Copenhagen, Denmark. ACM, 2023.

Abstract

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.

Bibtex

@INPROCEEDINGS{SchimpfWehrBieniusa2023,
  author = {Albert Schimpf and Stefan Wehr and Annette Bieniusa},
  title = {Set-theoretic Types for {Erlang}},
  booktitle = {Proc. of IFL 2022},
  year = 2023,
  address = {Copenhagen, Denmark},
  articleno = 4,
  publisher = {{ACM}},
  doi = {https://doi.org/10.1145/3587216.3587220}
}

Resources

Imprint & privacy policy // Last modified: 2023-11-27T14:23:35+01:00