Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
The multi-valued version of mtl's RWS / RWST
Synopsis
- 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
- mAsk :: m a
- class (Monad m, Monoid a) => MonadMultiWriter a m where
- mTell :: a -> m ()
- class Monad m => MonadMultiGet a m where
- mGet :: m a
- class MonadMultiGet a m => MonadMultiState a m where
- mSet :: a -> m ()
- 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, MonadMultiState s (t m), MonadTrans t) => StateT s m a -> t 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 #
Instances
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.
Instances
(MonadTrans t, Monad (t m), MonadMultiReader a m) => MonadMultiReader a (t m) Source # | |
Defined in Control.Monad.Trans.MultiReader.Class | |
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # | |
Defined in Control.Monad.Trans.MultiReader.Strict mAsk :: MultiReaderT c m a Source # | |
(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # | |
Defined in Control.Monad.Trans.MultiReader.Lazy mAsk :: MultiReaderT c m a Source # | |
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # | |
Defined in Control.Monad.Trans.MultiRWS.Strict | |
(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # | |
Defined in Control.Monad.Trans.MultiRWS.Lazy |
class (Monad m, Monoid a) => MonadMultiWriter a m where Source #
Instances
class Monad m => MonadMultiGet a m where Source #
In contrast to MonadMultiReader, MonadMultiGet is defined for State too, so it corresponds to read-access of any kind.
Note however that for MultiRWS, only the values from the state
part can
be accessed via MonadMultiGet
, due to limitations of the design of
MultiRWS
and of the type system. This is issue is resolved in the
MultiGST
type.
Instances
class MonadMultiGet a m => MonadMultiState a m where Source #
Instances
(MonadTrans t, Monad (t m), MonadMultiState a m) => MonadMultiState a (t m) Source # | |
Defined in Control.Monad.Trans.MultiState.Class | |
(Monad m, ContainsType a c) => MonadMultiState a (MultiStateT c m) Source # | |
Defined in Control.Monad.Trans.MultiState.Strict mSet :: a -> MultiStateT c m () Source # | |
(Monad m, ContainsType a c) => MonadMultiState a (MultiStateT c m) Source # | |
Defined in Control.Monad.Trans.MultiState.Lazy mSet :: a -> MultiStateT c m () Source # | |
(Monad m, HListMContains SettableFlag a cts) => MonadMultiState a (MultiGSTT cts m) Source # | |
Defined in Control.Monad.Trans.MultiGST.Strict | |
(Monad m, HListMContains SettableFlag a cts) => MonadMultiState a (MultiGSTT cts m) Source # | |
Defined in Control.Monad.Trans.MultiGST.Lazy | |
(Monad m, ContainsType a s) => MonadMultiState a (MultiRWST r w s m) Source # | |
Defined in Control.Monad.Trans.MultiRWS.Strict | |
(Monad m, ContainsType a s) => MonadMultiState a (MultiRWST r w s m) Source # | |
Defined in Control.Monad.Trans.MultiRWS.Lazy |
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, MonadMultiState s (t m), MonadTrans t) => StateT s m a -> t m a Source #
inflateMultiState :: (Functor m, Monad m) => MultiStateT s m a -> MultiRWST r w s m a Source #