Gregg Reynolds <[email protected]> writes:
> I think I've just about got monads figured out, but there's one detail that
> still escapes me.  As I understand it, a monad is a kind of programming trick
> the uses data dependency to force evaluation order.  x >>= f means apply f to
> x; since the value of f x depends on the value of x, the evaluator must
> evaluate x before f x. However, consider:
>
>     getChar >>= \x -> getChar
>

x >>= f does not mean "apply f to x", it means "do x, and then do f with
the result of x". Bind is a sequencing operator rather than an
application operator.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to