| Right associativity allows:
|     f >>= \x->
|     g >>= \y->
|     h x
| which with left associativity will be rejected because x is unbound
| (in h x), or even worse: if x is bound at an outer scope, you might get
| completely the wrong value (or if you're lucky a type error).

No worries here: the fixity of >>= doesn't matter in this example
because a lambda expression always extends as far to the right as
possible.  So this example will always be parsed as:

   f >>= (\x -> g >>= (\y -> h x))

The fixity only makes a difference when you consider an expression
like  f >>= g >>= h, where, for example, f,g,h are variables.

All the best,
Mark


Reply via email to