
26 Nov
2008
26 Nov
'08
5:10 p.m.
andrewcoppin:
Here's an interesting question... Is it possible to attach finalisers to a value? (That is, have some Haskell code executed when the item in question is reclaimed by the GC.) I'm interested in knowing whether a particular data structure is shared (i.e., whether it's safe to mutate it or whether it must be copied first), and a simple reference-counting scheme looks like the easiest option.
Yes.