Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Extension of a monad with a modifiable environment
Type
A monad with modifiable type s, inner monad m, and return type a
Reading
Modifying
modify :: Monad m => (s -> s) -> StateT s m () Source #
Update the current value of the state with the given operation
foo = modify $ \s -> bar s