conduit-1.0.13: Streaming data processing library.

Safe Haskell | None

Data.Conduit.Util

Contents

- Misc

Description

Various utility functions versions of `conduit`.

Synopsis

- zip :: Monad m => Source m a -> Source m b -> Source m (a, b)
- zipSources :: Monad m => Source m a -> Source m b -> Source m (a, b)
- zipSinks :: Monad m => Sink i m r -> Sink i m r' -> Sink i m (r, r')
- passthroughSink :: Monad m => Sink i m r -> (r -> m ()) -> Conduit i m i

# Misc

zip :: Monad m => Source m a -> Source m b -> Source m (a, b)Source

Deprecated: Use zipSources instead

Deprecated synonym for `zipSources`.

Since 0.3.0

zipSources :: Monad m => Source m a -> Source m b -> Source m (a, b)Source

Combines two sources. The new source will stop producing once either source has been exhausted.

Since 1.0.13

zipSinks :: Monad m => Sink i m r -> Sink i m r' -> Sink i m (r, r')Source

Combines two sinks. The new sink will complete when both input sinks have completed.

Any leftovers are discarded.

Since 0.4.1

passthroughSink Source

Arguments

:: Monad m |
=> Sink i m r |
-> (r -> m ()) | finalizer
-> Conduit i m i |

Turn a `Sink` into a `Conduit` in the following way:

- All input passed to the `Sink` is yielded downstream.
- When the `Sink` finishes processing, the result is passed to the provided to the finalizer function.

Note that the `Sink` will stop receiving input as soon as the downstream it is connected to shuts down.

An example usage would be to write the result of a `Sink` to some mutable variable while allowing other processing to continue.

Since 1.0.10