on master help sign in
Expose tapAsync via internal module
commit7e853fa1a7f97f7714c221a5d933eb5c707c8f1e authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 6 Aug 2019, 08:41 (7 years ago) parent72177d0
3 files changed+9−6
src/Streamly/Internal.hs+4 src/Streamly/Prelude.hs−1 src/Streamly/Streams/Parallel.hs+5−5
src/Streamly/Internal.hs+4
@@ -15,8 +15,12 @@
1515module Streamly.Internal
1616 ( Fold (..)
1717 , inspectMode
18+
19+ -- * Streamly.Prelude
20+ , tapAsync
1821 )
1922where
2023
2124import Streamly.Fold.Types (Fold(..))
2225import Streamly.Streams.Combinators (inspectMode)
26+import Streamly.Streams.Parallel (tapAsync)
src/Streamly/Prelude.hs−1
@@ -537,7 +537,6 @@ module Streamly.Prelude
537537 -- ** Distributing
538538 , trace
539539 , tap
540− , Par.tee
541540
542541 {-
543542 -- * Windowed Classification
src/Streamly/Streams/Parallel.hs+5−5
@@ -25,7 +25,7 @@ module Streamly.Streams.Parallel
2525 , parallel
2626 , parallelEndByFirst
2727 , parallelEndByAny
28− , tee
28+ , tapAsync
2929
3030 -- * Function application
3131 , mkParallel
@@ -267,7 +267,7 @@ handleChildException _sv e = do
267267-- @
268268--
269269-- @
270−-- > S.drain $ S.tee (S.mapM_ print) (S.enumerateFromTo 1 2)
270+-- > S.drain $ S.tapAsync (S.mapM_ print) (S.enumerateFromTo 1 2)
271271-- 1
272272-- 2
273273-- @
@@ -282,9 +282,9 @@ handleChildException _sv e = do
282282-- Compare with 'tap'.
283283--
284284-- @since 0.7.0
285−{-# INLINE tee #-}
286−tee :: (IsStream t, MonadAsync m) => (t m a -> m b) -> t m a -> t m a
287−tee f m = mkStream $ \st yld sng stp -> do
285+{-# INLINE tapAsync #-}
286+tapAsync :: (IsStream t, MonadAsync m) => (t m a -> m b) -> t m a -> t m a
287+tapAsync f m = mkStream $ \st yld sng stp -> do
288288 -- Buffer size for the SVar is derived from the current state
289289 sv <- newParallelVar StopNone (adaptState st)
290290 -- XXX exception handling