I don&#39;t think the original question really is about commutativity, but rather the choice of Monoid instance.<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Not being especially mathematically inclined, every once and a while I<br>
get a little panicked when I notice that, e.g. Data.Map mappend is a<br>
plain left-biased union, and doesn&#39;t actually mappend the values of<br>
the map.<br></blockquote><div><br></div><div>As noted in the reply</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">&gt; So there&#39;s a range of possible Monoid instances for each type,<br>

<br>
More for some types than for others. For Maybe there are three:<br>
<br>
 * always take the first/left value;<br>
 * always take the last/right value;<br>
 * or, use a semigroup operation defined on the values.<br>
<br>
The first two options are provided by the First and Last newtypes, and the<br>
third option is provided by the instance for Maybe itself (except that it<br>
spuriously requires a Monoid instance instead of just a semigroup).<br><br></blockquote><div><br></div><div>But why does the Map instance of Monoid _not_ mimic the one chosen for Maybe. I claim this causes unnecessary surprises for users (and lifting the Monoid instance seems more useful, but that is harder to substantiate).</div>
<div><br></div><div>Jens</div><div> </div></div>