Programming macro tree transducers

Patrick Bahr, Laurence E. Day

Publikation: Konference artikel i Proceeding eller bog/rapport kapitelBidrag til bog/antologiForskningpeer review

Abstrakt

A tree transducer is a set of mutually recursive functions transforming an input tree into an output tree. Macro tree transducers extend this recursion scheme by allowing each function to be defined in terms of an arbitrary number of accumulation parameters. In this paper, we show how macro tree transducers can be concisely represented in Haskell, and demonstrate the benefits of utilising such an approach with a number of examples. In particular, tree transducers afford a modular programming style as they can be easily composed and manipulated. Our Haskell representation generalises the original definition of (macro) tree transducers, abolishing a restriction on finite state spaces. However, as we demonstrate, this generalisation does not affect compositionality.
OriginalsprogUdefineret/Ukendt
TitelProceedings of the 9th ACM SIGPLAN Workshop on Generic Programming
Antal sider12
UdgivelsesstedNew York, NY, USA
ForlagACM
Publikationsdato1 sep. 2013
Sider61-72
ISBN (Trykt)978-1-4503-2389-5
DOI
StatusUdgivet - 1 sep. 2013

Emneord

  • tree automaton, transducer, accumulation, composition, deforestation, Haskell, recursion scheme, nested recursion, polymorphism

Citationsformater