yield-0.0.0.0: YieldT monad transformer
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Monad.Trans.Yield

Synopsis

Documentation

data YieldT a m r Source #

Monad transformer that adds dynamically interpretable MonadYield support

Instances

Instances details
MonadReader r m => MonadReader r (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

ask :: YieldT a m r #

local :: (r -> r) -> YieldT a m a0 -> YieldT a m a0 #

reader :: (r -> a0) -> YieldT a m a0 #

MonadState s m => MonadState s (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

get :: YieldT a m s #

put :: s -> YieldT a m () #

state :: (s -> (a0, s)) -> YieldT a m a0 #

Functor m => MonadYield a (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

yield :: a -> YieldT a m () Source #

MonadTrans (YieldT a) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

lift :: Monad m => m a0 -> YieldT a m a0 #

MonadIO m => MonadIO (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

liftIO :: IO a0 -> YieldT a m a0 #

Applicative (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

pure :: a0 -> YieldT a m a0 #

(<*>) :: YieldT a m (a0 -> b) -> YieldT a m a0 -> YieldT a m b #

liftA2 :: (a0 -> b -> c) -> YieldT a m a0 -> YieldT a m b -> YieldT a m c #

(*>) :: YieldT a m a0 -> YieldT a m b -> YieldT a m b #

(<*) :: YieldT a m a0 -> YieldT a m b -> YieldT a m a0 #

Functor (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

fmap :: (a0 -> b) -> YieldT a m a0 -> YieldT a m b #

(<$) :: a0 -> YieldT a m b -> YieldT a m a0 #

Monad (YieldT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Yield

Methods

(>>=) :: YieldT a m a0 -> (a0 -> YieldT a m b) -> YieldT a m b #

(>>) :: YieldT a m a0 -> YieldT a m b -> YieldT a m b #

return :: a0 -> YieldT a m a0 #

runYieldT Source #

Arguments

:: forall a b m r. Monad m 
=> Aggregation m a b

What to do with the values emitted from the stream

-> YieldT a m r 
-> m (b, r)

The result of aggregating of stream values, and the result of the YieldT

Runs a YieldT computation in the base monad

hoistYieldT :: forall m n a r. Monad m => (forall x. m x -> n x) -> YieldT a m r -> YieldT a n r Source #

Transforms a YieldT's base monad actions