At least the example application in the paper, a pretty printer, is pretty neatly solved with Haskell's show class and PrettyPrinter combinators.
http://research.microsoft.com/en-us/um/people/simonpj/papers...