[Haskell-cafe] ANNOUNCE: wl-pprint-text

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sun May 22 15:01:40 CEST 2011

And lo, the people of Haskell hath declared that the text [1] library
was to be the One True Way of dealing with textual data (unless, of
course, you're annoyed about it using UTF-16 instead of UTF-8).  And
yet there was much sadness in the land, for there was no
pretty-printing library available to produce said Text values, meaning
that it was difficult for supplicants to produce the formatting their
form of praise required.

A voice then spake: make ye a new pretty-printing library aimed
specifically for Text values.  But thou shall not use the API from
pretty [2], as it is rather limited.  Instead, the design of wl-pprint
[3] looks Real Good!  It has more combinators available, can neatly
deal with wrapping lists, and also has support for producing output
for both humans and the machines that serve us so well!

Thus were mighty energies aimed at producing such a library.  Many
were the hour at which toil was spent on this task, but at long last
the task was completed.  Yet great evil (i.e. programmer laziness)
befell the great task, and it lay hidden for many a moon.  However,
with much effort the project was recovered, and is now available for
all! [4]

Some changes were regrettably required to achieve this task.  The most
important of which was that it was discovered that wl-pprint may not
be as perfect as all that, in that documents of no content were
treated poorly.  However, spects of the pretty package were able to
redeem themselves by supplying the necessary functionality.  However,
the great task was able to extend upon that which was there before, by
invoking the almighty powers of the Monad.

TL;DR: wl-pprint-text is a pretty-printing package for lazy Text
values based upon the API of wl-pprint.  It however deals with the nil
document better than wl-pprint does, and also has a version where all
the comibnators are lifted into a Monad, primarily so that it can be
used within a State Monad.

[1]: http://hackage.haskell.org/package/text
[2]: http://hackage.haskell.org/package/pretty
[3]: http://hackage.haskell.org/package/wl-pprint
[4]: http://hackage.haskell.org/package/wl-pprint-text

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list