Proposal #3339: Add (+>) as a synonym for mappend
duncan.coutts at googlemail.com
Sun Nov 6 22:45:27 CET 2011
On Sun, 2011-11-06 at 17:39 +0000, Duncan Coutts wrote:
> Ian suggests making <> bind tighter than <+>.
> Initially it seems to me slightly odd for <+> to have a different
> precedence to <>, but I can't see any practical problems. So
> specifically that'd be:
> infixr 6 <> -- from Data.Monoid
> infixr 7 <+> -- in Text.Pretty
> Can anyone see any problems with this?
Sigh, getting my precedence direction confused. I mean:
infixr 6 <> -- from Data.Monoid
infixr 5 <+> -- in Text.Pretty
The point is <> binds tighter than <+>, so that:
a <> empty <+> b = (a <> empty) <+> b
a <+> empty <> b = a <+> (empty <> b)
> Note that I'm not proposing to change Text.Pretty right now. That can be
> done by the maintainer later. Right now I'm just making the change in
> Data.Monoid in base. But I wanted to check if anything did go wrong with
> Text.Pretty before changing Data.Monoid.
And I take Ian's point that we should adjust the 'pretty' package before
we release ghc-7.4.
More information about the Libraries