4 ms·
The semantics of >>= do not depend on the laziness of the language. >>= behaves exactly the same in Scala (although it's called flatMap there) as it does in Has
by rapala 12y ago
The semantics of >>= do not depend on the laziness of the language. >>= behaves exactly the same in Scala (although it's called flatMap there) as it does in Haskell. >>= does not execute effects, it only composes them. So to correct the article:
The infix application function (ma>>=\a->f(a)), commonly called bind, composes two computations. When the resulting computation is executed, ma is executed first, f is called with its result and finally the computation returned by f is executed.