@@ -215,7 +215,7 @@ o_1_space_reduce_toBytes env =
215215
216216chunksOfSum :: Int -> Handle -> IO Int
217217chunksOfSum n inh =
218− S.fold Fold.length $ IP.chunksOf n FL.sum (S.unfold FH.reader inh)
218+ S.fold Fold.length $ IP.groupsOf n FL.sum (S.unfold FH.reader inh)
219219
220220foldManyPostChunksOfSum :: Int -> Handle -> IO Int
221221foldManyPostChunksOfSum n inh =
@@ -231,20 +231,20 @@ foldManyChunksOfSum n inh =
231231-- Even though allocations remain the same in both cases inlining improves time
232232-- by 4x.
233233-- | Slice in chunks of size n and get the count of chunks.
234−{-# INLINE chunksOf #-}
235−chunksOf :: Int -> Handle -> IO Int
236−chunksOf n inh =
234+{-# INLINE groupsOf #-}
235+groupsOf :: Int -> Handle -> IO Int
236+groupsOf n inh =
237237 -- writeNUnsafe gives 2.5x boost here over writeN.
238238 S.fold Fold.length
239− $ IP.chunksOf n (AT.writeNUnsafe n) (S.unfold FH.reader inh)
239+ $ IP.groupsOf n (AT.writeNUnsafe n) (S.unfold FH.reader inh)
240240
241241#ifdef INSPECTION
242−inspect $ hasNoTypeClasses 'chunksOf
243−inspect $ 'chunksOf `hasNoType` ''Step
244−inspect $ 'chunksOf `hasNoType` ''FoldMany
245−inspect $ 'chunksOf `hasNoType` ''AT.ArrayUnsafe -- AT.writeNUnsafe
242+inspect $ hasNoTypeClasses 'groupsOf
243+inspect $ 'groupsOf `hasNoType` ''Step
244+inspect $ 'groupsOf `hasNoType` ''FoldMany
245+inspect $ 'groupsOf `hasNoType` ''AT.ArrayUnsafe -- AT.writeNUnsafe
246246 -- FH.read/A.read
247−inspect $ 'chunksOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
247+inspect $ 'groupsOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
248248#endif
249249
250250{-# INLINE arraysOf #-}
@@ -255,10 +255,10 @@ arraysOf n inh =
255255o_1_space_reduce_read_grouped :: BenchEnv -> [Benchmark]
256256o_1_space_reduce_read_grouped env =
257257 [ bgroup "reduce/read/chunks"
258− [ mkBench ("S.chunksOf " ++ show (bigSize env) ++ " FL.sum") env $
258+ [ mkBench ("S.groupsOf " ++ show (bigSize env) ++ " FL.sum") env $
259259 \inh _ ->
260260 chunksOfSum (bigSize env) inh
261− , mkBench "S.chunksOf 1 FL.sum" env $ \inh _ ->
261+ , mkBench "S.groupsOf 1 FL.sum" env $ \inh _ ->
262262 chunksOfSum 1 inh
263263
264264 -- XXX investigate why we need inline/noinline in these cases (GHC)
@@ -281,14 +281,14 @@ o_1_space_reduce_read_grouped env =
281281 $ \inh _ -> inline foldManyChunksOfSum 1 inh
282282
283283 -- folding chunks to arrays
284− , mkBenchSmall "S.chunksOf 1" env $ \inh _ ->
285− chunksOf 1 inh
286− , mkBench "S.chunksOf 10" env $ \inh _ ->
287− chunksOf 10 inh
288− , mkBench "S.chunksOf 1000" env $ \inh _ ->
289− chunksOf 1000 inh
290−
291− -- arraysOf may use a different impl than chunksOf
284+ , mkBenchSmall "S.groupsOf 1" env $ \inh _ ->
285+ groupsOf 1 inh
286+ , mkBench "S.groupsOf 10" env $ \inh _ ->
287+ groupsOf 10 inh
288+ , mkBench "S.groupsOf 1000" env $ \inh _ ->
289+ groupsOf 1000 inh
290+
291+ -- arraysOf may use a different impl than groupsOf
292292 , mkBenchSmall "S.arraysOf 1" env $ \inh _ ->
293293 arraysOf 1 inh
294294 , mkBench "S.arraysOf 10" env $ \inh _ ->