Because there are many monads for which you do not want this construction!<div><br></div><div>It isn't what you mean when you use mappend on [a] for sure! It is also different from the behavior for Monad, and it rules out those and many many other perfectly valid uses by overlap.</div>
<div><br></div><div>-Edward<br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 3:20 PM, John Wiegley <span dir="ltr"><<a href="mailto:johnw@fpcomplete.com" target="_blank">johnw@fpcomplete.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">>>>>> Edward Kmett <<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>> writes:<br>
<br>
> The third construction is the 'universal' lifting that works for every<br>
> Applicative, which would look like:<br>
<br>
> instance (Monad m, Monoid a) => Monoid (ContT r m a) where<br>
> mempty = return mempty<br>
> mappend = liftM2 mappend<br>
<br>
</div>Why not then this? That is, once AMP is out...<br>
<br>
instance (Applicative m, Monoid a) => Monoid (m a) where<br>
mempty = pure mempty<br>
mappend = liftA2 mappend<br>
<div class="im HOEnZb"><br>
--<br>
John Wiegley<br>
FP Complete Haskell tools, training and consulting<br>
<a href="http://fpcomplete.com" target="_blank">http://fpcomplete.com</a> johnw on #haskell/<a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a><br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div>