--
You received this message because you are subscribed to the Google Groups "scalaz" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaz+un...@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
Visit this group at http://groups.google.com/group/scalaz.
For more options, visit https://groups.google.com/d/optout.
Hi Normen,The structure of an applicative computation is fixed because the higher-order function you pass to the `ap` operation can not affect the structure (context) in any way (the higher-order function is lifter *in* the context F: F[A => B], but can not do any operation on it... it just "live" in it).
OTOH, the structure of a monad computation can change over the different application of the `bind` operation, this is simply due to the fact that the higher-order function that you pass to this operation can actually affect the structure: A => F[B], here your function can cleary create a "new" context F and replace the "old" one with it.
def bind[A, B](fa: F[A])(f: A => F[B]): F[B]
def bind[A, B](fa: List[A])(f: A => List[B]): List[B]
All `F`s are instantiate to `List`. So how can `f` create a new context, say, how can `f` modify the structure?
As an illustrative example let's take the domain of effects handling, for Applicative, you can think of any computations that can actually run concurrently and have no data dependency between them. Those computations are in that same given structure, but does not need to affect/operate on this structure in anyways.
You can imagine instances where the orderding of composition does not matter at all (as there is no data dependency).But with a Monad, in the context of effects you can create new computation that depend on the value of a previous one (because `bind` allow you to return a new context after processing the value).
You can actually describe data-depency and affect the control flow of your effects.
I hope those short explainations will help you understand those beautitful abstractions!