| Safe Haskell | None |
|---|
Data.Conduit.Extra.ZipSink
- newtype ZipSink i m r = ZipSink {
- getZipSink :: Sink i m r
- broadcast :: (Traversable f, Monad m) => f (Sink i m r) -> Sink i m (f r)
Documentation
A wrapper for defining an Applicative instance for Sinks which allows
to combine sinks together, generalizing zipSinks. A combined sink
distributes the input to all its participants and when all finish, produces
the result. This allows to define functions like
broadcast :: (Monad m)
=> [Sink i m r] -> Sink i m [r]
broadcast = getZipSink . sequenceA . fmap ZipSink
Note that the standard Applicative instance for conduits works
differently. It feeds one sink with input until it finishes, then switches
to another, etc., and at the end combines their results.
Constructors
| ZipSink | |
Fields
| |