on master help sign in
Rename Fold.lchunksOf to Fold.chunksOf
0753435Adithya Kumar
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+1−1
@@ -85,7 +85,7 @@ inspect $ 'copyStream `hasNoType` ''Step -- S.unfold
85inspect $ 'copyStream `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
85inspect $ 'copyStream `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
86inspect $ 'copyStream `hasNoType` ''A.ReadUState -- FH.read/A.read
86inspect $ 'copyStream `hasNoType` ''A.ReadUState -- FH.read/A.read
87inspect $ 'copyStream `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
87inspect $ 'copyStream `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
88−inspect $ 'copyStream `hasNoType` ''Strict.Tuple3' -- FH.write/lchunksOf
88+inspect $ 'copyStream `hasNoType` ''Strict.Tuple3' -- FH.write/chunksOf
89#endif
89#endif
90
90
91o_1_space_copy_read :: BenchEnv -> [Benchmark]
91o_1_space_copy_read :: BenchEnv -> [Benchmark]
benchmark/Streamly/Benchmark/Unicode/Stream.hs+2−2
@@ -203,7 +203,7 @@ inspect $ 'copyStreamLatin1' `hasNoType` ''Step
203inspect $ 'copyStreamLatin1' `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
203inspect $ 'copyStreamLatin1' `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
204inspect $ 'copyStreamLatin1' `hasNoType` ''A.ReadUState -- FH.read/A.read
204inspect $ 'copyStreamLatin1' `hasNoType` ''A.ReadUState -- FH.read/A.read
205inspect $ 'copyStreamLatin1' `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
205inspect $ 'copyStreamLatin1' `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
206−inspect $ 'copyStreamLatin1' `hasNoType` ''Strict.Tuple3' -- FH.write/lchunksOf
206+inspect $ 'copyStreamLatin1' `hasNoType` ''Strict.Tuple3' -- FH.write/chunksOf
207#endif
207#endif
208
208
209-- | Copy file (encodeLatin1)
209-- | Copy file (encodeLatin1)
@@ -220,7 +220,7 @@ inspect $ 'copyStreamLatin1 `hasNoType` ''Step
220inspect $ 'copyStreamLatin1 `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
220inspect $ 'copyStreamLatin1 `hasNoType` ''IUF.ConcatState -- FH.read/UF.concat
221inspect $ 'copyStreamLatin1 `hasNoType` ''A.ReadUState -- FH.read/A.read
221inspect $ 'copyStreamLatin1 `hasNoType` ''A.ReadUState -- FH.read/A.read
222inspect $ 'copyStreamLatin1 `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
222inspect $ 'copyStreamLatin1 `hasNoType` ''AT.ArrayUnsafe -- FH.write/writeNUnsafe
223−inspect $ 'copyStreamLatin1 `hasNoType` ''Strict.Tuple3' -- FH.write/lchunksOf
223+inspect $ 'copyStreamLatin1 `hasNoType` ''Strict.Tuple3' -- FH.write/chunksOf
224#endif
224#endif
225
225
226-- | Copy file
226-- | Copy file
src/Streamly/Internal/Data/Fold.hs+1−1
@@ -214,7 +214,7 @@ module Streamly.Internal.Data.Fold
214 -- * Nesting
214 -- * Nesting
215 , many
215 , many
216 , lsessionsOf
216 , lsessionsOf
217− , lchunksOf
217+ , chunksOf
218 , chunksBetween
218 , chunksBetween
219
219
220 , concatSequence
220 , concatSequence
src/Streamly/Internal/Data/Fold/Types.hs+6−6
@@ -202,7 +202,7 @@ module Streamly.Internal.Data.Fold.Types
202 , concatMap
202 , concatMap
203 , many
203 , many
204 , lsessionsOf
204 , lsessionsOf
205− , lchunksOf
205+ , chunksOf
206 , chunksOf2
206 , chunksOf2
207
207
208 , duplicate
208 , duplicate
@@ -861,19 +861,19 @@ many (Fold cstep cinitial cextract) (Fold sstep sinitial sextract) =
861 Partial s -> cextract s
861 Partial s -> cextract s
862 Done b -> return b
862 Done b -> return b
863
863
864−-- | @lchunksOf n split collect@ repeatedly applies the @split@ fold to chunks
864+-- | @chunksOf n split collect@ repeatedly applies the @split@ fold to chunks
865-- of @n@ items in the input stream and supplies the result to the @collect@
865-- of @n@ items in the input stream and supplies the result to the @collect@
866-- fold.
866-- fold.
867--
867--
868−-- > lchunksOf n split collect = many collect (takeLE n split)
868+-- > chunksOf n split collect = many collect (takeLE n split)
869--
869--
870-- Stops when @collect@ stops.
870-- Stops when @collect@ stops.
871--
871--
872-- /Internal/
872-- /Internal/
873--
873--
874−{-# INLINE lchunksOf #-}
874+{-# INLINE chunksOf #-}
875−lchunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
875+chunksOf :: Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c
876−lchunksOf n split collect = many collect (takeLE n split)
876+chunksOf n split collect = many collect (takeLE n split)
877
877
878{-# INLINE chunksOf2 #-}
878{-# INLINE chunksOf2 #-}
879chunksOf2 :: Monad m => Int -> Fold m a b -> Fold2 m x b c -> Fold2 m x a c
879chunksOf2 :: Monad m => Int -> Fold m a b -> Fold2 m x b c -> Fold2 m x a c
src/Streamly/Internal/FileSystem/Dir.hs+1−1
@@ -388,7 +388,7 @@ writeChunksWithBufferOf n h = lpackArraysChunksOf n (writeChunks h)
388-- @since 0.7.0
388-- @since 0.7.0
389{-# INLINE writeWithBufferOf #-}
389{-# INLINE writeWithBufferOf #-}
390writeWithBufferOf :: MonadIO m => Int -> Handle -> Fold m Word8 ()
390writeWithBufferOf :: MonadIO m => Int -> Handle -> Fold m Word8 ()
391−writeWithBufferOf n h = FL.lchunksOf n (writeNUnsafe n) (writeChunks h)
391+writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
392
392
393-- > write = 'writeWithBufferOf' A.defaultChunkSize
393-- > write = 'writeWithBufferOf' A.defaultChunkSize
394--
394--
src/Streamly/Internal/FileSystem/File.hs+1−1
@@ -377,7 +377,7 @@ writeChunks path = Fold step initial extract
377writeWithBufferOf :: (MonadIO m, MonadCatch m)
377writeWithBufferOf :: (MonadIO m, MonadCatch m)
378 => Int -> FilePath -> Fold m Word8 ()
378 => Int -> FilePath -> Fold m Word8 ()
379writeWithBufferOf n path =
379writeWithBufferOf n path =
380− FL.lchunksOf n (writeNUnsafe n) (writeChunks path)
380+ FL.chunksOf n (writeNUnsafe n) (writeChunks path)
381
381
382-- > write = 'writeWithBufferOf' A.defaultChunkSize
382-- > write = 'writeWithBufferOf' A.defaultChunkSize
383--
383--
src/Streamly/Internal/FileSystem/Handle.hs+1−1
@@ -460,7 +460,7 @@ writeChunksWithBufferOf n h = lpackArraysChunksOf n (writeChunks h)
460-- @since 0.7.0
460-- @since 0.7.0
461{-# INLINE writeWithBufferOf #-}
461{-# INLINE writeWithBufferOf #-}
462writeWithBufferOf :: MonadIO m => Int -> Handle -> Fold m Word8 ()
462writeWithBufferOf :: MonadIO m => Int -> Handle -> Fold m Word8 ()
463−writeWithBufferOf n h = FL.lchunksOf n (writeNUnsafe n) (writeChunks h)
463+writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
464
464
465{-# INLINE writeWithBufferOf2 #-}
465{-# INLINE writeWithBufferOf2 #-}
466writeWithBufferOf2 :: MonadIO m => Int -> Fold2 m Handle Word8 ()
466writeWithBufferOf2 :: MonadIO m => Int -> Fold2 m Handle Word8 ()
src/Streamly/Internal/Memory/ArrayStream.hs+1−1
@@ -232,5 +232,5 @@ toArraysInRange low high (Fold step initial extract) =
232{-# INLINE _toArraysOf #-}
232{-# INLINE _toArraysOf #-}
233_toArraysOf :: (MonadIO m, Storable a)
233_toArraysOf :: (MonadIO m, Storable a)
234 => Int -> Fold m a (SerialT Identity (Array a))
234 => Int -> Fold m a (SerialT Identity (Array a))
235−_toArraysOf n = FL.lchunksOf n (A.writeNF n) FL.toStream
235+_toArraysOf n = FL.chunksOf n (A.writeNF n) FL.toStream
236-}
236-}
src/Streamly/Internal/Network/Inet/TCP.hs+1−1
@@ -396,7 +396,7 @@ writeWithBufferOf
396 -> PortNumber
396 -> PortNumber
397 -> Fold m Word8 ()
397 -> Fold m Word8 ()
398writeWithBufferOf n addr port =
398writeWithBufferOf n addr port =
399− FL.lchunksOf n (writeNUnsafe n) (writeChunks addr port)
399+ FL.chunksOf n (writeNUnsafe n) (writeChunks addr port)
400
400
401-- | Write a stream to the supplied IPv4 host address and port number.
401-- | Write a stream to the supplied IPv4 host address and port number.
402--
402--
src/Streamly/Internal/Network/Socket.hs+1−1
@@ -503,7 +503,7 @@ fromBytesWithBufferOf n h m = fromChunks h $ AS.arraysOf n m
503-- @since 0.7.0
503-- @since 0.7.0
504{-# INLINE writeWithBufferOf #-}
504{-# INLINE writeWithBufferOf #-}
505writeWithBufferOf :: MonadIO m => Int -> Socket -> Fold m Word8 ()
505writeWithBufferOf :: MonadIO m => Int -> Socket -> Fold m Word8 ()
506−writeWithBufferOf n h = FL.lchunksOf n (A.writeNUnsafe n) (writeChunks h)
506+writeWithBufferOf n h = FL.chunksOf n (A.writeNUnsafe n) (writeChunks h)
507
507
508-- > write = 'writeWithBufferOf' A.defaultChunkSize
508-- > write = 'writeWithBufferOf' A.defaultChunkSize
509--
509--