withHashState :: (Monad m) => (HashState -> m (HashState, a)) -> HashT m a
withHashState act = do
  s0 <- get
  (s1, res) <- lift $ act s0
  put s1
  return res
withHashState :: (Monad m) => (HashState -> m (HashState, a)) -> HashT m a
withHashState act = do
  s0 <- get
  (s1, res) <- lift $ act s0
  put s1
  return res
withHashState act = do
  s0 <- get
  (s1, res) <- lift $ act s0
  put s1
  return res