on master help sign in
Rename serial_ to split_
commiteecc006bdc0908d59e79cda8baa8a23a3ef20fe0 authorAdithya Kumar <adithya@composewell.com> dateFri 4 Nov 2022, 15:07 (4 years ago) parent0d3c63a
4 files changed+14−14
benchmark/Streamly/Benchmark/Data/Fold.hs+5−5 core/src/Streamly/Internal/Data/Array/Fold.hs+4−4 core/src/Streamly/Internal/Data/Fold.hs+1−1 core/src/Streamly/Internal/Data/Fold/Type.hs+4−4
benchmark/Streamly/Benchmark/Data/Fold.hs+5−5
@@ -126,11 +126,11 @@ splitAllAny value =
126126 (FL.any (> value))
127127 )
128128
129−{-# INLINE serial_ #-}
130−serial_ :: Monad m => Int -> Stream m Int -> m Bool
131−serial_ value =
129+{-# INLINE split_ #-}
130+split_ :: Monad m => Int -> Stream m Int -> m Bool
131+split_ value =
132132 Stream.fold
133− (FL.serial_
133+ (FL.split_
134134 (FL.all (<= (value `div` 2)))
135135 (FL.any (> value))
136136 )
@@ -400,7 +400,7 @@ o_1_space_serial_composition value =
400400 , benchIOSink value "scanMaybe even, odd" $ scanMaybe2 value
401401 , benchIOSink value "foldBreak (recursive)" foldBreak
402402 , benchIOSink value "splitWith (all, any)" $ splitAllAny value
403− , benchIOSink value "serial_ (all, any)" $ serial_ value
403+ , benchIOSink value "split_ (all, any)" $ split_ value
404404 , benchIOSink value "tee (all, any)" $ teeAllAny value
405405 , benchIOSink value "many drain (take 1)" many
406406 , bench "unfoldMany" $ unfoldMany value
core/src/Streamly/Internal/Data/Array/Fold.hs+4−4
@@ -245,10 +245,10 @@ fromEffect = ArrayFold . ParserD.fromEffect
245245-- results using the supplied function.
246246--
247247-- /Pre-release/
248−{-# INLINE serial_ #-}
249−serial_ :: MonadThrow m =>
248+{-# INLINE split_ #-}
249+split_ :: MonadThrow m =>
250250 ArrayFold m x a -> ArrayFold m x b -> ArrayFold m x b
251−serial_ (ArrayFold p1) (ArrayFold p2) =
251+split_ (ArrayFold p1) (ArrayFold p2) =
252252 ArrayFold $ ParserD.noErrorUnsafeSplit_ p1 p2
253253
254254-- | Applies two folds sequentially on the input stream and combines their
@@ -271,7 +271,7 @@ instance MonadThrow m => Applicative (ArrayFold m a) where
271271 (<*>) = splitWith id
272272
273273 {-# INLINE (*>) #-}
274− (*>) = serial_
274+ (*>) = split_
275275
276276 {-# INLINE liftA2 #-}
277277 liftA2 f x = (<*>) (fmap f x)
core/src/Streamly/Internal/Data/Fold.hs+1−1
@@ -238,7 +238,7 @@ module Streamly.Internal.Data.Fold
238238
239239 -- ** Serial Append
240240 , splitWith
241− , serial_
241+ , split_
242242 -- , tail
243243 -- , init
244244 , splitAt -- spanN
core/src/Streamly/Internal/Data/Fold/Type.hs+4−4
@@ -376,7 +376,7 @@ module Streamly.Internal.Data.Fold.Type
376376
377377 -- ** Sequential application
378378 , splitWith -- rename to "append"
379− , serial_
379+ , split_
380380
381381 -- ** Repeated Application (Splitting)
382382 , ManyState
@@ -813,9 +813,9 @@ data SeqFoldState_ sl sr = SeqFoldL_ !sl | SeqFoldR_ !sr
813813-- using splitWith, but the current benchmarks show that it has the same
814814-- performance. So do not expose it unless some benchmark shows benefit.
815815--
816−{-# INLINE serial_ #-}
817−serial_ :: Monad m => Fold m x a -> Fold m x b -> Fold m x b
818−serial_ (Fold stepL initialL _) (Fold stepR initialR extractR) =
816+{-# INLINE split_ #-}
817+split_ :: Monad m => Fold m x a -> Fold m x b -> Fold m x b
818+split_ (Fold stepL initialL _) (Fold stepR initialR extractR) =
819819 Fold step initial extract
820820
821821 where