"Edward Z. Yang" <ezy...@mit.edu> writes:

> 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.html

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to