Safe Haskell | None |
---|
- 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
newtype ZipSink i m r
A wrapper for defining an Applicative
instance for Sink
s 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
sequenceSinks :: (Monad m) => [Sink i m r] -> Sink i m [r] sequenceSinks = 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.
Since 1.0.13
ZipSink | |
|