module Control.Monad.State.Puts
  (puts)
  where

import Control.Monad.State

-- | Puts is just an opposite to gets.
-- Compare `x <- gets field' with `puts setField newValue'.
puts :: (MonadState s m) => (a -> s -> s) -> a -> m ()
puts fn value = modify (fn value)