withState is:exact

withState f m executes action m on a state modified by applying f.
>>> runPureEff $ withState 10 $ \st -> do
n <- get st
pure (s -> (2 * n, s))
(20,10)
>>> runPureEff $ withState 10 $ \st -> do
n <- get st
pure (s -> (2 * n, s))
(20,10)