
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