On Fri, Dec 10, 2010 at 6:40 PM, Russ Abbott <russ.abbott@gmail.com> wrote:
After writing the previous post, it struck me that memoization could be done at the function level. If each function had an associated Map <Arguments> <Result>, lookup would be much simpler and more localized. One could then decide on a function-by-function basis which maps to expand.

-- Russ 


There are packages on hackage to memoise functions, e.g. http://hackage.haskell.org/package/data-memocombinators
 
You have to decide yourself which functions to memoise, there are no good heuristics for the compiler to decide, as far as I know.