[Haskell-cafe] Pretty Print, text or ++?

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri Aug 15 09:47:07 EDT 2008

"Paul Keir" <pkeir at dcs.gla.ac.uk> wrote:

> text (a ++ b ++ c ++ d)

The above is going to be ugly-printed onto a single line, whilst this:

> text a <+> text b <+> text c <+> text d

has a chance to be pretty-printed onto several lines, if each component
is individually long.

It doesn't really matter which expression is faster, if they do
different things.  The first solution fails to use the pretty-printing
API to any significant advantage, whilst the second is more in the
spirit of the thing.


More information about the Haskell-Cafe mailing list