@@ -88,22 +88,22 @@ import qualified Network.Socket as Net
89import Streamly.Internal.Data.Array (Array(..))
89import Streamly.Internal.Data.Array (Array(..))
90import Streamly.Internal.Data.Stream.Chunked (lpackArraysChunksOf)
90import Streamly.Internal.Data.Stream.Chunked (lpackArraysChunksOf)
91−import Streamly.Internal.Data.Fold (Fold)
91+import Streamly.Data.Fold (Fold)
92−import Streamly.Internal.Data.Stream (Stream)
92+import Streamly.Data.Stream (Stream)
93import Streamly.Internal.Data.Unfold (Unfold(..))
93import Streamly.Internal.Data.Unfold (Unfold(..))
94-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
94-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
95import Streamly.Internal.System.IO (defaultChunkSize)
95import Streamly.Internal.System.IO (defaultChunkSize)
97−import qualified Streamly.Data.Array as A (reader, length)
97+import qualified Streamly.Data.Array as A
98import qualified Streamly.Data.Fold as FL
98import qualified Streamly.Data.Fold as FL
99+import qualified Streamly.Data.Stream as S
100+import qualified Streamly.Data.Unfold as UF
99import qualified Streamly.Internal.Data.Array as A
101import qualified Streamly.Internal.Data.Array as A
100− (unsafeFreeze, asPtrUnsafe, byteLength, pinnedChunksOf, pinnedWriteN, pinnedWriteNUnsafe)
102+ ( unsafeFreeze, asPtrUnsafe, byteLength, pinnedChunksOf,
103+ pinnedWriteN, pinnedWriteNUnsafe )
101import qualified Streamly.Internal.Data.MutArray as MArray
104import qualified Streamly.Internal.Data.MutArray as MArray
102 (MutArray(..), asPtrUnsafe, pinnedNewBytes)
105 (MutArray(..), asPtrUnsafe, pinnedNewBytes)
103−import qualified Streamly.Internal.Data.Stream as S
106+import qualified Streamly.Internal.Data.Stream as S (fromStreamK, Stream(..), Step(..))
104−import qualified Streamly.Internal.Data.Stream as D
105− (Stream(..), Step(..))
106−import qualified Streamly.Data.Unfold as UF
107import qualified Streamly.Internal.Data.Unfold as UF (first, map)
107import qualified Streamly.Internal.Data.Unfold as UF (first, map)
108import qualified Streamly.Internal.Data.StreamK as K (mkStream)
108import qualified Streamly.Internal.Data.StreamK as K (mkStream)
@@ -173,7 +173,7 @@ listenTuples = Unfold step inject
174 step listener = do
174 step listener = do
175 r <- liftIO (Net.accept listener `onException` Net.close listener)
175 r <- liftIO (Net.accept listener `onException` Net.close listener)
176− return $ D.Yield r listener
176+ return $ S.Yield r listener
178-- | Unfold a three tuple @(listenQLen, spec, addr)@ into a stream of connected
178-- | Unfold a three tuple @(listenQLen, spec, addr)@ into a stream of connected
179-- protocol sockets corresponding to incoming connections. @listenQLen@ is the
179-- protocol sockets corresponding to incoming connections. @listenQLen@ is the
@@ -344,15 +344,15 @@ _readChunksUptoWith f size h = S.fromStreamK go
344{-# INLINE_NORMAL readChunksWith #-}
344{-# INLINE_NORMAL readChunksWith #-}
345readChunksWith :: MonadIO m => Int -> Socket -> Stream m (Array Word8)
345readChunksWith :: MonadIO m => Int -> Socket -> Stream m (Array Word8)
346-- readChunksWith = _readChunksUptoWith readChunk
346-- readChunksWith = _readChunksUptoWith readChunk
347−readChunksWith size h = D.Stream step ()
347+readChunksWith size h = S.Stream step ()
349 {-# INLINE_LATE step #-}
349 {-# INLINE_LATE step #-}
350 step _ _ = do
350 step _ _ = do
351 arr <- liftIO $ getChunk size h
351 arr <- liftIO $ getChunk size h
353 case A.length arr of
353 case A.length arr of
354− 0 -> D.Stop
354+ 0 -> S.Stop
355− _ -> D.Yield arr ()
355+ _ -> S.Yield arr ()
357-- | Read a stream of byte arrays from a socket. The maximum size of a single
357-- | Read a stream of byte arrays from a socket. The maximum size of a single
358-- array is limited to @defaultChunkSize@.
358-- array is limited to @defaultChunkSize@.
@@ -378,8 +378,8 @@ chunkReaderWith = Unfold step return
378 arr <- liftIO $ getChunk size h
378 arr <- liftIO $ getChunk size h
380 case A.length arr of
380 case A.length arr of
381− 0 -> D.Stop
381+ 0 -> S.Stop
382− _ -> D.Yield arr (size, h)
382+ _ -> S.Yield arr (size, h)
384-- | Same as 'chunkReaderWith'
384-- | Same as 'chunkReaderWith'