Proposal: Applicative => Monad: Call for consensus
twhitehead at gmail.com
Thu Jan 6 18:35:08 CET 2011
On January 6, 2011 11:42:09 Iavor Diatchki wrote:
> > AFAIU, In applicative style programming "join" has proven to be a lot
> > more useful than "bind".
> I am not sure what you mean here, I find the "do" notation quite useful.
I think he was meaning when you are using monads in a more "function style"
(applicative) than "imperative style" (do notation).
As an example, consider the definition of ">>=" using join and the "$" and
"<$>" application operators
x >>= f = join $ f <$> x
versus that using "do" notation
x >>= f = do
x' <- x
Obviously both notations have their places, "do" is usually nicer if I want to
use values multiple times, while "applicative style" is usually nicer if I am
just unpacking values for an application. I suspect "do", however, tends to
get overused simply because that is what monad tutorials teach.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 490 bytes
Desc: This is a digitally signed message part.
More information about the Libraries