@@ -25,7 +25,7 @@ module Streamly.Internal.Network.Socket
25 , connectFrom
25 , connectFrom
27 -- * Read from connection
27 -- * Read from connection
28− , readChunk
28+ , getChunk
30 -- ** Streams
30 -- ** Streams
@@ -40,7 +40,7 @@ module Streamly.Internal.Network.Socket
40 , chunkReaderWith
40 , chunkReaderWith
42 -- * Write to connection
42 -- * Write to connection
43− , writeChunk
43+ , putChunk
45 -- ** Folds
45 -- ** Folds
@@ -278,10 +278,10 @@ readArrayUptoWith f size h = do
278-- becomes available. If data is available then it immediately returns that
278-- becomes available. If data is available then it immediately returns that
279-- data without blocking.
279-- data without blocking.
281−-- @since 0.8.0
281+-- @since 0.9.0
282−{-# INLINABLE readChunk #-}
282+{-# INLINABLE getChunk #-}
283−readChunk :: Int -> Socket -> IO (Array Word8)
283+getChunk :: Int -> Socket -> IO (Array Word8)
284−readChunk = readArrayUptoWith recvBuf
284+getChunk = readArrayUptoWith recvBuf
286-------------------------------------------------------------------------------
286-------------------------------------------------------------------------------
287-- Array IO (output)
287-- Array IO (output)
@@ -321,10 +321,10 @@ writeArrayWith f h arr = A.asPtrUnsafe arr $ \ptr -> f h (castPtr ptr) aLen
322-- | Write an Array to a file handle.
322-- | Write an Array to a file handle.
324−-- @since 0.8.0
324+-- @since 0.9.0
325−{-# INLINABLE writeChunk #-}
325+{-# INLINABLE putChunk #-}
326−writeChunk :: Unboxed a => Socket -> Array a -> IO ()
326+putChunk :: Unboxed a => Socket -> Array a -> IO ()
327−writeChunk = writeArrayWith sendAll
327+putChunk = writeArrayWith sendAll
329-------------------------------------------------------------------------------
329-------------------------------------------------------------------------------
330-- Stream of Arrays IO
330-- Stream of Arrays IO
@@ -354,7 +354,7 @@ readChunksWith size h = S.fromStreamD (D.Stream step ())
355 {-# INLINE_LATE step #-}
355 {-# INLINE_LATE step #-}
356 step _ _ = do
356 step _ _ = do
357− arr <- liftIO $ readChunk size h
357+ arr <- liftIO $ getChunk size h
359 case A.length arr of
359 case A.length arr of
360 0 -> D.Stop
360 0 -> D.Stop
@@ -382,7 +382,7 @@ chunkReaderWith = Unfold step return
383 {-# INLINE_LATE step #-}
383 {-# INLINE_LATE step #-}
384 step (size, h) = do
384 step (size, h) = do
385− arr <- liftIO $ readChunk size h
385+ arr <- liftIO $ getChunk size h
387 case A.length arr of
387 case A.length arr of
388 0 -> D.Stop
388 0 -> D.Stop
@@ -462,7 +462,7 @@ reader = UF.first defaultChunkSize readerWith
462{-# INLINE putChunks #-}
462{-# INLINE putChunks #-}
463putChunks :: (MonadIO m, Unboxed a)
463putChunks :: (MonadIO m, Unboxed a)
464 => Socket -> Stream m (Array a) -> m ()
464 => Socket -> Stream m (Array a) -> m ()
465−putChunks h = S.fold (FL.drainBy (liftIO . writeChunk h))
465+putChunks h = S.fold (FL.drainBy (liftIO . putChunk h))
467-- | Write a stream of arrays to a socket. Each array in the stream is written
467-- | Write a stream of arrays to a socket. Each array in the stream is written
468-- to the socket as a separate IO request.
468-- to the socket as a separate IO request.
@@ -470,7 +470,7 @@ putChunks h = S.fold (FL.drainBy (liftIO . writeChunk h))
470-- @since 0.7.0
470-- @since 0.7.0
471{-# INLINE writeChunks #-}
471{-# INLINE writeChunks #-}
472writeChunks :: (MonadIO m, Unboxed a) => Socket -> Fold m (Array a) ()
472writeChunks :: (MonadIO m, Unboxed a) => Socket -> Fold m (Array a) ()
473−writeChunks h = FL.drainBy (liftIO . writeChunk h)
473+writeChunks h = FL.drainBy (liftIO . putChunk h)
475-- | @writeChunksWith bufsize socket@ writes a stream of arrays to
475-- | @writeChunksWith bufsize socket@ writes a stream of arrays to
476-- @socket@ after coalescing the adjacent arrays in chunks of @bufsize@.
476-- @socket@ after coalescing the adjacent arrays in chunks of @bufsize@.