Hi,
I've been using the HughesPJ pretty printing library, but I need a new
combinator:
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
On Wed, Dec 13, 2006 at 08:58:25PM +, Neil Mitchell wrote:
I've been using the HughesPJ pretty printing library, but I need a new
combinator:
wrap :: String - Doc - String - Doc
wrap prepend doc append = ...
The semantics of this would be that the text is prepended and appended
to
The Prettyprint library you can download from:
http://www.cs.uu.nl/wiki/HUT/Download
and is described on:
http://www.cs.uu.nl/wiki/HUT/PrettyPrintingCombinators
contains amongst others the following code:
data Doc= Empty
| Char Char -- invariant: char is
Hi
Something like:
wrap prepend doc append =
zeroText prepend doc zeroText append
zeroText s = textBeside_ (Str s) 0 Empty
Thanks, that works great!
Is there likely to be any support for adding this to the standard
library? I'd rather not have to fork a version of HughesPJ to get this
doaitse:
The Prettyprint library you can download from:
http://www.cs.uu.nl/wiki/HUT/Download
I've added uulib to the libraries page:
http://haskell.org/haskellwiki/Libraries_and_tools/Compiler_tools#Pretty_printing
But this makes me wonder: how many other top secret utrecht