Pretty-printing and text formatting
The libraries in this subsection are as follows:
wl-pprint-*
packages: Pretty-printers based on Wadler/Leijen pretty-printers. Multiple implementations with different features are found in similarly named libraries.text-format
: High-performance text formatting.interpolateInterpolate
: Simple string interpolation using Template Haskell.here
: Docs for Haskell using Template Haskell.
Pretty-printing is the process of turning data into user-friendly text format. Think, for instance, of printing a long string with appropriate line breaks, or printing Haskell values in a friendly way, in other words, commas at the beginning of lines and so on.
The Wadler/Leijen pretty-printer is a simple but powerful interface that has multiple implementations: nearly a dozen packages with wl-pprint
in their name. Some add support for ANSI terminal colors, or terminfo support, annotations, one even using a free monad for documents. Unfortunately, no single implementation admits...