@@ -21,16 +21,25 @@
22module Streamly.Internal.Data.Stream.Parallel
22module Streamly.Internal.Data.Stream.Parallel
24+ -- * Parallel Stream Type
25 , Parallel
26 , Parallel
26 , parallely
27 , parallely
29+ -- * Merge Concurrently
27 , parallel
30 , parallel
28 , parallelFst
31 , parallelFst
29 , parallelMin
32 , parallelMin
34+ -- * Evaluate Concurrently
31 , mkParallel
35 , mkParallel
32 , applyParallel
36 , applyParallel
33 , foldParallel
37 , foldParallel
39+ -- * Tap Concurrently
@@ -386,6 +395,22 @@ tapAsync f m = mkStream $ \st yld sng stp -> do
386 sv <- newFoldSVar st f
395 sv <- newFoldSVar st f
387 foldStreamShared st yld sng stp (teeToSVar sv m)
396 foldStreamShared st yld sng stp (teeToSVar sv m)
398+-- | Concurrently distribute a stream to a collection of fold functions,
399+-- discarding the outputs of the folds.
401+-- >>> S.drain $ distributeAsync_ [S.mapM_ print, S.mapM_ print] (S.enumerateFromTo 1 2)
404+-- distributeAsync_ = flip (foldr tapAsync)
409+{-# INLINE distributeAsync_ #-}
410+distributeAsync_ :: (Foldable f, IsStream t, MonadAsync m)
411+ => f (t m a -> m b) -> t m a -> t m a
412+distributeAsync_ = flip (foldr tapAsync)
389------------------------------------------------------------------------------
414------------------------------------------------------------------------------
390-- ParallelT
415-- ParallelT
391------------------------------------------------------------------------------
416------------------------------------------------------------------------------