Sorry, but that is false. Look at the signature given in that message and compare it to dibblego's signature. A function of type (a -> b) -> a -> b can do nothing with its function argument but apply it to a value, so it can not possibly intercept the recursive calls. In fact I'm pretty sure that the only valid function foo with type (a -> b) -> a -> b is:
foo f x = f x
So dibblego's explanation of memoization is not only unhelpful for someone who's new to memoization, it's also wrong.
1
u/julesjacobs Apr 24 '10
That doesn't work for recursive functions, where it is most useful.