
24 Apr
2011
24 Apr
'11
9:41 p.m.
"Edward Z. Yang"
I've been toying around with some ideas where we do alternative forms of controlled mutation. One such idea has to do with memoization. [..] Hash tables take advantage of this fact by simply chaining together values in a linked list if they land in the same bucket. [...] An obvious way to do this is to use unsafePerformIO to read out an IORef stating the value currently being looked up, and have the thunk evaluate to the pair of that key and the result. There are some synchronization concerns, of course:
Seen this? http://augustss.blogspot.com/2011/04/ugly-memoization-heres-problem-that-i.h... -k -- If I haven't seen further, it is by standing in the footprints of giants