Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions to run outer layers of monadic stacks.
These are provided for convenience only; you can use the running
functions (like runState
) from the transformers' modules directly.
Note that reader and state runners have their arguments swapped around; this makes it convenient to chain them.
- run :: Identity a -> a
- runReader :: r -> ReaderT r m a -> m a
- runStateLazy :: s -> StateT s m a -> m (a, s)
- runStateStrict :: s -> StateT s m a -> m (a, s)
- evalStateLazy :: Monad m => s -> StateT s m a -> m a
- evalStateStrict :: Monad m => s -> StateT s m a -> m a
- execStateLazy :: Monad m => s -> StateT s m a -> m s
- execStateStrict :: Monad m => s -> StateT s m a -> m s
- runWriterLazy :: (Monad m, Monoid w) => WriterT w m a -> m (a, w)
- runWriterStrict :: (Monad m, Monoid w) => StateT w m a -> m (a, w)
- evalWriterLazy :: (Monad m, Monoid w) => WriterT w m a -> m a
- evalWriterStrict :: (Monad m, Monoid w) => StateT w m a -> m a
- execWriterLazy :: (Monad m, Monoid w) => WriterT w m a -> m w
- execWriterStrict :: (Monad m, Monoid w) => StateT w m a -> m w
- evalWriterWith :: forall w m a. (w -> m ()) -> CustomWriterT w m a -> m a
- mapWriter :: forall w1 w2 m a. MonadWriter w2 m => (w1 -> w2) -> CustomWriterT w1 m a -> m a
- newtype CustomWriterT' w n m a = CustomWriterT (Proxied (w -> n ()) m a)
- type CustomWriterT w m = CustomWriterT' w m m
- runExcept :: ExceptT e m a -> m (Either e a)
- runMaybe :: MaybeT m a -> m (Maybe a)
- runZoom :: forall big small m a. (forall f. Functor f => (small -> f small) -> big -> f big) -> ZoomT big small m a -> m a
- newtype ZoomT big small m a = ZoomT (Proxied (VLLens big small) m a)
- newtype ReadStateT s m a = ReadStateT (IdentityT m a)
- runReadState :: Proxy s -> ReadStateT s m a -> m a
Identity
Reader
State
runStateLazy :: s -> StateT s m a -> m (a, s) Source #
runStateStrict :: s -> StateT s m a -> m (a, s) Source #
evalStateLazy :: Monad m => s -> StateT s m a -> m a Source #
evalStateStrict :: Monad m => s -> StateT s m a -> m a Source #
execStateLazy :: Monad m => s -> StateT s m a -> m s Source #
execStateStrict :: Monad m => s -> StateT s m a -> m s Source #
Writer
evalWriterWith :: forall w m a. (w -> m ()) -> CustomWriterT w m a -> m a Source #
mapWriter :: forall w1 w2 m a. MonadWriter w2 m => (w1 -> w2) -> CustomWriterT w1 m a -> m a Source #
Transform all writer requests with a given function
newtype CustomWriterT' w n m a Source #
CustomWriterT (Proxied (w -> n ()) m a) |
Monad m => MonadWriterN Zero w (CustomWriterT' * w m m) Source # | |
MonadBase b m => MonadBase b (CustomWriterT' * w n m) Source # | |
MonadBaseControl b m => MonadBaseControl b (CustomWriterT' * w n m) Source # | |
MonadTrans (CustomWriterT' * w n) Source # | |
MonadTransControl (CustomWriterT' * w n) Source # | |
Monad m => Monad (CustomWriterT' * w n m) Source # | |
Functor m => Functor (CustomWriterT' * w n m) Source # | |
Applicative m => Applicative (CustomWriterT' * w n m) Source # | |
MonadIO m => MonadIO (CustomWriterT' * w n m) Source # | |
Alternative m => Alternative (CustomWriterT' * w n m) Source # | |
MonadPlus m => MonadPlus (CustomWriterT' * w n m) Source # | |
type CanDo * (CustomWriterT' * w n m) eff Source # | |
type StT (CustomWriterT' * w n) a Source # | |
type StM (CustomWriterT' * w n m) a Source # | |
type CustomWriterT w m = CustomWriterT' w m m Source #
Except
Zoom
runZoom :: forall big small m a. (forall f. Functor f => (small -> f small) -> big -> f big) -> ZoomT big small m a -> m a Source #
newtype ZoomT big small m a Source #
MonadReader big m => MonadReaderN Zero small (ZoomT * big small m) Source # | |
MonadState big m => MonadStateN Zero small (ZoomT * big small m) Source # | |
(MonadState big m, Monoid small) => MonadWriterN Zero small (ZoomT * big small m) Source # | |
MonadBase b m => MonadBase b (ZoomT * big small m) Source # | |
MonadBaseControl b m => MonadBaseControl b (ZoomT * big small m) Source # | |
MonadTrans (ZoomT * big small) Source # | |
MonadTransControl (ZoomT * big small) Source # | |
Monad m => Monad (ZoomT * big small m) Source # | |
Functor m => Functor (ZoomT * big small m) Source # | |
Applicative m => Applicative (ZoomT * big small m) Source # | |
MonadIO m => MonadIO (ZoomT * big small m) Source # | |
Alternative m => Alternative (ZoomT * big small m) Source # | |
MonadPlus m => MonadPlus (ZoomT * big small m) Source # | |
type CanDo * (ZoomT * big small m) eff Source # | |
type StT (ZoomT * big small) a Source # | |
type StM (ZoomT * big small m) a Source # | |
ReadState
newtype ReadStateT s m a Source #
ReadState
is used to translate reader effects into state effects.
If you run a computation with StateT
, this handler is not needed,
since StateT
already handles read requests.
This is useful in cases when you work in an abstract MonadState
monad
and thus have no guarantee that its handler will also accept reader
requests.
ReadStateT (IdentityT m a) |
MonadState s m => MonadReaderN Zero s (ReadStateT * * s m) Source # | |
MonadBase b m => MonadBase b (ReadStateT k * x m) Source # | |
MonadBaseControl b m => MonadBaseControl b (ReadStateT k * s m) Source # | |
MonadTrans (ReadStateT k * s) Source # | |
MonadTransControl (ReadStateT k * x) Source # | |
Monad m => Monad (ReadStateT k * s m) Source # | |
Functor m => Functor (ReadStateT k * s m) Source # | |
Applicative m => Applicative (ReadStateT k * s m) Source # | |
type CanDo * (ReadStateT * * s m) eff Source # | |
type StT (ReadStateT k * x) a Source # | |
type StM (ReadStateT k * s m) a Source # | |
runReadState :: Proxy s -> ReadStateT s m a -> m a Source #