
On 8/3/07, Chris Smith
Neil Mitchell
wrote: I'm not convinced either, a nice concrete example would let people ponder this a bit more.
I tried to provide something in my response to Simon. Here it is again:
One could sugar:
do tax <- getTax return $ map (\price -> price * (1 + tax)) bill
into:
do return $ map (\price -> price * (1 + (<- getTax))) someNums
I think what Simon is worried about here is that the syntax in the latter expression suggests that the effects of getTax will be performed every time the lambda is applied. After all getTax appears inside the lambda. But in fact is the side effects will only be performed once. I agree with Simon that (<- getTax) shouldn't be promoted outside a lambda. Fwiw, I'm all in favor for some new piece of syntax for this problem. Cheers, Josef