hw-conduit-0.2.0.6: Conduits for tokenizing streams.

Safe HaskellNone
LanguageHaskell2010

HaskellWorks.Data.Conduit.Combinator

Synopsis

Documentation

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

Run the provided conduit in the Just case

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

Run the provided conduit in the Just case

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

Run the provided conduit in the Just case

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

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

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

Run the conduit on the right side of the either

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

Run the conduit on the left side of the either

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

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

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

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

mvarWriteC :: MonadIO m => MVar a -> ConduitT a Void m () Source #

Sink that writes the message to an mvar

mvarWriteMC :: MonadIO m => (a -> b) -> MVar b -> ConduitT a Void m () Source #

Sink that writes the message to an mvar

mvarWriteSink :: MonadIO m => MVar a -> ConduitT a Void m () Source #

Sink that writes the message to an mvar

sinkWithPred :: Monad m => (a -> Bool) -> ConduitT a Void m () -> ConduitT a Void m () -> ConduitT a Void 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 => ConduitT (Maybe a) () m () Source #

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

projectLefts :: Monad m => ConduitT (Either l r) l m () 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 => ConduitT (Either l r) r m () 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 -> ConduitT a a m () Source #

Propagate every N messages and drop all others.

onEveryN :: Monad m => Int -> (a -> m b) -> ConduitT a a m () Source #

Performs an action every N messages, but ignores its result. All original values are propagted downstream.

onEveryN' :: Monad m => Int -> m b -> ConduitT a a m () Source #

Performs an action every N messages, but ignores its result. All original values are propagted downstream.

everyNSeconds :: MonadIO m => Int -> ConduitT a a m () Source #

Propagate a message every N seconds and drop all others.

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

Deprecated: Use effectC instead

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

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

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

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

Deprecated: Use justC instead

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

Sinks values into a given MVar.

tapWith :: Monad m => ConduitT a b m () -> ConduitT b Void m () -> ConduitT a a m () 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 => ConduitT a Void m () -> ConduitT a a m () Source #

Deprecated: Unsafe. Do not use

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

tapPred :: Monad m => (a -> Bool) -> ConduitT a Void m () -> ConduitT a Void m () -> ConduitT a a m () Source #

Deprecated: Unsafe. Do not use

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

tapNothing :: Monad m => ConduitT () Void m () -> ConduitT (Maybe a) (Maybe a) m () 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 => ConduitT () Void m () -> ConduitT (Maybe a) a m () 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 => ConduitT l Void m () -> ConduitT (Either l r) (Either l r) m () 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 => ConduitT l Void m () -> ConduitT (Either l r) r m () 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 => ConduitT r Void m () -> ConduitT (Either l r) (Either l r) m () 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 => ConduitT r Void m () -> ConduitT (Either l r) l m () Source #

Deprecated: Unsafe. Do not use

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