on master help sign in
Rename serial_ to split_
eecc006Adithya Kumar
benchmark/Streamly/Benchmark/Data/Fold.hs+5−5
@@ -126,11 +126,11 @@ splitAllAny value =
126 (FL.any (> value))
126 (FL.any (> value))
127 )
127 )
128
128
129−{-# INLINE serial_ #-}
129+{-# INLINE split_ #-}
130−serial_ :: Monad m => Int -> Stream m Int -> m Bool
130+split_ :: Monad m => Int -> Stream m Int -> m Bool
131−serial_ value =
131+split_ value =
132 Stream.fold
132 Stream.fold
133− (FL.serial_
133+ (FL.split_
134 (FL.all (<= (value `div` 2)))
134 (FL.all (<= (value `div` 2)))
135 (FL.any (> value))
135 (FL.any (> value))
136 )
136 )
@@ -400,7 +400,7 @@ o_1_space_serial_composition value =
400 , benchIOSink value "scanMaybe even, odd" $ scanMaybe2 value
400 , benchIOSink value "scanMaybe even, odd" $ scanMaybe2 value
401 , benchIOSink value "foldBreak (recursive)" foldBreak
401 , benchIOSink value "foldBreak (recursive)" foldBreak
402 , benchIOSink value "splitWith (all, any)" $ splitAllAny value
402 , benchIOSink value "splitWith (all, any)" $ splitAllAny value
403− , benchIOSink value "serial_ (all, any)" $ serial_ value
403+ , benchIOSink value "split_ (all, any)" $ split_ value
404 , benchIOSink value "tee (all, any)" $ teeAllAny value
404 , benchIOSink value "tee (all, any)" $ teeAllAny value
405 , benchIOSink value "many drain (take 1)" many
405 , benchIOSink value "many drain (take 1)" many
406 , bench "unfoldMany" $ unfoldMany value
406 , bench "unfoldMany" $ unfoldMany value
core/src/Streamly/Internal/Data/Array/Fold.hs+4−4
@@ -245,10 +245,10 @@ fromEffect = ArrayFold . ParserD.fromEffect
245-- results using the supplied function.
245-- results using the supplied function.
246--
246--
247-- /Pre-release/
247-- /Pre-release/
248−{-# INLINE serial_ #-}
248+{-# INLINE split_ #-}
249−serial_ :: MonadThrow m =>
249+split_ :: MonadThrow m =>
250 ArrayFold m x a -> ArrayFold m x b -> ArrayFold m x b
250 ArrayFold m x a -> ArrayFold m x b -> ArrayFold m x b
251−serial_ (ArrayFold p1) (ArrayFold p2) =
251+split_ (ArrayFold p1) (ArrayFold p2) =
252 ArrayFold $ ParserD.noErrorUnsafeSplit_ p1 p2
252 ArrayFold $ ParserD.noErrorUnsafeSplit_ p1 p2
253
253
254-- | Applies two folds sequentially on the input stream and combines their
254-- | Applies two folds sequentially on the input stream and combines their
@@ -271,7 +271,7 @@ instance MonadThrow m => Applicative (ArrayFold m a) where
271 (<*>) = splitWith id
271 (<*>) = splitWith id
272
272
273 {-# INLINE (*>) #-}
273 {-# INLINE (*>) #-}
274− (*>) = serial_
274+ (*>) = split_
275
275
276 {-# INLINE liftA2 #-}
276 {-# INLINE liftA2 #-}
277 liftA2 f x = (<*>) (fmap f x)
277 liftA2 f x = (<*>) (fmap f x)
core/src/Streamly/Internal/Data/Fold.hs+1−1
@@ -238,7 +238,7 @@ module Streamly.Internal.Data.Fold
238
238
239 -- ** Serial Append
239 -- ** Serial Append
240 , splitWith
240 , splitWith
241− , serial_
241+ , split_
242 -- , tail
242 -- , tail
243 -- , init
243 -- , init
244 , splitAt -- spanN
244 , splitAt -- spanN
core/src/Streamly/Internal/Data/Fold/Type.hs+4−4
@@ -376,7 +376,7 @@ module Streamly.Internal.Data.Fold.Type
376
376
377 -- ** Sequential application
377 -- ** Sequential application
378 , splitWith -- rename to "append"
378 , splitWith -- rename to "append"
379− , serial_
379+ , split_
380
380
381 -- ** Repeated Application (Splitting)
381 -- ** Repeated Application (Splitting)
382 , ManyState
382 , ManyState
@@ -813,9 +813,9 @@ data SeqFoldState_ sl sr = SeqFoldL_ !sl | SeqFoldR_ !sr
813-- using splitWith, but the current benchmarks show that it has the same
813-- using splitWith, but the current benchmarks show that it has the same
814-- performance. So do not expose it unless some benchmark shows benefit.
814-- performance. So do not expose it unless some benchmark shows benefit.
815--
815--
816−{-# INLINE serial_ #-}
816+{-# INLINE split_ #-}
817−serial_ :: Monad m => Fold m x a -> Fold m x b -> Fold m x b
817+split_ :: Monad m => Fold m x a -> Fold m x b -> Fold m x b
818−serial_ (Fold stepL initialL _) (Fold stepR initialR extractR) =
818+split_ (Fold stepL initialL _) (Fold stepR initialR extractR) =
819 Fold step initial extract
819 Fold step initial extract
820
820
821 where
821 where