Good idea! I'd forgotten about monad comprehensions.<br><br><div class="gmail_quote">On Sun, Sep 4, 2011 at 3:11 AM, Shachaf Ben-Kiki <span dir="ltr"><<a href="mailto:shachaf@gmail.com">shachaf@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On Sat, Sep 3, 2011 at 19:34, Daniel Peebles <<a href="mailto:pumpkingod@gmail.com">pumpkingod@gmail.com</a>> wrote:<br>
...<br>
<div class="im">> Of course, the fact that the return method is explicitly mentioned in my<br>
> example suggests that unless we do some real voodoo, Applicative would have<br>
> to be a superclass of Monad for this to make sense. But with the new default<br>
> superclass instances people are talking about in GHC, that doesn't seem too<br>
> unlikely in the near future.<br>
</div>...<br>
<br>
One way to avoid explicitly mentioning return would be to use monad<br>
comprehension syntax, which uses return implicitly, instead of do<br>
notation. This also has the advantage of being "new" in GHC 7.2,<br>
rather than officially being part of Haskell 98/2010, and therefore<br>
being more amenable to various extensions (e.g. there are already<br>
extensions that use MonadPlus/MonadZip/MonadGroup). Applicative would<br>
probably still have to be a superclass of Monad, but the translation<br>
of this syntax is simpler.<br>
<font color="#888888"><br>
Shachaf<br>
</font></blockquote></div><br>