<div>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.</div>
<div> </div>
<div>-Edward Kmett<br></div>
<div class="gmail_quote">On Tue, Jun 30, 2009 at 5:37 PM, Bryan O'Sullivan <span dir="ltr"><<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ticket: <a href="http://hackage.haskell.org/trac/ghc/ticket/3339" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/3339</a><br>
<br>From the ticket: <br>
<p>This proposal was, I think, originally suggested by Jules Bean. The idea is to add two functions to the <tt>Data.Monoid</tt> module, <tt>(+>)</tt> and <tt>(<+)</tt>, corresponding to different uses of <tt>mappend</tt>. These should not be methods of the <tt>Monoid</tt> typeclass, but top-level functions. </p>
<p>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 together. </p><pre>(+>) :: (Monoid a) => a -> a -> a<br>a +> b = a `mappend` b<br>
<br>(<+) :: (Monoid a) => a -> a -> a<br>a <+ b = b `mappend` a<br><br>infixl 4 +><br>infixl 4 <+<br></pre>
<p>Proposed deadline: two weeks. </p>
<p>If this looks reasonable, I'll attach darcs patches. </p><br>_______________________________________________<br>Libraries mailing list<br><a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br>