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:[EMAIL PROTECTED]

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to