Thomas Bereknyei | 7 Jan 07:56 2013
Picon

help diagnosing space leak with IORef/STRef, just incrementing a million times.

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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane