Names For Free: Polymorphic Views of Names and Binders
- Nicolas Pouillard,
- Jean-Philippe Bernardy
- ,
- University of Gothenburg,
- Chalmers University of Technology
Publikation:
Konference artikel i Proceeding eller bog/rapport kapitel
Konferencebidrag i proceedings
Peer-reviewOpen Access
Resume
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 whether it
is constructed or analysed. We demonstrate on a number of examples how
this approach permits to express term construction and manipulation in
a natural way, while retaining the good properties of representations
based on de Bruijn indices.
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 whether it
is constructed or analysed. We demonstrate on a number of examples how
this approach permits to express term construction and manipulation in
a natural way, while retaining the good properties of representations
based on de Bruijn indices.
Publikation information
Produktionstype
Publikation:
Konference artikel i Proceeding eller bog/rapport kapitel
Konferencebidrag i proceedings
Peer-reviewOriginalsprog
EngelskSider fra-til (Antal sider)
Sider 13-24 (12 sider)Publikationsmilepæle
- Udgivet - 23/09/2013
Publikationsstatus
Udgivet - 23/09/2013
Forlag
Association for Computing Machinery, USAISBN (Trykt)
978-1-4503-2383-3 Publication IDs
- Scopus: 84885611454
Titel på værtspublikation
Haskell '13 Proceedings of the 2013 ACM SIGPLAN symposium on Haskell Metrikker
PlumX, åbner i en ny fane
Antal citationer
3
Hentninger
6
