<div dir="ltr">Might as well capture all of 'em in one go.<div><br></div><div>+1 w/ aforementioned mappend/mplus fix.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 26, 2015 at 10:34 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Sorry for the terrible title, but I think we should add something like the following to Data.Monoid (I already mentioned this in the discussion of a Monoid instance for ZipList).</p>
<p dir="ltr">newtype Appl f m = Appl (f m)</p>
<p dir="ltr">instance (Applicative f, Monoid m) => Monoid (Appl f m) where<br>
mempty = Appl $ pure mempty<br>
mplus (Appl x) (Appl y) = Appl $ liftA2 mplus x y</p>
<p dir="ltr">It may be possible to use coercions to improve mplus; I haven't tried it.</p>
<p dir="ltr">This type is the same as WrappedApplicative from semigroupoids, do it might be best just to give it that name.</p>
<br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Chris Allen<br><div><span style="font-size:12.8000001907349px">Currently working on </span><a href="http://haskellbook.com" target="_blank">http://haskellbook.com</a></div></div></div></div></div></div>
</div>