Linear Types for Programmers
twey.io·13w·
Discuss: Hacker News
Flag this post

Introduction §

Linear types are an application to type theory of the discipline of linear logic, first described by Jean-Yves Girard (Girard, 1987). Since its inception it has led to many fruitful discoveries in computer science. In this article I hope to explain why it is so interesting, as well as relate it to concrete tools and practices available to programmers today.

There are four main operators in linear logic:

(A ⊗ B), read A times B, represents an independent pair of values that may be used in any order, similar to the struct in a language like Rust;

(A ⊕ B), read A plus B, represents either an A or a B, and the consumer must be prepared for either possibility, similar to the enum in a…

Similar Posts

Loading similar posts...