Linear Constraints

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Spiwack, Arnaud, Kiss, Csongor, Bernardy, Jean-Philippe, Wu, Nicolas, Eisenberg, Richard A.
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918464283738112
author Spiwack, Arnaud
Kiss, Csongor
Bernardy, Jean-Philippe
Wu, Nicolas
Eisenberg, Richard A.
author_facet Spiwack, Arnaud
Kiss, Csongor
Bernardy, Jean-Philippe
Wu, Nicolas
Eisenberg, Richard A.
contents Linear constraints are the linear counterpart of Haskell's class constraints. Linearly typed parameters allow the programmer to control resources such as file handles and manually managed memory as linear arguments. Indeed, a linear type system can verify that these resources are used safely. However, writing code with explicit linear arguments requires bureaucracy. Linear constraints address this shortcoming: a linear constraint acts as an implicit linear argument that can be filled in automatically by the compiler. We present this new feature as a qualified type system, together with an inference algorithm which extends GHC's existing constraint solver algorithm. Soundness of linear constraints is ensured by the fact that they desugar into Linear Haskell. This paper is a revised and extended version of a previous paper by the same authors (arXiv:2103.06127). The formal system and the constraint solver have been significantly simplified and numerous additional applications are described.
format Preprint
id arxiv_https___arxiv_org_abs_2604_21467
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Linear Constraints
Spiwack, Arnaud
Kiss, Csongor
Bernardy, Jean-Philippe
Wu, Nicolas
Eisenberg, Richard A.
Programming Languages
Linear constraints are the linear counterpart of Haskell's class constraints. Linearly typed parameters allow the programmer to control resources such as file handles and manually managed memory as linear arguments. Indeed, a linear type system can verify that these resources are used safely. However, writing code with explicit linear arguments requires bureaucracy. Linear constraints address this shortcoming: a linear constraint acts as an implicit linear argument that can be filled in automatically by the compiler. We present this new feature as a qualified type system, together with an inference algorithm which extends GHC's existing constraint solver algorithm. Soundness of linear constraints is ensured by the fact that they desugar into Linear Haskell. This paper is a revised and extended version of a previous paper by the same authors (arXiv:2103.06127). The formal system and the constraint solver have been significantly simplified and numerous additional applications are described.
title Linear Constraints
topic Programming Languages
url https://arxiv.org/abs/2604.21467