[Haskell-cafe] Request for a Simple Pretty Printing library

Neil Mitchell ndmitchell at gmail.com
Wed Dec 13 15:58:25 EST 2006


I've been using the HughesPJ pretty printing library, but I need a new

wrap :: String -> Doc -> String -> Doc
wrap prepend doc append = ...

The semantics of this would be that the text is prepended and appended
to the doc when rendered, but does not alter the pretty printing at
all. The idea of this is to support printing with HTML rendering:

wrap "<span class='keyword'>" (text "case") "</span>"

The HughesPJ library is 1000 lines long, so will be quite a lot of
work to change this to get it working properly. Is there a simpler
pretty printing library, with source code available somewhere? Ideally
using the same interface.

Of course, if anyone knows how to make this combinator using the
existing library, or using another existing library, I'd appreciate



More information about the Haskell-Cafe mailing list