
1 Mar
2011
1 Mar
'11
6:22 a.m.
Hello, The documentation page on System.Mem.Weak [1] contains the following sentence: "The finalizer, and the relationship between the key and the value, exist regardless of whether the program keeps a reference to the Weak object or not." Our reading of this statement implies, in particular, that, - given a key k, a value v, and a weak pointer w <- mkWeak k v Nothing, - if we lose all references to v and w, - then the value v will not be garbage-collected as long as we keep a reference to k, even though we cannot possibly retrieve v from k only. Is our understanding correct? Thanks in advance and best regards, Andrei Paskevich [1] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.h...