Unexpected behaviour in Text.PrettyPrint.HughesPJ

Anders Höckersten chucky at dtek.chalmers.se
Thu Sep 22 02:42:08 EDT 2005


Hi,
I've been using the pretty printer in Text.PrettyPrint.HughesPJ lately,
and I've encountered a behaviour that was very unexpected for me. If I
define this small example:

test = text "foo" <+> empty <> text "bar"

Running 'show test' now gives the string "foobar" as a result (whereas I
expected "foo bar").It seems the empty "eats" the space that I expect
<+> to give me.

So is this how the library is supposed to work or have I encountered a
bug?

Regards,
Anders



More information about the Libraries mailing list