Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell2010 |

## Synopsis

- assign :: MonadState s m => ASetter s s a b -> b -> m ()
- gets :: MonadState s m => (s -> a) -> m a
- getsAndModify :: MonadState s m => (s -> (s, a)) -> m a
- maybeM :: Monad m => (x -> m ()) -> Maybe x -> m ()
- repeatUntilM :: Monad m => m (Bool, a) -> m [a]
- uses :: MonadState s m => Getting a s a -> (a -> b) -> m b
- whenM :: Monad m => m Bool -> m () -> m ()
- with :: (MonadReader r m, MonadBase b m) => (r -> a) -> (a -> b c) -> m c

# Documentation

assign :: MonadState s m => ASetter s s a b -> b -> m () Source #

gets :: MonadState s m => (s -> a) -> m a #

Gets specific component of the state, using a projection function supplied.

getsAndModify :: MonadState s m => (s -> (s, a)) -> m a Source #

Combination of the Control.Monad.State `modify`

and `gets`

repeatUntilM :: Monad m => m (Bool, a) -> m [a] Source #

Rerun the monad until the boolean result is false, collecting list of results.

uses :: MonadState s m => Getting a s a -> (a -> b) -> m b Source #

with :: (MonadReader r m, MonadBase b m) => (r -> a) -> (a -> b c) -> m c Source #