[Haskell-cafe] Cleaning up stable names?
jvranish at gmail.com
Tue Sep 1 12:09:21 EDT 2009
Well usually, when I've used stable names, I've just used them to check if
things are the same, and then thrown them away. So no chance for a space
leak. It's usually unsafe to keep stable names around for very long as they
can lose their ability to tell if two things are the same (if this surprises
you, you should carefully reread
Out of curiosity, how are you planning on using them?
On Tue, Sep 1, 2009 at 3:40 AM, Peter Verswyvelen <bugfact at gmail.com> wrote:
> but without that function, stable names are not that useful I guess? they
> would cause a space leak?
> On Mon, Aug 31, 2009 at 10:59 PM, Job Vranish <jvranish at gmail.com> wrote:
>> I also would like a isStableNameTargetAlive function.
>> Though if you had such a function then you probably _could_ make a
>> deRefStableName function, which, since there isn't one, probably means
>> that such a function would be hard to make.
>> - Job
>> On Sun, Aug 30, 2009 at 4:54 PM, Peter Verswyvelen <bugfact at gmail.com>wrote:
>>> >From the documentation, I don't think I grasp how stable names work.
>>> From the docs:
>>> "There is no deRefStableName operation. You can't get back from a stable
>>> name to the original Haskell object. The reason for this is that the
>>> existence of a stable name for an object does not guarantee the existence of
>>> the object itself; it can still be garbage collected."
>>> From this I can conclude that stable names behave a bit like weak
>>> However, suppose I have a hash table of these stable names. How can I
>>> remove the redundant stable names from the table? I mean removing stable
>>> names that refer to an object that is garbage collected? I don't see any
>>> function for checking that (e.g. isStableNameTargetAlive or something)
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe