hw-conduit-0.2.0.3: Conduits for tokenizing streams.

Synopsis

# Documentation

maybeC :: Monad m => Conduit () m () -> Conduit a m c -> Conduit (Maybe a) m (Maybe c) Source #

Run the provided conduit in the Just case

justC :: Monad m => Conduit a m c -> Conduit (Maybe a) m (Maybe c) Source #

Run the provided conduit in the Just case

nothingC :: Monad m => Conduit () m () -> Conduit (Maybe a) m (Maybe a) Source #

Run the provided conduit in the Just case

eitherC :: Monad m => Conduit l m a -> Conduit r m a -> Conduit (Either l r) m a Source #

Run the provided conduits on the left and right side of the either respectively

rightC :: Monad m => Conduit r m a -> Conduit (Either l r) m (Either l a) Source #

Run the conduit on the right side of the either

leftC :: Monad m => Conduit l m a -> Conduit (Either l r) m (Either a r) Source #

Run the conduit on the left side of the either

effectC :: Monad m => (a -> m b) -> Conduit a m a Source #

Performs the effect but ignores its result. The original value is propagated downstream.

effectC' :: Monad m => m b -> Conduit a m a Source #

Performs the effect but ignores its result. The original value is propagated downstream.

sinkWithPred :: Monad m => (a -> Bool) -> Sink a m () -> Sink a m () -> Sink a m () Source #

Creates a unified sink, which is actually two separate sinks with results being sent to one or the other based on a predicate.

projectNothings :: Monad m => Conduit (Maybe a) m () Source #

Projects nothings from the stream. Returns a stream that only contains nothings (represented by unit)

projectLefts :: Monad m => Conduit (Either l r) m l Source #

Projects left side values for each value in a stream. Downstream only receives values that were on the left side, the right side is ignored.

projectRights :: Monad m => Conduit (Either l r) m r Source #

Projects right side values for each value in a stream. Downstream only receives values that were on the right side, the left side is ignored.

everyN :: Monad m => Int -> Conduit a m a Source #

Propagate every N messages and drop all others.

everyNSeconds :: MonadIO m => Int -> Conduit a m a Source #

Propagate a message every N seconds and drop all others.

effect :: Monad m => (a -> m b) -> Conduit a m a Source #

Performs the effect but ignores its result. The original value is propagated downstream.

effect' :: Monad m => m b -> Conduit a m a Source #

Performs the effect but ignores its result. The original value is propagated downstream.

inJust :: Monad m => Conduit a m c -> Conduit (Maybe a) m (Maybe c) Source #

mvarSink :: MonadIO m => MVar a -> Sink a m () Source #

Sinks values into a given MVar.

tapWith :: Monad m => Conduit a m b -> Sink b m () -> Conduit a m a Source #

Deprecated: Unsafe. Do not use

Taps the stream by applying a transformation and sending the transformed value into a given sink. The original value is then propagated downstream.

tapWith projectLefts myErrorSink

tap :: Monad m => Sink a m () -> Conduit a m a Source #

Deprecated: Unsafe. Do not use

Taps into a given sink. The original value is then propagated downstream.

tapPred :: Monad m => (a -> Bool) -> Sink a m () -> Sink a m () -> Conduit a m a Source #

Deprecated: Unsafe. Do not use

Taps a conduit, and sends the results into two different sinks, switching on a predicate.

tapNothing :: Monad m => Sink () m () -> Conduit (Maybe a) m (Maybe a) Source #

Deprecated: Unsafe. Do not use

For every Nothing value in a stream sends () to a given Sink. Downstream receives an untouched original Maybe value.

divertNothing :: Monad m => Sink () m () -> Conduit (Maybe a) m a Source #

Deprecated: Unsafe. Do not use

For every Nothing value in a stream sends () to a given Sink. Nothing is then not propagated downstream. Downstream only receives values from Just

tapLeft :: Monad m => Sink l m () -> Conduit (Either l r) m (Either l r) Source #

Deprecated: Unsafe. Do not use

Sends every left-side value in a stream into a given Sink. Downstream receives the original Either value untouched.

divertLeft :: Monad m => Sink l m () -> Conduit (Either l r) m r Source #

Deprecated: Unsafe. Do not use

Sends every left-side value in a stream into a given Sink. Downstream receives only right-side values.

tapRight :: Monad m => Sink r m () -> Conduit (Either l r) m (Either l r) Source #

Deprecated: Unsafe. Do not use

Sends every right-side value in a stream into a given Sink. Downstream receives the original Either value untouched.

divertRight :: Monad m => Sink r m () -> Conduit (Either l r) m l Source #

Deprecated: Unsafe. Do not use

Sends every right-side value in a stream into a given Sink. Downstream receives only left-side values.