[Haskell-cafe] Building pattern and trying monads

Stephen Tetley stephen.tetley at gmail.com
Sun May 27 17:27:29 CEST 2012


It's common to use a writer monad possibly stacked with other monads
(e.g. a state monad for fresh variable names) for code generation that
approximates "macro expansion" - i.e. one call in Haskell maps to
one-or-more lines of code in the output language, no global
transformations are permitted.

If you want transformations, then it is likely you will need to model
the syntax of the output language or an intermediate language to have
something concrete to transform.



More information about the Haskell-Cafe mailing list