on master help sign in
Refactor writeByChunks/Of to be consistent with readInChunksOf.
commit6ffd5bcfdb67f80daac2b51ec6fc0d86c54f10a4 authorPranay Sashank <pranaysashank@gmail.com> dateWed 7 Aug 2019, 00:20 (7 years ago) parentaae9b4f
4 files changed+18−18
src/Streamly/FileSystem/FD.hs+1−1 src/Streamly/FileSystem/File.hs+6−6 src/Streamly/Network/Client.hs+5−5 src/Streamly/Network/Socket.hs+6−6
src/Streamly/FileSystem/FD.hs+1−1
@@ -403,7 +403,7 @@ _writevArraysPackedUpto n h xs =
403403writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
404404writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
405405
406−-- > write = 'writeByChunks' A.defaultChunkSize
406+-- > write = 'writeInChunksOf' A.defaultChunkSize
407407--
408408-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
409409-- up to 'A.defaultChunkSize' before writing. Note that the write behavior
src/Streamly/FileSystem/File.hs+6−6
@@ -72,7 +72,7 @@ module Streamly.FileSystem.File
7272 -- , writeUtf8
7373 -- , writeUtf8ByLines
7474 -- , writeByFrames
75− , writeByChunks
75+ , writeInChunksOf
7676
7777 -- -- * Array Write
7878 , writeArray
@@ -287,12 +287,12 @@ writeArrays = writeArraysMode WriteMode
287287-- input elements.
288288--
289289-- @since 0.7.0
290−{-# INLINE writeByChunks #-}
291−writeByChunks :: (MonadAsync m, MonadCatch m)
290+{-# INLINE writeInChunksOf #-}
291+writeInChunksOf :: (MonadAsync m, MonadCatch m)
292292 => Int -> FilePath -> SerialT m Word8 -> m ()
293−writeByChunks n file xs = writeArrays file $ AS.arraysOf n xs
293+writeInChunksOf n file xs = writeArrays file $ AS.arraysOf n xs
294294
295−-- > write = 'writeByChunks' A.defaultChunkSize
295+-- > write = 'writeInChunksOf' A.defaultChunkSize
296296--
297297-- | Write a byte stream to a file. Combines the bytes in chunks of size
298298-- up to 'A.defaultChunkSize' before writing. If the file exists it is
@@ -302,7 +302,7 @@ writeByChunks n file xs = writeArrays file $ AS.arraysOf n xs
302302-- @since 0.7.0
303303{-# INLINE write #-}
304304write :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
305−write = writeByChunks A.defaultChunkSize
305+write = writeInChunksOf A.defaultChunkSize
306306
307307{-
308308{-# INLINE write #-}
src/Streamly/Network/Client.hs+5−5
@@ -47,7 +47,7 @@ module Streamly.Network.Client
4747 -- , writeUtf8
4848 -- , writeUtf8ByLines
4949 -- , writeByFrames
50− -- , writeByChunks
50+ -- , writeInChunksOf
5151
5252 -- -- * Array Write
5353 -- , writeArray
@@ -133,15 +133,15 @@ writeArrays addr port xs =
133133-- input elements.
134134--
135135-- @since 0.7.0
136−{-# INLINE writeByChunks #-}
137−writeByChunks
136+{-# INLINE writeInChunksOf #-}
137+writeInChunksOf
138138 :: (MonadCatch m, MonadAsync m)
139139 => Int
140140 -> (Word8, Word8, Word8, Word8)
141141 -> PortNumber
142142 -> SerialT m Word8
143143 -> m ()
144−writeByChunks n addr port m = writeArrays addr port $ AS.arraysOf n m
144+writeInChunksOf n addr port m = writeArrays addr port $ AS.arraysOf n m
145145
146146-- | Write a stream to the supplied IPv4 host address and port number.
147147--
@@ -149,4 +149,4 @@ writeByChunks n addr port m = writeArrays addr port $ AS.arraysOf n m
149149{-# INLINE write #-}
150150write :: (MonadCatch m, MonadAsync m)
151151 => (Word8, Word8, Word8, Word8) -> PortNumber -> SerialT m Word8 -> m ()
152−write = writeByChunks defaultChunkSize
152+write = writeInChunksOf defaultChunkSize
src/Streamly/Network/Socket.hs+6−6
@@ -56,7 +56,7 @@ module Streamly.Network.Socket
5656 -- , writeUtf8
5757 -- , writeUtf8ByLines
5858 -- , writeByFrames
59− , writeByChunks
59+ , writeInChunksOf
6060
6161 -- -- * Array Write
6262 , writeArray
@@ -292,11 +292,11 @@ writeArrays h m = S.mapM_ (liftIO . writeArray h) m
292292-- input elements.
293293--
294294-- @since 0.7.0
295−{-# INLINE writeByChunks #-}
296−writeByChunks :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
297−writeByChunks n h m = writeArrays h $ AS.arraysOf n m
295+{-# INLINE writeInChunksOf #-}
296+writeInChunksOf :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
297+writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
298298
299−-- > write = 'writeByChunks' A.defaultChunkSize
299+-- > write = 'writeInChunksOf' A.defaultChunkSize
300300--
301301-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
302302-- up to 'A.defaultChunkSize' before writing. Note that the write behavior
@@ -305,7 +305,7 @@ writeByChunks n h m = writeArrays h $ AS.arraysOf n m
305305-- @since 0.7.0
306306{-# INLINE write #-}
307307write :: MonadIO m => Socket -> SerialT m Word8 -> m ()
308−write = writeByChunks A.defaultChunkSize
308+write = writeInChunksOf A.defaultChunkSize
309309
310310{-
311311{-# INLINE write #-}