Unexpected behaviour in Text.PrettyPrint.HughesPJ

Tomasz Zielonka tomasz.zielonka at gmail.com
Fri Sep 23 09:13:30 EDT 2005

On 9/23/05, Anders Höckersten <chucky at dtek.chalmers.se> wrote:
> Thank you for your answer. That does make some sense. On the other hand,
> I am not sure I think this behaviour is reasonable. I think these two
> should be equivalent:
> Text.PrettyPrint.HughesPJ> text "foo" <+> empty <> text "bar"
> foobar
> Text.PrettyPrint.HughesPJ> text "foo" <+> text "" <> text "bar"
> foo bar
> I argue that (text "" == empty) and that I should be able to use them
> synonymously. The point I think I'm trying to make is that I have used
> this pretty printing library for a while now, and I have never had to
> worry about the precedence of the operators before.

I'm not sure I agree, but if you really want that, maybe you could simply
make your
own module where
empty = text ""
text "" = empty
test x = HughesPJ.test x

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/libraries/attachments/20050923/5a7b57f1/attachment.htm

More information about the Libraries mailing list