[Haskell-cafe] Precedence and associativity in a pretty-printer

Allan Clark a.d.clark at ed.ac.uk
Tue Jan 22 18:06:53 EST 2008

Edsko de Vries wrote:
> Hi,
> Is there a nice way to pretty-print such an expression with the minimal
> number of brackets? I can come up with something, but I'm sure somebody
> thought hard about this problem before and came up with a really nice
> solution :)
> Any hints or pointers would be appreciated,
> Thanks,
You might find Norman Ramsey's paper on unparsing helpful:

or google for
Norman Ramsey Unparsing


More information about the Haskell-Cafe mailing list