Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Monad m => MonadState s m | m -> s where
- data StateT s m a
- type State s a = StateT s Id a
- class StateRes t s a | t -> s a where
- stateT :: (Functor m, Functor n) => Iso (StateT s m a) (StateT t n b) (s -> m (s, a)) (t -> n (t, b))
- state :: Iso (State s a) (State t b) (s -> (s, a)) (t -> (t, b))
- (<~) :: MonadState s m => Lens' s a -> (a -> (a, b)) -> m b
- (=~) :: MonadState s m => FixFold' s a -> (a -> a) -> m ()
- (=-) :: MonadState s m => FixFold' s s' -> s' -> m ()
- (^>=) :: MonadState s m => LensLike m a a s s -> (a -> m ()) -> m ()
- gets :: MonadState s m => (s -> a) -> m a
- getl :: MonadState s m => Lens' s a -> m a
- saving :: MonadState s m => Lens' s s' -> m a -> m a
- swapWith :: MonadState s m => Lens' s a -> (a -> a) -> m a
- type Next a = a
- type Prev a = a
- mapAccum :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> (s, t b)
- mapAccum_ :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> t b
- mapAccumR :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> (s, t b)
- mapAccumR_ :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> t b
- scanl :: Traversable t => (a -> b -> a) -> a -> t b -> t a
- scanr :: Traversable t => (a -> b -> a) -> a -> t b -> t a
- push :: Traversable t => t a -> a -> t a
- pop :: Traversable t => t a -> a -> t a
- withPrev :: Traversable t => a -> t a -> t (Prev a, a)
- withNext :: Traversable t => t a -> a -> t (a, Next a)
- newtype StateA m s a = StateA (StateT s m a)
- stateA :: Iso (StateA m s a) (StateA m' s' a') (StateT s m a) (StateT s' m' a')
- runAtomic :: IORef s -> State s a -> IO a
The State Monad
class Monad m => MonadState s m | m -> s where Source #
MonadState s m => MonadState s (Free m) Source # | |
MonadState s m => MonadState s (ListT m) Source # | |
MonadState s m => MonadState s (TreeT m) Source # | |
MonadState s m => MonadState s (MaybeT m) Source # | |
MonadState s m => MonadState s (StrictT m) Source # | |
MonadState s m => MonadState s (LogicT m) Source # | |
(Traversable f, Monad f, MonadState s g) => MonadState s (Compose' f g) Source # | |
MonadState s m => MonadState s (ReaderT r m) Source # | |
Monad m => MonadState s (StateT s m) Source # | |
(Monoid w, MonadState r m) => MonadState r (WriterT w m) Source # | |
(MonadState s m, Monoid w) => MonadState s (CounterT w acc m) Source # | |
(Monad m, Monoid w) => MonadState s (RWST r w s m) Source # | |
stateT :: (Functor m, Functor n) => Iso (StateT s m a) (StateT t n b) (s -> m (s, a)) (t -> n (t, b)) Source #
(<~) :: MonadState s m => Lens' s a -> (a -> (a, b)) -> m b infixl 1 Source #
(=~) :: MonadState s m => FixFold' s a -> (a -> a) -> m () infixl 1 Source #
(=-) :: MonadState s m => FixFold' s s' -> s' -> m () infixl 1 Source #
(^>=) :: MonadState s m => LensLike m a a s s -> (a -> m ()) -> m () Source #
gets :: MonadState s m => (s -> a) -> m a Source #
getl :: MonadState s m => Lens' s a -> m a Source #
saving :: MonadState s m => Lens' s s' -> m a -> m a Source #
swapWith :: MonadState s m => Lens' s a -> (a -> a) -> m a Source #
mapAccum :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> (s, t b) Source #
mapAccum_ :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> t b Source #
mapAccumR :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> (s, t b) Source #
mapAccumR_ :: Traversable t => (a -> s -> (s, b)) -> t a -> s -> t b Source #
scanl :: Traversable t => (a -> b -> a) -> a -> t b -> t a Source #
scanr :: Traversable t => (a -> b -> a) -> a -> t b -> t a Source #
push :: Traversable t => t a -> a -> t a Source #
pop :: Traversable t => t a -> a -> t a Source #
withPrev :: Traversable t => a -> t a -> t (Prev a, a) Source #
withNext :: Traversable t => t a -> a -> t (a, Next a) Source #
The State Arrow
Atomic IO state
Orphan instances
MonadState (IO ()) IO Source # | |