Modify the target of a
Lens into your
Monad's state by
a user supplied function and return the
old value that was
replaced.
When applied to a
Traversal, this will return a monoidal
summary of all of the old values present.
When you do not need the result of the operation, (
%=) is more
flexible.
(<<%=) :: MonadState s m => Lens' s a -> (a -> a) -> m a
(<<%=) :: MonadState s m => Iso' s a -> (a -> a) -> m a
(<<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a
(<<%=) :: MonadState s m => LensLike ((,)a) s s a b -> (a -> b) -> m a