module Streamly.Internal.Data.MutArray.Stream
{-# DEPRECATED "Please use \"Streamly.Internal.Data.MutArray\" instead." #-}
(
MArray.chunksOf
, MArray.pinnedChunksOf
, MArray.writeChunks
, MArray.splitOn
, packArraysChunksOf
, MArray.SpliceState (..)
, lpackArraysChunksOf
, compact
, compactLE
, compactEQ
, compactGE
, MArray.flattenArrays
, MArray.flattenArraysRev
, MArray.fromArrayStreamK
)
where
import Control.Monad.IO.Class (MonadIO(..))
import Streamly.Internal.Data.Unbox (Unbox)
import Streamly.Internal.Data.MutArray.Type (MutArray(..))
import Streamly.Internal.Data.Fold.Type (Fold(..))
import Streamly.Internal.Data.Parser (ParseError)
import Streamly.Internal.Data.Stream.Type (Stream)
import qualified Streamly.Internal.Data.MutArray as MArray
import qualified Streamly.Internal.Data.Fold.Type as FL
import qualified Streamly.Internal.Data.Parser as ParserD
import qualified Streamly.Internal.Data.Stream as D
{-# INLINE packArraysChunksOf #-}
packArraysChunksOf :: (MonadIO m, Unbox a)
=> Int -> D.Stream m (MutArray a) -> D.Stream m (MutArray a)
packArraysChunksOf :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
packArraysChunksOf = Int -> Stream m (MutArray a) -> Stream m (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
MArray.compactLE
{-# INLINE lpackArraysChunksOf #-}
lpackArraysChunksOf :: (MonadIO m, Unbox a)
=> Int -> Fold m (MutArray a) () -> Fold m (MutArray a) ()
lpackArraysChunksOf :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Fold m (MutArray a) () -> Fold m (MutArray a) ()
lpackArraysChunksOf = Int -> Fold m (MutArray a) () -> Fold m (MutArray a) ()
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Fold m (MutArray a) () -> Fold m (MutArray a) ()
MArray.lCompactGE
{-# INLINE compact #-}
compact :: (MonadIO m, Unbox a)
=> Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compact :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compact = Int -> Stream m (MutArray a) -> Stream m (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
packArraysChunksOf
{-# INLINE compactLEParserD #-}
compactLEParserD ::
forall m a. (MonadIO m, Unbox a)
=> Int -> ParserD.Parser (MutArray a) m (MutArray a)
compactLEParserD :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Parser (MutArray a) m (MutArray a)
compactLEParserD = Int -> Parser (MutArray a) m (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Parser (MutArray a) m (MutArray a)
MArray.pCompactLE
{-# INLINE compactGEFold #-}
compactGEFold ::
forall m a. (MonadIO m, Unbox a)
=> Int -> FL.Fold m (MutArray a) (MutArray a)
compactGEFold :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Fold m (MutArray a) (MutArray a)
compactGEFold = Int -> Fold m (MutArray a) (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Fold m (MutArray a) (MutArray a)
MArray.fCompactGE
compactLE :: (MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (Either ParseError (MutArray a))
compactLE :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int
-> Stream m (MutArray a)
-> Stream m (Either ParseError (MutArray a))
compactLE Int
n = Parser (MutArray a) m (MutArray a)
-> Stream m (MutArray a)
-> Stream m (Either ParseError (MutArray a))
forall (m :: * -> *) a b.
Monad m =>
Parser a m b -> Stream m a -> Stream m (Either ParseError b)
D.parseManyD (Int -> Parser (MutArray a) m (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Parser (MutArray a) m (MutArray a)
compactLEParserD Int
n)
{-# INLINE compactEQ #-}
compactEQ ::
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compactEQ :: forall (m :: * -> *) a.
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compactEQ Int
_n Stream m (MutArray a)
_xs = Stream m (MutArray a)
forall a. HasCallStack => a
undefined
{-# INLINE compactGE #-}
compactGE ::
(MonadIO m, Unbox a)
=> Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compactGE :: forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Stream m (MutArray a) -> Stream m (MutArray a)
compactGE Int
n = Fold m (MutArray a) (MutArray a)
-> Stream m (MutArray a) -> Stream m (MutArray a)
forall (m :: * -> *) a b.
Monad m =>
Fold m a b -> Stream m a -> Stream m b
D.foldMany (Int -> Fold m (MutArray a) (MutArray a)
forall (m :: * -> *) a.
(MonadIO m, Unbox a) =>
Int -> Fold m (MutArray a) (MutArray a)
compactGEFold Int
n)