Good idea! I'd forgotten about monad comprehensions. On Sun, Sep 4, 2011 at 3:11 AM, Shachaf Ben-Kiki <[email protected]> wrote:
> On Sat, Sep 3, 2011 at 19:34, Daniel Peebles <[email protected]> wrote: > ... > > Of course, the fact that the return method is explicitly mentioned in my > > example suggests that unless we do some real voodoo, Applicative would > have > > to be a superclass of Monad for this to make sense. But with the new > default > > superclass instances people are talking about in GHC, that doesn't seem > too > > unlikely in the near future. > ... > > One way to avoid explicitly mentioning return would be to use monad > comprehension syntax, which uses return implicitly, instead of do > notation. This also has the advantage of being "new" in GHC 7.2, > rather than officially being part of Haskell 98/2010, and therefore > being more amenable to various extensions (e.g. there are already > extensions that use MonadPlus/MonadZip/MonadGroup). Applicative would > probably still have to be a superclass of Monad, but the translation > of this syntax is simpler. > > Shachaf >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
