[Haskell-cafe] Finalisers

Don Stewart dons at galois.com
Wed Nov 26 17:10:45 EST 2008


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.


More information about the Haskell-Cafe mailing list