Unexpected behaviour in Text.PrettyPrint.HughesPJ

Simon Peyton-Jones simonpj at microsoft.com
Fri Sep 23 04:50:52 EDT 2005

That does seem like a bug to me. 

I would love it if someone else could dig into the library and fix it.... it's years since I looked at it.  Probably there are many things that could be improved.  I have no ego investment in it, so it's 100% open to improvement.  


| -----Original Message-----
| From: libraries-bounces at haskell.org [mailto:libraries-bounces at haskell.org] On Behalf Of Anders
| Höckersten
| Sent: 22 September 2005 07:42
| To: Haskell libraries
| Subject: Unexpected behaviour in Text.PrettyPrint.HughesPJ
| 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
| _______________________________________________
| Libraries mailing list
| Libraries at haskell.org
| http://www.haskell.org/mailman/listinfo/libraries

More information about the Libraries mailing list