HackerPapers

arXiv:2103.06127cs.PL

Linearly Qualified Types: Generic inference for capabilities and uniqueness

Arnaud Spiwack, Csongor Kiss, Jean-Philippe Bernardy, Nicolas Wu, Richard Eisenberg

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

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.

arXiv comments
Journal reference
DOI
doi:10.1145/3547626
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Apr 2021 to Apr 2021.

Comments linking this paper, per year.

Discussed in comments1 thread

  1. Test for lists in Cython 1 comment
    • > As a more general comment, using a GC language as the FFI target from a GC language is begging for difficult-if-not-impossible-to-debug crashes down the line. Safe interop between two GC'd languages (Haskell and Java) was one motivation of Haskell's new -XLinearTypes extension…

      whateveracctView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.