<div dir="ltr">I'm afraid I have to disagree with Adam as well. Recently I've triggered a prolonged discussion on exactly the subject (<a href="https://github.com/ekmett/either/pull/38">https://github.com/ekmett/either/pull/38</a>). Being originally convinced that the instances can behave however it fits, I think I've been over-persuaded in the end.<div><br></div><div>Shortly speaking, while I can't say I like it, the rule seems to be that `<*>` should produce the same side effects as Monad's `ap`.<div><br></div><div>The most convincing argument I've seen so far against the two digressing is that it can cause unexpected behaviour of the "do" notation (<a href="https://github.com/ekmett/either/pull/38#issuecomment-95695814">https://github.com/ekmett/either/pull/38#issuecomment-95695814</a>), but you'll find plenty of other arguments in the discussion as well.</div><div><br></div><div><div><div>Best regards,</div></div></div></div><div>Nikita Volkov</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-30 19:07 GMT+03:00 Kim-Ee Yeoh <span dir="ltr"><<a href="mailto:ky3@atamo.com" target="_blank">ky3@atamo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Apr 30, 2015 at 10:49 PM, Adam Bergmark <span dir="ltr"><<a href="mailto:adam@bergmark.nl" target="_blank">adam@bergmark.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes it's okay and sometimes expected for them not not behave the same, but see e.g. haxl and ApplicativeDo.</div></blockquote><div><br></div></span><div>This is a value of okay I've never seen before.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>For example, the applicative version may run foo and bar in parallell. But using monad they run sequentially.</div></div></blockquote></span></div><br></div><div class="gmail_extra">What if pure weren't a perfect synonym for return?<br><br></div><div class="gmail_extra">What if the methods of the semigroup instance didn't match those of the monoid?<br><br></div><div class="gmail_extra">The mind boggles at the confusion that would result.<br><br></div><div class="gmail_extra">Such cases typically call for newtypes to sort out the effect classes.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br clear="all"><div><div>-- Kim-Ee</div></div>
</div></font></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>