on master help sign in
Refactor writeByChunksOf to writeInChunksOf.
aae9b4fPranay Sashank
src/Streamly/FileSystem/FD.hs+5−5
@@ -90,7 +90,7 @@ module Streamly.FileSystem.FD
90 -- , writeUtf8
90 -- , writeUtf8
91 -- , writeUtf8Lines
91 -- , writeUtf8Lines
92 -- , writeFrames
92 -- , writeFrames
93− , writeByChunksOf
93+ , writeInChunksOf
94
94
95 -- -- * Array Write
95 -- -- * Array Write
96 -- , writeArray
96 -- , writeArray
@@ -399,9 +399,9 @@ _writevArraysPackedUpto n h xs =
399-- input elements.
399-- input elements.
400--
400--
401-- @since 0.7.0
401-- @since 0.7.0
402−{-# INLINE writeByChunksOf #-}
402+{-# INLINE writeInChunksOf #-}
403−writeByChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
403+writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
404−writeByChunksOf n h m = writeArrays h $ AS.arraysOf n m
404+writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
405
405
406-- > write = 'writeByChunks' A.defaultChunkSize
406-- > write = 'writeByChunks' A.defaultChunkSize
407--
407--
@@ -412,7 +412,7 @@ writeByChunksOf n h m = writeArrays h $ AS.arraysOf n m
412-- @since 0.7.0
412-- @since 0.7.0
413{-# INLINE write #-}
413{-# INLINE write #-}
414write :: MonadIO m => Handle -> SerialT m Word8 -> m ()
414write :: MonadIO m => Handle -> SerialT m Word8 -> m ()
415−write = writeByChunksOf defaultChunkSize
415+write = writeInChunksOf defaultChunkSize
416
416
417{-
417{-
418{-# INLINE write #-}
418{-# INLINE write #-}
src/Streamly/FileSystem/Handle.hs+7−7
@@ -81,7 +81,7 @@ module Streamly.FileSystem.Handle
81 -- , writeUtf8
81 -- , writeUtf8
82 -- , writeUtf8ByLines
82 -- , writeUtf8ByLines
83 -- , writeByFrames
83 -- , writeByFrames
84− , writeByChunksOf
84+ , writeInChunksOf
85
85
86 -- -- * Array Write
86 -- -- * Array Write
87 , writeArray
87 , writeArray
@@ -291,16 +291,16 @@ writeArraysPackedUpto n h xs = writeArrays h $ AS.compact n xs
291-- do not want buffering to occur at GHC level as well. Same thing applies to
291-- do not want buffering to occur at GHC level as well. Same thing applies to
292-- writes as well.
292-- writes as well.
293
293
294−-- | @writeByChunksOf chunkSize handle stream@ writes @stream@ to @handle@ in
294+-- | @writeInChunksOf chunkSize handle stream@ writes @stream@ to @handle@ in
295-- chunks of @chunkSize@. A write is performed to the IO device as soon as we
295-- chunks of @chunkSize@. A write is performed to the IO device as soon as we
296-- collect the required input size.
296-- collect the required input size.
297--
297--
298-- @since 0.7.0
298-- @since 0.7.0
299−{-# INLINE writeByChunksOf #-}
299+{-# INLINE writeInChunksOf #-}
300−writeByChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
300+writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
301−writeByChunksOf n h m = writeArrays h $ AS.arraysOf n m
301+writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
302
302
303−-- > write = 'writeByChunksOf' A.defaultChunkSize
303+-- > write = 'writeInChunksOf' A.defaultChunkSize
304--
304--
305-- | Write a byte stream to a file handle. Combines the bytes in chunks of
305-- | Write a byte stream to a file handle. Combines the bytes in chunks of
306-- up to 'A.defaultChunkSize' before writing.
306-- up to 'A.defaultChunkSize' before writing.
@@ -308,7 +308,7 @@ writeByChunksOf n h m = writeArrays h $ AS.arraysOf n m
308-- @since 0.7.0
308-- @since 0.7.0
309{-# INLINE write #-}
309{-# INLINE write #-}
310write :: MonadIO m => Handle -> SerialT m Word8 -> m ()
310write :: MonadIO m => Handle -> SerialT m Word8 -> m ()
311−write = writeByChunksOf defaultChunkSize
311+write = writeInChunksOf defaultChunkSize
312
312
313{-
313{-
314{-# INLINE write #-}
314{-# INLINE write #-}