On Mon, Feb 9, 2009 at 11:06 AM, Tillmann Rendel <rendel@cs.au.dk> wrote:
Gregg Reynolds wrote::While a human reader may well do that, but it would be correct or wrong depending on the definition of >>=. The same is of course true for compilers. By the way, there is no "application f e".
My original question was motivated by the observation that a human reader of
an expression of the form "e >>= f" , on seeing that f is constant, may pull
the constant value out of f, disregard e and dispense with the application f
e.
An example where it would be wrong to ignore e:
sum ([1, 2] >>= const [21])
This expression should evaluate to sum [21, 21] = 42, not sum [21] = 21.