Linear Constraints
File(s)2103.06127v1.pdf (413.35 KB)
Working paper
Author(s)
Bernardy, Jean-Philippe
Eisenberg, Richard
Kiss, Csongor
Spiwack, Arnaud
Wu, Nicolas
Type
Working Paper
Abstract
A linear argument must be consumed exactly once in the body of its function.
A linear type system can verify the correct usage of resources such as file
handles and manually managed memory. But this verification 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 to be filled in
automatically by the compiler. Linear constraints are presented as a qualified
type system, together with an inference algorithm which extends OutsideIn,
GHC's existing constraint solver algorithm. Soundness of linear constraints is
ensured by the fact that they desugar into Linear Haskell.
A linear type system can verify the correct usage of resources such as file
handles and manually managed memory. But this verification 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 to be filled in
automatically by the compiler. Linear constraints are presented as a qualified
type system, together with an inference algorithm which extends OutsideIn,
GHC's existing constraint solver algorithm. Soundness of linear constraints is
ensured by the fact that they desugar into Linear Haskell.
Copyright Statement
© 2021 The Author(s)
Identifier
http://arxiv.org/abs/2103.06127v1
Subjects
cs.PL
cs.PL