on master help sign in
Refactor writeByChunks/Of to be consistent with readInChunksOf.
6ffd5bcPranay Sashank
src/Streamly/FileSystem/FD.hs+1−1
@@ -403,7 +403,7 @@ _writevArraysPackedUpto n h xs =
403writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
403writeInChunksOf :: MonadIO m => Int -> Handle -> SerialT m Word8 -> m ()
404writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
404writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
405
405
406−-- > write = 'writeByChunks' A.defaultChunkSize
406+-- > write = 'writeInChunksOf' A.defaultChunkSize
407--
407--
408-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
408-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
409-- up to 'A.defaultChunkSize' before writing. Note that the write behavior
409-- 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
72 -- , writeUtf8
72 -- , writeUtf8
73 -- , writeUtf8ByLines
73 -- , writeUtf8ByLines
74 -- , writeByFrames
74 -- , writeByFrames
75− , writeByChunks
75+ , writeInChunksOf
76
76
77 -- -- * Array Write
77 -- -- * Array Write
78 , writeArray
78 , writeArray
@@ -287,12 +287,12 @@ writeArrays = writeArraysMode WriteMode
287-- input elements.
287-- input elements.
288--
288--
289-- @since 0.7.0
289-- @since 0.7.0
290−{-# INLINE writeByChunks #-}
290+{-# INLINE writeInChunksOf #-}
291−writeByChunks :: (MonadAsync m, MonadCatch m)
291+writeInChunksOf :: (MonadAsync m, MonadCatch m)
292 => Int -> FilePath -> SerialT m Word8 -> m ()
292 => 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
294
294
295−-- > write = 'writeByChunks' A.defaultChunkSize
295+-- > write = 'writeInChunksOf' A.defaultChunkSize
296--
296--
297-- | Write a byte stream to a file. Combines the bytes in chunks of size
297-- | Write a byte stream to a file. Combines the bytes in chunks of size
298-- up to 'A.defaultChunkSize' before writing. If the file exists it is
298-- 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
302-- @since 0.7.0
302-- @since 0.7.0
303{-# INLINE write #-}
303{-# INLINE write #-}
304write :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
304write :: (MonadAsync m, MonadCatch m) => FilePath -> SerialT m Word8 -> m ()
305−write = writeByChunks A.defaultChunkSize
305+write = writeInChunksOf A.defaultChunkSize
306
306
307{-
307{-
308{-# INLINE write #-}
308{-# INLINE write #-}
src/Streamly/Network/Client.hs+5−5
@@ -47,7 +47,7 @@ module Streamly.Network.Client
47 -- , writeUtf8
47 -- , writeUtf8
48 -- , writeUtf8ByLines
48 -- , writeUtf8ByLines
49 -- , writeByFrames
49 -- , writeByFrames
50− -- , writeByChunks
50+ -- , writeInChunksOf
51
51
52 -- -- * Array Write
52 -- -- * Array Write
53 -- , writeArray
53 -- , writeArray
@@ -133,15 +133,15 @@ writeArrays addr port xs =
133-- input elements.
133-- input elements.
134--
134--
135-- @since 0.7.0
135-- @since 0.7.0
136−{-# INLINE writeByChunks #-}
136+{-# INLINE writeInChunksOf #-}
137−writeByChunks
137+writeInChunksOf
138 :: (MonadCatch m, MonadAsync m)
138 :: (MonadCatch m, MonadAsync m)
139 => Int
139 => Int
140 -> (Word8, Word8, Word8, Word8)
140 -> (Word8, Word8, Word8, Word8)
141 -> PortNumber
141 -> PortNumber
142 -> SerialT m Word8
142 -> SerialT m Word8
143 -> m ()
143 -> 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
145
145
146-- | Write a stream to the supplied IPv4 host address and port number.
146-- | Write a stream to the supplied IPv4 host address and port number.
147--
147--
@@ -149,4 +149,4 @@ writeByChunks n addr port m = writeArrays addr port $ AS.arraysOf n m
149{-# INLINE write #-}
149{-# INLINE write #-}
150write :: (MonadCatch m, MonadAsync m)
150write :: (MonadCatch m, MonadAsync m)
151 => (Word8, Word8, Word8, Word8) -> PortNumber -> SerialT m Word8 -> m ()
151 => (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
56 -- , writeUtf8
56 -- , writeUtf8
57 -- , writeUtf8ByLines
57 -- , writeUtf8ByLines
58 -- , writeByFrames
58 -- , writeByFrames
59− , writeByChunks
59+ , writeInChunksOf
60
60
61 -- -- * Array Write
61 -- -- * Array Write
62 , writeArray
62 , writeArray
@@ -292,11 +292,11 @@ writeArrays h m = S.mapM_ (liftIO . writeArray h) m
292-- input elements.
292-- input elements.
293--
293--
294-- @since 0.7.0
294-- @since 0.7.0
295−{-# INLINE writeByChunks #-}
295+{-# INLINE writeInChunksOf #-}
296−writeByChunks :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
296+writeInChunksOf :: MonadIO m => Int -> Socket -> SerialT m Word8 -> m ()
297−writeByChunks n h m = writeArrays h $ AS.arraysOf n m
297+writeInChunksOf n h m = writeArrays h $ AS.arraysOf n m
298
298
299−-- > write = 'writeByChunks' A.defaultChunkSize
299+-- > write = 'writeInChunksOf' A.defaultChunkSize
300--
300--
301-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
301-- | Write a byte stream to a file handle. Combines the bytes in chunks of size
302-- up to 'A.defaultChunkSize' before writing. Note that the write behavior
302-- 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
305-- @since 0.7.0
305-- @since 0.7.0
306{-# INLINE write #-}
306{-# INLINE write #-}
307write :: MonadIO m => Socket -> SerialT m Word8 -> m ()
307write :: MonadIO m => Socket -> SerialT m Word8 -> m ()
308−write = writeByChunks A.defaultChunkSize
308+write = writeInChunksOf A.defaultChunkSize
309
309
310{-
310{-
311{-# INLINE write #-}
311{-# INLINE write #-}