[Haskell-cafe] Re: evaluation semantics of bind

mail at justinbogner.com mail at justinbogner.com
Thu Feb 5 11:54:33 EST 2009

Oops, sent this off list the first time, here it is again.

Jake McArthur <jake at pikewerks.com> writes:
> mail at justinbogner.com wrote:
> | Bind is a sequencing operator rather than an application operator.
> In my opinion, this is a common misconception. I think that bind would
> be nicer if its arguments were reversed.

If this is a misconception, why does thinking of it this way work so
well? This idea is reinforced by the do notation syntactic sugar: bind
can be represented by going into imperative land and "do"ing one thing
before another.

The fact that `x' may not actually have to happen before `f' is merely
the typical sort of optimization we do in compilers for imperative
languages: instructions that do not modify non-local state can be
re-ordered, but IO cannot because it jumps elsewhere, no?

More information about the Haskell-Cafe mailing list