Abstract
In previous work we have illustrated the benefits that compositional data types (CDTs) offer for implementing languages and in general for dealing with abstract syntax trees (ASTs). Based on Swierstra's data types à la carte, CDTs are implemented as a Haskell library that enables the definition of recursive data types and functions on them in a modular and extendable fashion. Although CDTs provide a powerful tool for analysing and manipulating ASTs, they lack a convenient representation of variable binders. In this paper we remedy this deficiency by combining the framework of CDTs with Chlipala's parametric higher-order abstract syntax (PHOAS). We show how a generalisation from functors to difunctors enables us to capture PHOAS while still maintaining the features of the original implementation of CDTs, in particular its modularity. Unlike previous approaches, we avoid so-called exotic terms without resorting to abstract types: this is crucial when we want to perform transformations on CDTs that inspect the recursively computed CDTs, e.g. constant folding.
Originalsprog | Engelsk |
---|---|
Titel | Proceedings Fourth Workshop on Mathematically Structured Functional Programming |
Redaktører | James Chapman, Paul Blain Levy |
Antal sider | 22 |
Forlag | Open Publishing Association |
Publikationsdato | 11 feb. 2012 |
Sider | 3-24 |
DOI | |
Status | Udgivet - 11 feb. 2012 |
Begivenhed | 4th Workshop on Mathematically Structured Functional Programming - Tallinn, Estland Varighed: 25 mar. 2012 → 25 mar. 2012 Konferencens nummer: 4 |
Konference
Konference | 4th Workshop on Mathematically Structured Functional Programming |
---|---|
Nummer | 4 |
Land/Område | Estland |
By | Tallinn |
Periode | 25/03/2012 → 25/03/2012 |
Navn | Electronic Proceedings in Theoretical Computer Science |
---|---|
Vol/bind | 76 |
ISSN | 2075-2180 |