@@ -436,6 +436,10 @@ module Streamly.Data.Stream
436 , parseMany
436 , parseMany
437 , Array.chunksOf
437 , Array.chunksOf
439 -- * Buffered Operations
443 -- * Buffered Operations
440 -- | Operations that require buffering of the stream.
444 -- | Operations that require buffering of the stream.
441 -- Reverse is essentially a left fold followed by an unfold.
445 -- Reverse is essentially a left fold followed by an unfold.
@@ -493,7 +497,12 @@ module Streamly.Data.Stream
500+import Control.Monad.IO.Class (MonadIO)
501+import Data.Word (Word8)
502+import Streamly.Data.Array (Array)
496import qualified Streamly.Internal.Data.Array.Type as Array
504import qualified Streamly.Internal.Data.Array.Type as Array
505+import qualified Streamly.Internal.Data.Stream.Chunked as ArrayStream
497import Streamly.Internal.Data.Stream.StreamD
506import Streamly.Internal.Data.Stream.StreamD
498import Prelude
507import Prelude
499 hiding (filter, drop, dropWhile, take, takeWhile, zipWith, foldr,
508 hiding (filter, drop, dropWhile, take, takeWhile, zipWith, foldr,
@@ -607,3 +616,14 @@ import Prelude
608-- 'Stream' and 'StreamK' types can be interconverted. See
617-- 'Stream' and 'StreamK' types can be interconverted. See
609-- "Streamly.Data.StreamK" module for conversion operations.
618-- "Streamly.Data.StreamK" module for conversion operations.
620+-- | Split a stream of arrays on a given separator byte, dropping the separator
621+-- and coalescing all the arrays between two separators into a single array.
623+{-# INLINE chunksSplitOn #-}
627+ -> Stream m (Array Word8)
628+ -> Stream m (Array Word8)
629+chunksSplitOn = ArrayStream.splitOn