multistate-0.8.0.3: like mtl's ReaderT / WriterT / StateT, but more than one contained value/type.

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.MultiGST

Contents

Description

The multi-valued version of mtl's RWS / RWST

Synopsis

MultiRWST

newtype MultiGSTT ts m a Source #

Constructors

MultiGSTT 

Fields

Instances
(Monad m, HListMContains GettableFlag a cts) => MonadMultiGet a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mGet :: MultiGSTT cts m a Source #

(Monad m, HListMContains SettableFlag a cts) => MonadMultiState a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mSet :: a -> MultiGSTT cts m () Source #

(Monad m, Monoid a, HListMContains TellableFlag a cts) => MonadMultiWriter a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mTell :: a -> MultiGSTT cts m () Source #

MonadTrans (MultiGSTT ts) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

lift :: Monad m => m a -> MultiGSTT ts m a #

Monad m => Monad (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

(>>=) :: MultiGSTT ts m a -> (a -> MultiGSTT ts m b) -> MultiGSTT ts m b #

(>>) :: MultiGSTT ts m a -> MultiGSTT ts m b -> MultiGSTT ts m b #

return :: a -> MultiGSTT ts m a #

fail :: String -> MultiGSTT ts m a #

Functor m => Functor (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

fmap :: (a -> b) -> MultiGSTT ts m a -> MultiGSTT ts m b #

(<$) :: a -> MultiGSTT ts m b -> MultiGSTT ts m a #

Monad m => Applicative (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

pure :: a -> MultiGSTT ts m a #

(<*>) :: MultiGSTT ts m (a -> b) -> MultiGSTT ts m a -> MultiGSTT ts m b #

liftA2 :: (a -> b -> c) -> MultiGSTT ts m a -> MultiGSTT ts m b -> MultiGSTT ts m c #

(*>) :: MultiGSTT ts m a -> MultiGSTT ts m b -> MultiGSTT ts m b #

(<*) :: MultiGSTT ts m a -> MultiGSTT ts m b -> MultiGSTT ts m a #

MonadIO m => MonadIO (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

liftIO :: IO a -> MultiGSTT ts m a #

MonadPlus m => Alternative (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

empty :: MultiGSTT ts m a #

(<|>) :: MultiGSTT ts m a -> MultiGSTT ts m a -> MultiGSTT ts m a #

some :: MultiGSTT ts m a -> MultiGSTT ts m [a] #

many :: MultiGSTT ts m a -> MultiGSTT ts m [a] #

MonadPlus m => MonadPlus (MultiGSTT ts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mzero :: MultiGSTT ts m a #

mplus :: MultiGSTT ts m a -> MultiGSTT ts m a -> MultiGSTT ts m a #

MonadMulti classes

type ContainsReader = HListMContains GettableFlag Source #

type ContainsState = HListMContains SettableFlag Source #

type ContainsWriter = HListMContains TellableFlag Source #

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.

Methods

mAsk Source #

Arguments

:: m a

Access to a specific type in the environment.

Instances
(MonadTrans t, Monad (t m), MonadMultiReader a m) => MonadMultiReader a (t m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiReader.Class

Methods

mAsk :: t m a Source #

(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiReader.Strict

Methods

mAsk :: MultiReaderT c m a Source #

(Monad m, ContainsType a c) => MonadMultiReader a (MultiReaderT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiReader.Lazy

Methods

mAsk :: MultiReaderT c m a Source #

(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Strict

Methods

mAsk :: MultiRWST r w s m a Source #

(Monad m, ContainsType a r) => MonadMultiReader a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Lazy

Methods

mAsk :: MultiRWST r w s m a Source #

class (Monad m, Monoid a) => MonadMultiWriter a m where Source #

Methods

mTell :: a -> m () Source #

Instances
(MonadTrans t, Monad (t m), MonadMultiWriter a m) => MonadMultiWriter a (t m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiWriter.Class

Methods

mTell :: a -> t m () Source #

(Monad m, ContainsType a c, Monoid a) => MonadMultiWriter a (MultiWriterT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiWriter.Strict

Methods

mTell :: a -> MultiWriterT c m () Source #

(Monad m, ContainsType a c, Monoid a) => MonadMultiWriter a (MultiWriterT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiWriter.Lazy

Methods

mTell :: a -> MultiWriterT c m () Source #

(Monad m, Monoid a, HListMContains TellableFlag a cts) => MonadMultiWriter a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Strict

Methods

mTell :: a -> MultiGSTT cts m () Source #

(Monad m, Monoid a, HListMContains TellableFlag a cts) => MonadMultiWriter a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mTell :: a -> MultiGSTT cts m () Source #

(Monad m, ContainsType a w, Monoid a) => MonadMultiWriter a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Strict

Methods

mTell :: a -> MultiRWST r w s m () Source #

(Monad m, ContainsType a w, Monoid a) => MonadMultiWriter a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Lazy

Methods

mTell :: a -> MultiRWST r w s m () Source #

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.

Methods

mGet Source #

Arguments

:: m a

Access to a specific type in the environment.

Instances
(MonadTrans t, Monad (t m), MonadMultiGet a m) => MonadMultiGet a (t m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGet.Class

Methods

mGet :: t m a Source #

(Monad m, ContainsType a c) => MonadMultiGet a (MultiStateT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiState.Strict

Methods

mGet :: MultiStateT c m a Source #

(Monad m, ContainsType a c) => MonadMultiGet a (MultiStateT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiState.Lazy

Methods

mGet :: MultiStateT c m a Source #

(Monad m, ContainsType a c) => MonadMultiGet a (MultiReaderT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiReader.Strict

Methods

mGet :: MultiReaderT c m a Source #

(Monad m, ContainsType a c) => MonadMultiGet a (MultiReaderT c m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiReader.Lazy

Methods

mGet :: MultiReaderT c m a Source #

(Monad m, HListMContains GettableFlag a cts) => MonadMultiGet a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Strict

Methods

mGet :: MultiGSTT cts m a Source #

(Monad m, HListMContains GettableFlag a cts) => MonadMultiGet a (MultiGSTT cts m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiGST.Lazy

Methods

mGet :: MultiGSTT cts m a Source #

(Monad m, ContainsType a s) => MonadMultiGet a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Strict

Methods

mGet :: MultiRWST r w s m a Source #

(Monad m, ContainsType a s) => MonadMultiGet a (MultiRWST r w s m) Source # 
Instance details

Defined in Control.Monad.Trans.MultiRWS.Lazy

Methods

mGet :: MultiRWST r w s m a Source #

data CanReadWrite a Source #

Constructors

Gettable a 
Settable a 
Tellable a 

run-functions (extracting from RWST)

runMultiGSTTNil :: Monad m => MultiGSTT '[] m a -> m a Source #

runMultiGSTTNil_ :: Monad m => MultiGSTT '[] m a -> m () Source #

with-functions (extending an RWST)

withReader :: Monad m => t -> MultiGSTT (Gettable t ': tr) m a -> MultiGSTT tr m a Source #

withReader_ :: Monad m => t -> MultiGSTT (Gettable t ': tr) m a -> MultiGSTT tr m () Source #

withReaders :: Monad m => HList rs -> MultiGSTT (AppendM (HListMReaders rs) ts) m a -> MultiGSTT ts m a Source #

withWriter :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (a, t) Source #

withWriterAW :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (a, t) Source #

withWriterWA :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m (t, a) Source #

withWriterW :: (Monoid t, Monad m) => MultiGSTT (Tellable t ': tr) m a -> MultiGSTT tr m t Source #

withState :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (a, t) Source #

withStateAS :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (a, t) Source #

withStateSA :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m (t, a) Source #

withStateA :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m a Source #

withStateS :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m t Source #

withState_ :: Monad m => t -> MultiGSTT (Settable t ': tr) m a -> MultiGSTT tr m () Source #

without-functions (reducing an RWST; inverse of with)

without :: Monad m => MultiGSTT tr m a -> MultiGSTT (ct ': tr) m a Source #

other functions

mapMultiGSTT :: ts ~ HListM cts => (m (a, ts) -> m' (a', ts)) -> MultiGSTT cts m a -> MultiGSTT cts m' a' Source #

mGetRawR :: (Monad m, HListMGettableClass ts) => MultiGSTT ts m (HList (HListMGettableOnly ts)) Source #

mSetRaw :: Monad m => HListM ts -> MultiGSTT ts m () Source #

mGetRaw :: Monad m => MultiGSTT ts m (HListM ts) Source #