[Haskell-cafe] help diagnosing space leak with IORef/STRef, just incrementing a million times.

Thomas Bereknyei tomberek at gmail.com
Mon Jan 7 07:56:12 CET 2013


I have had issues like this with modifySTRef before. Try to make a strict
version modifySTRef'

If memory serves, something like this worked for me.
modifySTRef' r f =
  do
    a <- readSTRef r
    writeSTRef r $! f a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130107/0fff0863/attachment.htm>


More information about the Haskell-Cafe mailing list