On Mon, Jun 24, 2013 at 2:53 PM, Dan Burton <span dir="ltr">&lt;<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I also agree with Henning.<div><br></div><div>If anything, the 1st instance could be a ContT instance for Monoid.<br><div><br></div><div><div>instance (Monoid r, Monad m) =&gt; Monoid (ContT r m a) where</div><div>  mempty = ContT $ const $ return mempty</div>


<div>  m `mappend` n = ContT $ \ c -&gt; liftM2 mappend (runContT m c) (runContT n c)</div></div><div><br></div><div>That way both behaviors are easily accessible. Is there any other sensible ContT instance for Monoid?</div>
</div></blockquote><div> </div><div>Yes.</div><div><br></div><div>The third construction is the &#39;universal&#39; lifting that works for every Applicative, which would look like:<div><div><br></div><div>instance (Monad m, Monoid a) =&gt; Monoid (ContT r m a) where</div>
<div>  mempty = return mempty</div><div>  mappend = liftM2 mappend</div></div><div><br></div><div>-Edward</div></div><div><br></div></div>