1 Mar
2018
1 Mar
'18
3:46 a.m.
Chris Angelico writes:
Memoization can only be done for pure functions.
True, but when for impure f you naively construct a list [f(x), f(x)], substituting [(f(x) as wrong), wrong] is just [wrong, wrong] ;-), because the side effect doesn't get reevaluated. Steve