[Haskell-cafe] generating parens for pretty-printing code in haskell-src-exts

Stephen Tetley stephen.tetley at gmail.com
Sun Jan 15 08:43:09 CET 2012


Hi Conal

I don't know if any Haskell src-exts code exists. Norman Ramsey has
published an algorithm for it, plus ML code:

http://www.cs.tufts.edu/~nr/pubs/unparse-abstract.html

I've transcribed the code to Haskell a couple of times for small
expression languages. As far as I remember you need to know what
constructors you are working with so it can't be put in a "generic"
pretty print library, but the constructor specific code is
"stereotypical" so it should be easy (if boring) to write for Haskell
src-exts.

Best wishes

Stephen



More information about the Haskell-Cafe mailing list