35
views
0
recommends
+1 Recommend
0 collections
    0
    shares
      • Record: found
      • Abstract: found
      • Article: found
      Is Open Access

      Linear Haskell: practical linearity in a higher-order polymorphic language

      Preprint

      Read this article at

      Bookmark
          There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience.

          Abstract

          Linear type systems have a long and storied history, but not a clear path forward to integrate with existing languages such as OCaml or Haskell. In this paper, we study a linear type system designed with two crucial properties in mind: backwards-compatibility and code reuse across linear and non-linear users of a library. Only then can the benefits of linear types permeate conventional functional programming. Rather than bifurcate types into linear and non-linear counterparts, we instead attach linearity to function arrows. Linear functions can receive inputs from linearly-bound values, but can also operate over unrestricted, regular values. To demonstrate the efficacy of our linear type system - both how easy it can be integrated in an existing language implementation and how streamlined it makes it to write programs with linear types - we implemented our type system in GHC, the leading Haskell compiler, and demonstrate two kinds of applications of linear types: mutable data with pure interfaces; and enforcing protocols in I/O-performing functions.

          Related collections

          Most cited references22

          • Record: found
          • Abstract: not found
          • Article: not found

          Linear logic

            Bookmark
            • Record: found
            • Abstract: not found
            • Article: not found

            Logic Programming with Focusing Proofs in Linear Logic

              Bookmark
              • Record: found
              • Abstract: not found
              • Article: not found

              Idris, a general-purpose dependently typed programming language: Design and implementation

                Bookmark

                Author and article information

                Journal
                26 October 2017
                Article
                1710.09756
                9d13a05a-b09a-4d04-b7ee-d8326d6727dd

                http://creativecommons.org/licenses/by/4.0/

                History
                Custom metadata
                cs.PL

                Comments

                Comment on this article