[ANN] show-combinators: a minimal pretty-printing library for Show instances

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ANN] show-combinators: a minimal pretty-printing library for Show instances

Li-yao Xia-2
Hello,

Sometimes it is necessary to handwrite instances for Show, Show1, Show2,
or some other simple pretty-printer for ADT-like structures (because
they might not be easily derived via existing means).

base has a few combinators in Prelude, Text.Show, and
Data.Functor.Classes. But they require explicit handling of spacing and
precedence levels, which is generally error-prone and repetitive, since
ADTs all look the same.

This new library, show-combinators, contains just a dozen of functions
to encapsulate all of those details, so the code left to write can more
closely match the structure of the type to show.

http://hackage.haskell.org/package/show-combinators

I hope you will also find it useful.

Cheers,
Li-yao
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.