Join GitHub today
Keep possibly-effectful expressions when optimizing multiplication by zero #956
referenced this pull request
Dec 8, 2016
yallop (2016/12/09 05:54 -0800):
> Shouldn't there be the same kind of code for the constant 1? The `1` case is fine: simplifying `e * 0` to `0` isn't correct if `e` has effects, but simplifying `e * 1` to `e` doesn't have that problem, since it doesn't discard `e`.
Ah indeed, sorry! Sometimes, thinking before writing wouldn't hurt... ;-)