The following paper was presented at the ICFP 2009.
: Attribute Grammars Fly First-Class: How to do aspect oriented programming in Haskell
: Marcos Viera, S. Doaitse Swierstra, Wouter S. Swierstra
: Attribute grammar programs are factored along two axes: the function axis and the data axis. As a consequence they can be easily adapted and extended. The questions arises whether the attribute grammar approach to programming can be made available as an embedded domain specific language (EDSL) in Haskell. In this paper we show how this can be achieved by making extensive use of the type class mechanism. The paper identifies the characteristic properties of attribute grammars, shows how to emulate them, and shows how to overcome some problems associated with earlier attempts to do so. Finally we show how common patterns found in attribute gammar programming can be made explicit, leading to extensions of our EDSL.
- paper.pdf: Attribute Grammars Fly First-Class How to do aspect oriented programming in Haskell
- 23 Mar 2009