Attribute Grammars Fly First-Class: How to do aspect oriented programming in Haskell

Marcos Viera, S. Doaitse Swierstra and Wouter S. Swierstra

The 14th ACM SIGPLAN International Conference on Functional Programming (ICFP 2009)
Edinburgh, Scotland, 31st August - 2nd September 2009


Abstract

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.


START Conference Manager (V2.56.8 - Rev. 748M)