on master help sign in
Rename merge to tee
98d2256Harendra Kumar
benchmark/Linear.hs+2−2
@@ -246,13 +246,13 @@ main =
246 , bgroup "pipes"
246 , bgroup "pipes"
247 [ benchIOSink "mapM" (Ops.transformMapM serially 1)
247 [ benchIOSink "mapM" (Ops.transformMapM serially 1)
248 , benchIOSink "compose" (Ops.transformComposeMapM serially 1)
248 , benchIOSink "compose" (Ops.transformComposeMapM serially 1)
249− , benchIOSink "merge" (Ops.transformMergeMapM serially 1)
249+ , benchIOSink "tee" (Ops.transformTeeMapM serially 1)
250 , benchIOSink "zip" (Ops.transformZipMapM serially 1)
250 , benchIOSink "zip" (Ops.transformZipMapM serially 1)
251 ]
251 ]
252 , bgroup "pipesX4"
252 , bgroup "pipesX4"
253 [ benchIOSink "mapM" (Ops.transformMapM serially 4)
253 [ benchIOSink "mapM" (Ops.transformMapM serially 4)
254 , benchIOSink "compose" (Ops.transformComposeMapM serially 4)
254 , benchIOSink "compose" (Ops.transformComposeMapM serially 4)
255− , benchIOSink "merge" (Ops.transformMergeMapM serially 4)
255+ , benchIOSink "tee" (Ops.transformTeeMapM serially 4)
256 , benchIOSink "zip" (Ops.transformZipMapM serially 4)
256 , benchIOSink "zip" (Ops.transformZipMapM serially 4)
257 ]
257 ]
258 , bgroup "transformation"
258 , bgroup "transformation"
benchmark/LinearOps.hs+4−4
@@ -362,11 +362,11 @@ mapMaybeM :: S.MonadAsync m => Int -> Stream m Int -> m ()
362{-# INLINE mapM #-}
362{-# INLINE mapM #-}
363{-# INLINE transformMapM #-}
363{-# INLINE transformMapM #-}
364{-# INLINE transformComposeMapM #-}
364{-# INLINE transformComposeMapM #-}
365−{-# INLINE transformMergeMapM #-}
365+{-# INLINE transformTeeMapM #-}
366{-# INLINE transformZipMapM #-}
366{-# INLINE transformZipMapM #-}
367{-# INLINE map' #-}
367{-# INLINE map' #-}
368{-# INLINE fmap' #-}
368{-# INLINE fmap' #-}
369−mapM, map', transformMapM, transformComposeMapM, transformMergeMapM,
369+mapM, map', transformMapM, transformComposeMapM, transformTeeMapM,
370 transformZipMapM :: (S.IsStream t, S.MonadAsync m)
370 transformZipMapM :: (S.IsStream t, S.MonadAsync m)
371 => (t m Int -> S.SerialT m Int) -> Int -> t m Int -> m ()
371 => (t m Int -> S.SerialT m Int) -> Int -> t m Int -> m ()
372
372
@@ -389,9 +389,9 @@ transformMapM t n = composeN' n $ t . S.transform (Pipe.mapM return)
389transformComposeMapM t n = composeN' n $ t . S.transform
389transformComposeMapM t n = composeN' n $ t . S.transform
390 (Pipe.mapM (\x -> return (x + 1))
390 (Pipe.mapM (\x -> return (x + 1))
391 `Pipe.compose` Pipe.mapM (\x -> return (x + 2)))
391 `Pipe.compose` Pipe.mapM (\x -> return (x + 2)))
392−transformMergeMapM t n = composeN' n $ t . S.transform
392+transformTeeMapM t n = composeN' n $ t . S.transform
393 (Pipe.mapM (\x -> return (x + 1))
393 (Pipe.mapM (\x -> return (x + 1))
394− `Pipe.merge` Pipe.mapM (\x -> return (x + 2)))
394+ `Pipe.tee` Pipe.mapM (\x -> return (x + 2)))
395transformZipMapM t n = composeN' n $ t . S.transform
395transformZipMapM t n = composeN' n $ t . S.transform
396 (Pipe.zipWith (+) (Pipe.mapM (\x -> return (x + 1)))
396 (Pipe.zipWith (+) (Pipe.mapM (\x -> return (x + 1)))
397 (Pipe.mapM (\x -> return (x + 2))))
397 (Pipe.mapM (\x -> return (x + 2))))
src/Streamly/Pipe.hs+2−2
@@ -121,7 +121,7 @@ module Streamly.Pipe
121 -}
121 -}
122
122
123 -- * Composing Pipes
123 -- * Composing Pipes
124− , merge
124+ , tee
125 , zipWith
125 , zipWith
126 , compose
126 , compose
127
127
@@ -253,7 +253,7 @@ import Prelude
253-- import Streamly (MonadAsync, parallel)
253-- import Streamly (MonadAsync, parallel)
254-- import Streamly.Fold.Types (Fold(..))
254-- import Streamly.Fold.Types (Fold(..))
255import Streamly.Pipe.Types
255import Streamly.Pipe.Types
256− (Pipe(..), PipeState(..), Step(..), zipWith, merge, map, compose)
256+ (Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
257-- import Streamly.Mem.Array.Types (Array)
257-- import Streamly.Mem.Array.Types (Array)
258-- import Streamly.Mem.Ring (Ring)
258-- import Streamly.Mem.Ring (Ring)
259-- import Streamly.Streams.Serial (SerialT)
259-- import Streamly.Streams.Serial (SerialT)
src/Streamly/Pipe/Types.hs+5−5
@@ -16,7 +16,7 @@ module Streamly.Pipe.Types
16 , Pipe (..)
16 , Pipe (..)
17 , PipeState (..)
17 , PipeState (..)
18 , zipWith
18 , zipWith
19− , merge
19+ , tee
20 , map
20 , map
21 , compose
21 , compose
22 )
22 )
@@ -259,9 +259,9 @@ instance Monad m => Applicative (Pipe m a) where
259-- merges the outputs of the two.
259-- merges the outputs of the two.
260--
260--
261-- @since 0.7.0
261-- @since 0.7.0
262−{-# INLINE_NORMAL merge #-}
262+{-# INLINE_NORMAL tee #-}
263−merge :: Monad m => Pipe m a b -> Pipe m a b -> Pipe m a b
263+tee :: Monad m => Pipe m a b -> Pipe m a b -> Pipe m a b
264−merge (Pipe consumeL produceL stateL) (Pipe consumeR produceR stateR) =
264+tee (Pipe consumeL produceL stateL) (Pipe consumeR produceR stateR) =
265 Pipe consume produce state
265 Pipe consume produce state
266 where
266 where
267
267
@@ -324,7 +324,7 @@ merge (Pipe consumeL produceL stateL) (Pipe consumeR produceR stateR) =
324
324
325instance Monad m => Semigroup (Pipe m a b) where
325instance Monad m => Semigroup (Pipe m a b) where
326 {-# INLINE (<>) #-}
326 {-# INLINE (<>) #-}
327− (<>) = merge
327+ (<>) = tee
328
328
329-- | Lift a pure function to a 'Pipe'.
329-- | Lift a pure function to a 'Pipe'.
330--
330--