Linearly Qualified Types: Generic inference for capabilities and uniqueness
Arnaud Spiwack, Csongor Kiss, Jean-Philippe Bernardy, Nicolas Wu,, Richard Eisenberg

TL;DR
This paper introduces linear constraints as an implicit, compiler-inferred feature for linear types, reducing boilerplate and enhancing safety in resource management within Haskell programs.
Contribution
It presents linear constraints as a novel front-end feature for linear typing, along with an inference algorithm integrated into GHC's constraint solver.
Findings
Linear constraints simplify linear type programming.
The approach is sound via desugaring into Linear Haskell.
Implementation extends GHC's existing constraint solver.
Abstract
A linear parameter must be consumed exactly once in the body of its function. When declaring resources such as file handles and manually managed memory as linear arguments, a linear type system can verify that these resources are used safely. However, writing code with explicit linear arguments requires bureaucracy. This paper presents linear constraints, a front-end feature for linear typing that decreases the bureaucracy of working with linear types. Linear constraints are implicit linear arguments that are filled in automatically by the compiler. We present linear constraints 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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
