| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.Trans.MultiGST
Contents
Description
The multi-valued version of mtl's RWS / RWST
Synopsis
- newtype MultiGSTT ts m a = MultiGSTT {
- runMultiGSTTRaw :: StateT (HListM ts) m a
- type MultiGSTTNull = MultiGSTT '[]
- type MultiGST r = MultiGSTT r Identity
- type ContainsReader = HListMContains GettableFlag
- type ContainsState = HListMContains SettableFlag
- type ContainsWriter = HListMContains TellableFlag
- class Monad m => MonadMultiReader a m where
- class (Monad m, Monoid a) => MonadMultiWriter a m where
- class Monad m => MonadMultiGet a m where
- data CanReadWrite a
- runMultiGSTTNil :: Monad m => MultiGSTT '[] m a -> m a
- runMultiGSTTNil_ :: Monad m => MultiGSTT '[] m a -> m ()
- withReader :: Monad m => t -> MultiGSTT (Gettable t ': tr) m a -> MultiGSTT tr m a
- withReader_ :: Monad m => t -> MultiGSTT (Gettable t ': tr) m a -> MultiGSTT tr m ()
- withReaders :: Monad m => HList rs -> MultiGSTT (AppendM (HListMReaders rs) ts) m a -> MultiGSTT ts m a
- withWriter :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (a, t)
- withWriterAW :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (a, t)
- withWriterWA :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (t, a)
- withWriterW :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m t
- withState :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (a, t)
- withStateAS :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (a, t)
- withStateSA :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (t, a)
- withStateA :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m a
- withStateS :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m t
- withState_ :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m ()
- without :: Monad m => MultiGSTT tr m a -> MultiGSTT (ct ': tr) m a
- mapMultiGSTT :: ts ~ HListM cts => (m (a, ts) -> m' (a', ts)) -> MultiGSTT cts m a -> MultiGSTT cts m' a'
- mGetRawR :: (Monad m, HListMGettableClass ts) => MultiGSTT ts m (HList (HListMGettableOnly ts))
- mSetRaw :: Monad m => HListM ts -> MultiGSTT ts m ()
- mGetRaw :: Monad m => MultiGSTT ts m (HListM ts)
MultiRWST
Constructors
| MultiGSTT | |
Fields
| |
Instances
type MultiGSTTNull = MultiGSTT '[] #
MonadMulti classes
type ContainsReader = HListMContains GettableFlag #
type ContainsState = HListMContains SettableFlag #
type ContainsWriter = HListMContains TellableFlag #
class Monad m => MonadMultiReader a m where #
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.
Minimal complete definition
Instances
| (MonadTrans t, Monad (t m), MonadMultiReader a m) => MonadMultiReader a (t m) # | |
Defined in Control.Monad.Trans.MultiReader.Class | |
| (Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) # | |
Defined in Control.Monad.Trans.MultiReader.Strict Methods mAsk :: MultiReaderT c m a # | |
| (Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) # | |
Defined in Control.Monad.Trans.MultiReader.Lazy Methods mAsk :: MultiReaderT c m a # | |
| (Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) # | |
Defined in Control.Monad.Trans.MultiRWS.Strict | |
| (Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) # | |
Defined in Control.Monad.Trans.MultiRWS.Lazy | |
class (Monad m, Monoid a) => MonadMultiWriter a m where #
Minimal complete definition
Instances
class Monad m => MonadMultiGet a m where #
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.
Minimal complete definition
Instances
data CanReadWrite a #
run-functions (extracting from RWST)
runMultiGSTTNil :: Monad m => MultiGSTT '[] m a -> m a #
runMultiGSTTNil_ :: Monad m => MultiGSTT '[] m a -> m () #
with-functions (extending an RWST)
withReaders :: Monad m => HList rs -> MultiGSTT (AppendM (HListMReaders rs) ts) m a -> MultiGSTT ts m a #
without-functions (reducing an RWST; inverse of with)
other functions
mapMultiGSTT :: ts ~ HListM cts => (m (a, ts) -> m' (a', ts)) -> MultiGSTT cts m a -> MultiGSTT cts m' a' #