Filter Modules

hoist :: (Monad m, Monad n) => (forall x. m x -> n x) -> SerialT m a -> SerialT n a Source #

Transform the inner monad of a stream using a natural transformation.

* Internal*

generally :: (IsStream t, Monad m) => t Identity a -> t m a Source #

Generalize the inner monad of the stream from `Identity`

to any monad.

* Internal*

liftInner :: (Monad m, IsStream t, MonadTrans tr, Monad (tr m)) => t m a -> t (tr m) a Source #

Lift the inner monad `m`

of a stream `t m a`

to `tr m`

using the monad
transformer `tr`

.

*Since: 0.8.0*

usingReaderT :: (Monad m, IsStream t) => m r -> (t (ReaderT r m) a -> t (ReaderT r m) a) -> t m a -> t m a Source #

runReaderT :: (IsStream t, Monad m) => m s -> t (ReaderT s m) a -> t m a Source #

Evaluate the inner monad of a stream as `ReaderT`

.

*Since: 0.8.0*

usingStateT :: Monad m => m s -> (SerialT (StateT s m) a -> SerialT (StateT s m) a) -> SerialT m a -> SerialT m a Source #

Run a stateful (StateT) stream transformation using a given state.

This is supported only for `SerialT`

as concurrent state updation may not be
safe.

usingStateT s f = evalStateT s . f . liftInner

See also: `scanl'`

* Internal*

streamly-0.8.0**Streamly.Internal.Data.Stream.IsStream.Lift**