
24 Aug
2006
24 Aug
'06
7:52 a.m.
Hello Gregory, Thursday, August 24, 2006, 2:29:15 PM, you wrote:
step t = do c <- readSTRef (count t) s <- readSTRef (state t) writeSTRef (count t) (c - 1) writeSTRef (state t) (nextState s) if (c <= 0) then return Nothing else return (Just c)
as Chris said, you are write unevaluated chunks. add $! to evaluate values before writing: writeSTRef (count t) $! (c - 1) writeSTRef (state t) $! (nextState s) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com