Proposal: Applicative => Monad: Call for consensus

Tyson Whitehead 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
  f 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.

Cheers!  -Tyson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110106/5ad6ac71/attachment.pgp>


More information about the Libraries mailing list