Safe Haskell | Safe-Infered |
---|

- focus :: Monad m => Ref (Focusing m c) a b -> StateT b m c -> StateT a m c
- access :: Monad m => Getter a b -> StateT a m b
- (%=) :: Monad m => Setter a b -> (b -> b) -> StateT a m ()
- (~=) :: Monad m => Setter a b -> b -> StateT a m ()
- (%%=) :: Monad m => Ref (Focusing m c) a b -> (b -> (c, b)) -> StateT a m c
- (+=), (*=), (-=) :: (Monad m, Num b) => Setter a b -> b -> StateT a m ()
- (//=) :: (Monad m, Fractional b) => Setter a b -> b -> StateT a m ()
- (&&=), (||=) :: Monad m => Setter a Bool -> Bool -> StateT a m ()
- (<>=) :: (Monoid o, Monad m) => Setter a o -> o -> StateT a m ()
- data Focusing m c a

# Documentation

focus :: Monad m => Ref (Focusing m c) a b -> StateT b m c -> StateT a m cSource

Lift a stateful operation on a field to a stateful operation on the whole state. This is a good way to call a "subroutine" that only needs access to part of the state.

(%%=) :: Monad m => Ref (Focusing m c) a b -> (b -> (c, b)) -> StateT a m cSource

Modify a field of the state while returning another value