modify package:effectful-core

Apply the function to the current state.
modify f ≡ state (\s -> ((), f s))
Apply the function to the current state.
modify f ≡ state (\s -> ((), f s))
Note: this function gets an exclusive access to the state for its duration.
Modify the data type in the environment (in place).
Apply the monadic function to the current state.
modifyM f ≡ stateM (\s -> ((), ) <$> f s)
Apply the monadic function to the current state.
modifyM f ≡ stateM (\s -> ((), ) <$> f s)
Note: this function gets an exclusive access to the state for its duration.