Names For Free - Polymorphic Views of Names and Binders
Paper i proceeding, 2013

We propose a novel technique to represent names and binders in Haskell. The dynamic (run-time) representation is based on de Bruijn indices, but it features an interface to write and manipulate variables conviently, using Haskell-level lambdas and variables. The key idea is to use rich types: a subterm with an additional free variable is viewed either as $\forall v. v \rightarrow \mathsf{Term} (a + v)$ or $\exists v. v \times \mathsf{Term} (a + v)$ depending on weather it is constructed or analysed. We demonstrate on a number of examples how this approach approach permits to express terms construction and manipulation in a natural way, while retaining the good properties of representations based on de Bruijn indices.

type-classes

polymorphism

name binding

parametricity

nested types

Författare

Jean-Philippe Bernardy

Chalmers, Data- och informationsteknik, Programvaruteknik

Nicolas Pouillard

IT-Universitetet i Kobenhavn

SIGPLAN Notices (ACM Special Interest Group on Programming Languages)

07308566 (ISSN)

Vol. 48 12 13-24
978-145032383-3 (ISBN)

Styrkeområden

Informations- och kommunikationsteknik

Fundament

Grundläggande vetenskaper

Ämneskategorier

Datavetenskap (datalogi)

DOI

10.1145/2503778.2503780

ISBN

978-145032383-3

Mer information

Skapat

2017-10-07