RE: Unexpected behaviour in Text.PrettyPrint.HughesPJ

Ah yes -- a better answer than mine. Simon | -----Original Message----- | From: libraries-bounces@haskell.org [mailto:libraries-bounces@haskell.org] On Behalf Of Johannes | Waldmann | Sent: 23 September 2005 09:55 | To: Simon Peyton-Jones | Cc: Haskell libraries | Subject: Re: Unexpected behaviour in Text.PrettyPrint.HughesPJ | | | > | 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. | | by definition, x <+> empty == x. | | what happens here is related to precedences: | | Text.PrettyPrint.HughesPJ> text "foo" <+> empty <> text "bar" | foobar | Text.PrettyPrint.HughesPJ> text "foo" <+> ( empty <> text "bar" ) | foo bar | | best regards, | -- | -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 -- | ---- http://www.imn.htwk-leipzig.de/~waldmann/ ------- | | _______________________________________________ | Libraries mailing list | Libraries@haskell.org | http://www.haskell.org/mailman/listinfo/libraries
participants (1)
-
Simon Peyton-Jones