Unexpected behaviour in Text.PrettyPrint.HughesPJ
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"
> 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
own module where
empty = text ""
text "" = empty
test x = HughesPJ.test x
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries