Proposal #3339: Add (+>) as a synonym for mappend
ekmett at gmail.com
Wed Jul 1 10:59:57 EDT 2009
Bikeshedding: Would it be better to put the definition for +> (or better yet
<>) in the dictionary for Monoid with a circular definition for mappend?
That way new code defining Monoid instances can avoid ever having to even
mention mappend. I'm ok with it either way. I admit adding it to the
dictionary might add dictionary passing overhead and risk inconsistent
definitions of <> and mappend.
On Tue, Jun 30, 2009 at 5:37 PM, Bryan O'Sullivan <bos at serpentine.com>wrote:
> Ticket: http://hackage.haskell.org/trac/ghc/ticket/3339
> From the ticket:
> This proposal was, I think, originally suggested by Jules Bean. The idea is
> to add two functions to the Data.Monoid module, (+>) and (<+),
> corresponding to different uses of mappend. These should not be methods of
> the Monoid typeclass, but top-level functions.
> I hope (but slightly doubt) that the visual nature of the two operators
> might help to counter the thought that monoids are just for gluing things
> (+>) :: (Monoid a) => a -> a -> a
> a +> b = a `mappend` b
> (<+) :: (Monoid a) => a -> a -> a
> a <+ b = b `mappend` a
> infixl 4 +>
> infixl 4 <+
> Proposed deadline: two weeks.
> If this looks reasonable, I'll attach darcs patches.
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries