English

Type Classes for Lightweight Substructural Types

Programming Languages 2015-02-18 v1

Abstract

Linear and substructural types are powerful tools, but adding them to standard functional programming languages often means introducing extra annotations and typing machinery. We propose a lightweight substructural type system design that recasts the structural rules of weakening and contraction as type classes; we demonstrate this design in a prototype language, Clamp. Clamp supports polymorphic substructural types as well as an expressive system of mutable references. At the same time, it adds little additional overhead to a standard Damas-Hindley-Milner type system enriched with type classes. We have established type safety for the core model and implemented a type checker with type inference in Haskell.

Keywords

Cite

@article{arxiv.1502.04772,
  title  = {Type Classes for Lightweight Substructural Types},
  author = {Edward Gan and Jesse A. Tov and Greg Morrisett},
  journal= {arXiv preprint arXiv:1502.04772},
  year   = {2015}
}

Comments

In Proceedings LINEARITY 2014, arXiv:1502.04419

R2 v1 2026-06-22T08:31:05.961Z