Two questions on module ST: <http://www.haskell.org/ghc/docs/latest/set/sec-st.html> 1. What's the 's' parameter for? 2. Do STRefs get garbage-collected once they're forgotten? For instance, if I have an action that calls newSTRef, uses the ref, and then forgets it, and I run the action repeatedly, am I at risk of running out of memory? -- Ashley Yakeley, Seattle WA
On 27-Jul-2001, Ashley Yakeley <ashley@semantic.org> wrote:
Two questions on module ST: <http://www.haskell.org/ghc/docs/latest/set/sec-st.html>
1. What's the 's' parameter for?
It makes sure you don't try to use a reference obtained from one state thread in a different state thread.
2. Do STRefs get garbage-collected once they're forgotten?
In any decent implementation, yes. -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
participants (2)
-
Ashley Yakeley -
Fergus Henderson