Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
The multi-valued version of mtl's RWS / RWST
- newtype MultiRWST r w s m a = MultiRWST {
- runMultiRWSTRaw :: StateT (HList r, HList w, HList s) m a
- type MultiRWSTNull = MultiRWST '[] '[] '[]
- type MultiRWS r w s = MultiRWST r w s Identity
- class Monad m => MonadMultiReader a m where
- class (Monad m, Monoid a) => MonadMultiWriter a m where
- class Monad m => MonadMultiState a m where
- runMultiRWST :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList s, HList w)
- runMultiRWSTASW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList s, HList w)
- runMultiRWSTW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (HList w)
- runMultiRWSTAW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList w)
- runMultiRWSTSW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (HList s, HList w)
- runMultiRWSTNil :: Monad m => MultiRWST '[] '[] '[] m a -> m a
- runMultiRWSTNil_ :: (Monad m, Functor m) => MultiRWST '[] '[] '[] m a -> m ()
- withMultiReader :: Monad m => r -> MultiRWST (r ': rs) w s m a -> MultiRWST rs w s m a
- withMultiReader_ :: (Functor m, Monad m) => r -> MultiRWST (r ': rs) w s m a -> MultiRWST rs w s m ()
- withMultiReaders :: Monad m => HList r1 -> MultiRWST (Append r1 r2) w s m a -> MultiRWST r2 w s m a
- withMultiReaders_ :: (Functor m, Monad m) => HList r1 -> MultiRWST (Append r1 r2) w s m a -> MultiRWST r2 w s m ()
- withMultiWriter :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (a, w)
- withMultiWriterAW :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (a, w)
- withMultiWriterWA :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (w, a)
- withMultiWriterW :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m w
- withMultiWriters :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (a, HList w1)
- withMultiWritersAW :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (a, HList w1)
- withMultiWritersWA :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (HList w1, a)
- withMultiWritersW :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (HList w1)
- withMultiState :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m (a, s)
- withMultiStateAS :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m (a, s)
- withMultiStateSA :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m (s, a)
- withMultiStateA :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m a
- withMultiStateS :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m s
- withMultiState_ :: (Functor m, Monad m) => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m ()
- withMultiStates :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (a, HList s1)
- withMultiStatesAS :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (a, HList s1)
- withMultiStatesSA :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (HList s1, a)
- withMultiStatesA :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m a
- withMultiStatesS :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (HList s1)
- withMultiStates_ :: (Functor m, Monad m) => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m ()
- withoutMultiReader :: Monad m => MultiRWST rs w s m a -> MultiRWST (r ': rs) w s m a
- withoutMultiState :: Monad m => MultiRWST r w ss m a -> MultiRWST r w (s ': ss) m a
- inflateReader :: (Monad m, ContainsType r rs) => ReaderT r m a -> MultiRWST rs w s m a
- inflateMultiReader :: Monad m => MultiReaderT r m a -> MultiRWST r w s m a
- inflateWriter :: (Monad m, ContainsType w ws, Monoid w) => WriterT w m a -> MultiRWST r ws s m a
- inflateMultiWriter :: (Functor m, Monad m, Monoid (HList w)) => MultiWriterT w m a -> MultiRWST r w s m a
- inflateState :: (Monad m, ContainsType s ss) => StateT s m a -> MultiRWST r w ss m a
- inflateMultiState :: (Functor m, Monad m) => MultiStateT s m a -> MultiRWST r w s m a
- mapMultiRWST :: ss ~ (HList r, HList w, HList s) => (m (a, ss) -> m' (a', ss)) -> MultiRWST r w s m a -> MultiRWST r w s m' a'
- mGetRawR :: Monad m => MultiRWST r w s m (HList r)
- mGetRawW :: Monad m => MultiRWST r w s m (HList w)
- mGetRawS :: Monad m => MultiRWST r w s m (HList s)
- mPutRawR :: Monad m => HList r -> MultiRWST r w s m ()
- mPutRawW :: Monad m => HList w -> MultiRWST r w s m ()
- mPutRawS :: Monad m => HList s -> MultiRWST r w s m ()
MultiRWST
newtype MultiRWST r w s m a Source #
MonadBase b m => MonadBase b (MultiRWST r w s m) Source # | |
MonadBaseControl b m => MonadBaseControl b (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a w, Monoid a) => MonadMultiWriter a (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a s) => MonadMultiState a (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # | |
MonadTrans (MultiRWST r w s) Source # | |
MonadTransControl (MultiRWST r w s) Source # | |
Monad m => Monad (MultiRWST r w s m) Source # | |
Functor f => Functor (MultiRWST r w s f) Source # | |
MonadFix m => MonadFix (MultiRWST r w s m) Source # | |
(Applicative m, Monad m) => Applicative (MultiRWST r w s m) Source # | |
MonadIO m => MonadIO (MultiRWST r w s m) Source # | |
(Functor m, Applicative m, MonadPlus m) => Alternative (MultiRWST r w s m) Source # | |
MonadPlus m => MonadPlus (MultiRWST r w s m) Source # | |
type StT (MultiRWST r w s) a Source # | |
type StM (MultiRWST r w s m) a Source # | |
type MultiRWSTNull = MultiRWST '[] '[] '[] Source #
MonadMulti classes
class Monad m => MonadMultiReader a m where Source #
All methods must be defined.
The idea is: Any monad stack is instance of MonadMultiReader a
, iff
the stack contains a MultiReaderT x
with a element of x.
(MonadTrans t, Monad (t m), MonadMultiReader a m) => MonadMultiReader a (t m) Source # | |
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # | |
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # | |
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # | |
class (Monad m, Monoid a) => MonadMultiWriter a m where Source #
(MonadTrans t, Monad (t m), MonadMultiWriter a m) => MonadMultiWriter a (t m) Source # | |
(Monad m, ContainsType a c, Monoid a) => MonadMultiWriter a (MultiWriterT c m) Source # | |
(Monad m, ContainsType a c, Monoid a) => MonadMultiWriter a (MultiWriterT c m) Source # | |
(Monad m, ContainsType a w, Monoid a) => MonadMultiWriter a (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a w, Monoid a) => MonadMultiWriter a (MultiRWST r w s m) Source # | |
class Monad m => MonadMultiState a m where Source #
All methods must be defined.
The idea is: Any monad stack is instance of MonadMultiState a
, iff
the stack contains a MultiStateT x
with a element of x.
state set function for values of type a
.
state get function for values of type a
.
(MonadTrans t, Monad (t m), MonadMultiState a m) => MonadMultiState a (t m) Source # | |
(Monad m, ContainsType a c) => MonadMultiState a (MultiStateT c m) Source # | |
(Monad m, ContainsType a c) => MonadMultiState a (MultiStateT c m) Source # | |
(Monad m, ContainsType a s) => MonadMultiState a (MultiRWST r w s m) Source # | |
(Monad m, ContainsType a s) => MonadMultiState a (MultiRWST r w s m) Source # | |
run-functions (extracting from RWST)
runMultiRWST :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList s, HList w) Source #
runMultiRWSTASW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList s, HList w) Source #
runMultiRWSTW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (HList w) Source #
runMultiRWSTAW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (a, HList w) Source #
runMultiRWSTSW :: (Monad m, Monoid (HList w)) => HList r -> HList s -> MultiRWST r w s m a -> m (HList s, HList w) Source #
runMultiRWSTNil :: Monad m => MultiRWST '[] '[] '[] m a -> m a Source #
with-functions (extending an RWST)
withMultiReader_ :: (Functor m, Monad m) => r -> MultiRWST (r ': rs) w s m a -> MultiRWST rs w s m () Source #
withMultiReaders :: Monad m => HList r1 -> MultiRWST (Append r1 r2) w s m a -> MultiRWST r2 w s m a Source #
withMultiReaders_ :: (Functor m, Monad m) => HList r1 -> MultiRWST (Append r1 r2) w s m a -> MultiRWST r2 w s m () Source #
withMultiWriter :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (a, w) Source #
withMultiWriterAW :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (a, w) Source #
withMultiWriterWA :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m (w, a) Source #
withMultiWriterW :: (Monoid w, Monad m) => MultiRWST r (w ': ws) s m a -> MultiRWST r ws s m w Source #
withMultiWriters :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (a, HList w1) Source #
withMultiWritersAW :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (a, HList w1) Source #
withMultiWritersWA :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (HList w1, a) Source #
withMultiWritersW :: forall r w1 w2 s m a. (Monoid (HList w1), Monad m, HInit w1) => MultiRWST r (Append w1 w2) s m a -> MultiRWST r w2 s m (HList w1) Source #
withMultiStateAS :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m (a, s) Source #
withMultiStateSA :: Monad m => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m (s, a) Source #
withMultiState_ :: (Functor m, Monad m) => s -> MultiRWST r w (s ': ss) m a -> MultiRWST r w ss m () Source #
withMultiStates :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (a, HList s1) Source #
withMultiStatesAS :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (a, HList s1) Source #
withMultiStatesSA :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (HList s1, a) Source #
withMultiStatesA :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m a Source #
withMultiStatesS :: Monad m => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m (HList s1) Source #
withMultiStates_ :: (Functor m, Monad m) => HList s1 -> MultiRWST r w (Append s1 s2) m a -> MultiRWST r w s2 m () Source #
without-functions (reducing an RWST; inverse of with)
inflate-functions (run simple transformer in MultiRWST)
inflateReader :: (Monad m, ContainsType r rs) => ReaderT r m a -> MultiRWST rs w s m a Source #
inflateMultiReader :: Monad m => MultiReaderT r m a -> MultiRWST r w s m a Source #
inflateWriter :: (Monad m, ContainsType w ws, Monoid w) => WriterT w m a -> MultiRWST r ws s m a Source #
inflateMultiWriter :: (Functor m, Monad m, Monoid (HList w)) => MultiWriterT w m a -> MultiRWST r w s m a Source #
inflateState :: (Monad m, ContainsType s ss) => StateT s m a -> MultiRWST r w ss m a Source #
inflateMultiState :: (Functor m, Monad m) => MultiStateT s m a -> MultiRWST r w s m a Source #