Hi Rafael There is a paper describing a variant of Conal Elliott's Pan implemented with Template Haskell - PanTH - which you might find interesting: Optimising Embedded DSLs using Template Haskell Sean Seefried, Manuel Chakravarty, and Gabriele Keller http://www.haskell.org/th/papers/th-pan.ps Best wishes Stephen