mirror of
https://github.com/ilyakooo0/streamly.git
synced 2024-08-16 03:40:27 +03:00
Rename Types.hs modules to Type.hs
This commit is contained in:
parent
bb72e18365
commit
87ebad51cb
@ -16,15 +16,15 @@ src/Streamly/Internal/Data/Stream/StreamD/Transform.hs
|
||||
src/Streamly/Internal/Data/Stream/StreamD/Exception.hs
|
||||
src/Streamly/Internal/Data/Stream/StreamD/Lift.hs
|
||||
src/Streamly/Internal/Data/Stream/StreamD/Nesting.hs
|
||||
src/Streamly/Internal/Data/Pipe/Types.hs
|
||||
src/Streamly/Internal/Data/SmallArray/Types.hs
|
||||
src/Streamly/Internal/Data/Pipe/Type.hs
|
||||
src/Streamly/Internal/Data/SmallArray/Type.hs
|
||||
src/Streamly/Internal/Unicode/Stream.hs
|
||||
src/Streamly/Internal/Data/IORef/Prim.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Types.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Mut/Types.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Type.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Mut/Type.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Pinned/Mut/Types.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Pinned/Types.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Pinned/Mut/Type.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/Pinned/Type.hs
|
||||
src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs
|
||||
test/Streamly/Test/Common/Array.hs
|
||||
test/Streamly/Test/Data/Array.hs
|
||||
|
@ -19,7 +19,7 @@ import Streamly.Internal.Data.Fold (Fold(..))
|
||||
|
||||
import qualified Data.Map.Strict as Map
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Pipe as Pipe
|
||||
import qualified Streamly.Internal.Data.Sink as Sink
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
|
@ -24,7 +24,7 @@ import qualified Data.Foldable as F
|
||||
import qualified Data.Traversable as TR
|
||||
import qualified Streamly.Prelude as S
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as PR
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as PR
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as PRD
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
|
||||
|
@ -34,7 +34,7 @@ import System.IO (Handle)
|
||||
|
||||
import qualified Streamly.FileSystem.Handle as FH
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as AT
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
import qualified Streamly.Internal.FileSystem.Handle as IFH
|
||||
@ -50,7 +50,7 @@ import Streamly.Benchmark.Common.Handle
|
||||
#ifdef INSPECTION
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Step(..), FoldMany)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
import qualified Streamly.Internal.Data.Unfold as IUF
|
||||
|
||||
|
@ -24,7 +24,7 @@ where
|
||||
|
||||
import System.IO (Handle)
|
||||
import Prelude hiding (last, length)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (defaultChunkSize)
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (defaultChunkSize)
|
||||
|
||||
import qualified Streamly.FileSystem.Handle as FH
|
||||
import qualified Streamly.Internal.Data.Unfold as IUF
|
||||
@ -43,8 +43,8 @@ import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Tuple.Strict as Strict
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as MAS
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as AT
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
|
||||
import Test.Inspection
|
||||
#endif
|
||||
|
@ -41,7 +41,7 @@ import Streamly.Benchmark.Common.Handle
|
||||
#ifdef INSPECTION
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
import qualified Streamly.Internal.Data.Unfold as IUF
|
||||
|
||||
import Test.Inspection
|
||||
|
@ -40,8 +40,8 @@ import Streamly.Benchmark.Common.Handle
|
||||
import Foreign.Storable (Storable)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
|
||||
import qualified Streamly.Internal.Data.Tuple.Strict as Strict
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as AT
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
|
||||
import Test.Inspection
|
||||
#endif
|
||||
|
@ -44,12 +44,12 @@ module Streamly.FileSystem.Handle
|
||||
-- the stream is lazy and generated on-demand as the consumer consumes it.
|
||||
-- Read IO requests to the IO device are performed in chunks limited to a
|
||||
-- maximum size of 32KiB, this is referred to as
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' in the
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' in the
|
||||
-- documentation. One IO request may or may not read the full
|
||||
-- chunk. If the whole stream is not consumed, it is possible that we may
|
||||
-- read slightly more from the IO device than what the consumer needed.
|
||||
-- Unless specified otherwise in the API, writes are collected into chunks
|
||||
-- of 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before they
|
||||
-- of 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before they
|
||||
-- are written to the IO device.
|
||||
|
||||
-- Streaming APIs work for all kind of devices, seekable or non-seekable;
|
||||
|
@ -55,13 +55,13 @@ import GHC.Base (Int(..))
|
||||
import GHC.IO (unsafePerformIO)
|
||||
import qualified GHC.Exts as Exts
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
|
||||
{-# NOINLINE bottomElement #-}
|
||||
|
@ -158,15 +158,15 @@ import GHC.Ptr (Ptr(..))
|
||||
import GHC.Prim (touch#)
|
||||
import GHC.IO (IO(..))
|
||||
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..), length)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..), length)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Producer.Type (Producer)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Stream.Prelude as P
|
||||
import qualified Streamly.Internal.Data.Stream.Serial as Serial
|
||||
|
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE UnboxedTuples #-}
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Foreign.Mut.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Foreign.Mut.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
-- License : BSD3-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -22,7 +22,7 @@
|
||||
-- Stream and Fold APIs allow easy, efficient and convenient operations on
|
||||
-- arrays.
|
||||
|
||||
module Streamly.Internal.Data.Array.Foreign.Mut.Types
|
||||
module Streamly.Internal.Data.Array.Foreign.Mut.Type
|
||||
(
|
||||
-- * Type
|
||||
-- $arrayNotes
|
||||
@ -135,17 +135,17 @@ import GHC.Exts (IsList, IsString(..))
|
||||
import GHC.ForeignPtr (ForeignPtr(..))
|
||||
import GHC.IO (IO(IO), unsafePerformIO)
|
||||
import GHC.Ptr (Ptr(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Producer.Type (Producer (..))
|
||||
import Streamly.Internal.Data.SVar (adaptState)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Text.Read (readPrec, readListPrec, readListPrecDefault)
|
||||
|
||||
#ifdef DEVBUILD
|
||||
import qualified Data.Foldable as F
|
||||
#endif
|
||||
import qualified GHC.Exts as Exts
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Producer as Producer
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
@ -463,7 +463,7 @@ arraysOf n (D.Stream step state) =
|
||||
step' _ (GroupStart st) = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.fromStreamDArraysOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.fromStreamDArraysOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
Array start end bound <- liftIO $ newArray n
|
||||
return $ D.Skip (GroupBuffer st start end bound)
|
@ -1,7 +1,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Foreign.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Foreign.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
--
|
||||
-- License : BSD3-3-Clause
|
||||
@ -9,9 +9,9 @@
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
-- See notes in "Streamly.Internal.Data.Array.Foreign.Mut.Types"
|
||||
-- See notes in "Streamly.Internal.Data.Array.Foreign.Mut.Type"
|
||||
--
|
||||
module Streamly.Internal.Data.Array.Foreign.Types
|
||||
module Streamly.Internal.Data.Array.Foreign.Type
|
||||
(
|
||||
-- $arrayNotes
|
||||
Array (..)
|
||||
@ -97,16 +97,16 @@ import GHC.ForeignPtr (touchForeignPtr, unsafeForeignPtrToPtr)
|
||||
#endif
|
||||
import GHC.IO (unsafePerformIO)
|
||||
import GHC.Ptr (Ptr(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Text.Read (readPrec, readListPrec, readListPrecDefault)
|
||||
|
||||
import Prelude hiding (length, foldr, read, unlines, splitAt)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Unfold.Types as Unfold
|
||||
import qualified Streamly.Internal.Data.Unfold.Type as Unfold
|
||||
import qualified GHC.Exts as Exts
|
||||
|
||||
#if __GLASGOW_HASKELL__ < 808
|
@ -104,7 +104,7 @@ module Streamly.Internal.Data.Array.Prim
|
||||
)
|
||||
where
|
||||
|
||||
import Streamly.Internal.Data.Array.Prim.Types (Array(..), length)
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Types as A
|
||||
import Streamly.Internal.Data.Array.Prim.Type (Array(..), length)
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Type as A
|
||||
|
||||
#include "Streamly/Internal/Data/Array/PrimInclude.hs"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Mut.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Mut.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
--
|
||||
-- License : BSD-3-Clause
|
||||
@ -11,7 +11,7 @@
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
module Streamly.Internal.Data.Array.Prim.Mut.Types
|
||||
module Streamly.Internal.Data.Array.Prim.Mut.Type
|
||||
(
|
||||
Array (..)
|
||||
|
@ -8,7 +8,7 @@ import Control.Monad (when)
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Data.Bifunctor (first)
|
||||
import Data.Primitive.Types (Prim(..), sizeOf)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.SVar (adaptState)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
|
||||
|
||||
@ -266,7 +266,7 @@ fromStreamDArraysOf n (D.Stream step state) = D.Stream step' (GroupStart state)
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $
|
||||
"Streamly.Internal.Data.Array.Foreign.Mut.Types.fromStreamDArraysOf: the size of " ++
|
||||
"Streamly.Internal.Data.Array.Foreign.Mut.Type.fromStreamDArraysOf: the size of " ++
|
||||
"arrays [" ++ show n ++ "] must be a natural number"
|
||||
arr <- newArray n
|
||||
return $ D.Skip (GroupBuffer st arr 0)
|
||||
@ -319,7 +319,7 @@ packArraysChunksOf n (D.Stream step state) =
|
||||
step' gst (SpliceInitial st) = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.packArraysChunksOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
r <- step gst st
|
||||
case r of
|
||||
@ -364,7 +364,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
|
||||
when (n <= 0)
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
$ error
|
||||
$ "Streamly.Internal.Data.Array.Foreign.Mut.Types."
|
||||
$ "Streamly.Internal.Data.Array.Foreign.Mut.Type."
|
||||
++ "packArraysChunksOf: the size of arrays ["
|
||||
++ show n
|
||||
++ "] must be a natural number"
|
||||
|
@ -102,7 +102,7 @@ module Streamly.Internal.Data.Array.Prim.Pinned
|
||||
)
|
||||
where
|
||||
|
||||
import Streamly.Internal.Data.Array.Prim.Pinned.Types (Array(..), length)
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Types as A
|
||||
import Streamly.Internal.Data.Array.Prim.Pinned.Type (Array(..), length)
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Type as A
|
||||
|
||||
#include "Streamly/Internal/Data/Array/PrimInclude.hs"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Pinned.Mut.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
--
|
||||
-- License : BSD-3-Clause
|
||||
@ -11,7 +11,7 @@
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
module Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
|
||||
module Streamly.Internal.Data.Array.Prim.Pinned.Mut.Type
|
||||
(
|
||||
Array (..)
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Pinned.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Pinned.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
--
|
||||
-- License : BSD-3-Clause
|
||||
@ -11,7 +11,7 @@
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
module Streamly.Internal.Data.Array.Prim.Pinned.Types
|
||||
module Streamly.Internal.Data.Array.Prim.Pinned.Type
|
||||
(
|
||||
Array (..)
|
||||
, unsafeFreeze
|
||||
@ -77,7 +77,7 @@ import Foreign.C.Types (CSize(..))
|
||||
import GHC.IO (IO(..))
|
||||
import Foreign.Ptr (minusPtr, nullPtr, plusPtr)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Mut.Type as MA
|
||||
|
||||
#include "Streamly/Internal/Data/Array/Prim/TypesInclude.hs"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Types
|
||||
-- Module : Streamly.Internal.Data.Array.Prim.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
--
|
||||
-- License : BSD-3-Clause
|
||||
@ -11,7 +11,7 @@
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
module Streamly.Internal.Data.Array.Prim.Types
|
||||
module Streamly.Internal.Data.Array.Prim.Type
|
||||
(
|
||||
Array (..)
|
||||
, unsafeFreeze
|
||||
@ -68,7 +68,7 @@ module Streamly.Internal.Data.Array.Prim.Types
|
||||
)
|
||||
where
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Mut.Type as MA
|
||||
|
||||
#include "Streamly/Internal/Data/Array/Prim/TypesInclude.hs"
|
||||
|
@ -16,7 +16,7 @@ import Data.Semigroup (Semigroup(..))
|
||||
import Data.Word (Word8)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
|
||||
import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.SVar (adaptState)
|
||||
import System.IO.Unsafe (unsafePerformIO)
|
||||
import Text.Read (readPrec, readListPrec, readListPrecDefault)
|
||||
@ -552,7 +552,7 @@ packArraysChunksOf n (D.Stream step state) =
|
||||
step' gst (SpliceInitial st) = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Types.packArraysChunksOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Type.packArraysChunksOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
r <- step gst st
|
||||
case r of
|
||||
@ -602,7 +602,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
|
||||
initial = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Types.packArraysChunksOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Type.packArraysChunksOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
res <- initial1
|
||||
return $ first (Tuple3' Nothing' 0) res
|
||||
|
@ -7,8 +7,8 @@
|
||||
import Control.Monad (when)
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Data.Primitive.Types (Prim(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
|
||||
|
@ -52,17 +52,17 @@ import Prelude hiding (length, null, last, map, (!!), read, concat, unlines)
|
||||
#if !defined(mingw32_HOST_OS)
|
||||
import Streamly.Internal.FileSystem.FDIO (IOVec(..))
|
||||
#endif
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..), length)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..), length)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
import Streamly.Internal.Data.SVar (adaptState)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MA
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as AS
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as S
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
|
||||
|
@ -37,17 +37,17 @@ import Foreign.Storable (Storable(..))
|
||||
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
|
||||
import Foreign.Ptr (castPtr)
|
||||
import Streamly.Internal.FileSystem.FDIO (IOVec(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Types (length)
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Type (length)
|
||||
import Streamly.Internal.Data.SVar (adaptState)
|
||||
#endif
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Types (Array(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Type (Array(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MArray
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Mut.Type as MArray
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
|
||||
import Prelude hiding (length)
|
||||
@ -99,7 +99,7 @@ packArraysChunksOf n (D.Stream step state) =
|
||||
step' gst (SpliceInitial st) = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.packArraysChunksOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
r <- step gst st
|
||||
case r of
|
||||
@ -143,7 +143,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
|
||||
initial = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.packArraysChunksOf: the size of "
|
||||
++ "arrays [" ++ show n ++ "] must be a natural number"
|
||||
|
||||
r <- initial1
|
||||
@ -264,11 +264,11 @@ groupIOVecsOf n maxIOVLen (D.Stream step state) =
|
||||
step' gst (GatherInitial st) = do
|
||||
when (n <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.groupIOVecsOf: the size of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.groupIOVecsOf: the size of "
|
||||
++ "groups [" ++ show n ++ "] must be a natural number"
|
||||
when (maxIOVLen <= 0) $
|
||||
-- XXX we can pass the module string from the higher level API
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.groupIOVecsOf: the number of "
|
||||
error $ "Streamly.Internal.Data.Array.Foreign.Mut.Type.groupIOVecsOf: the number of "
|
||||
++ "IOVec entries [" ++ show n ++ "] must be a natural number"
|
||||
r <- step (adaptState gst) st
|
||||
case r of
|
||||
|
@ -35,7 +35,7 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple' (..))
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Parser as PR
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as PRD
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as PRK
|
||||
|
||||
-- | A value of type '()' is encoded as @0@ in binary encoding.
|
||||
--
|
||||
|
@ -229,12 +229,12 @@ import Data.Semigroup (Semigroup((<>)))
|
||||
import Streamly.Internal.Data.Either.Strict
|
||||
(Either'(..), fromLeft', fromRight', isLeft', isRight')
|
||||
import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
|
||||
import Streamly.Internal.Data.Pipe.Types (Pipe (..), PipeState(..))
|
||||
import Streamly.Internal.Data.Pipe.Type (Pipe (..), PipeState(..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
|
||||
import qualified Data.Map.Strict as Map
|
||||
import qualified Streamly.Internal.Data.Pipe.Types as Pipe
|
||||
import qualified Streamly.Internal.Data.Pipe.Type as Pipe
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream.Enumeration as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as K
|
||||
import qualified Prelude
|
||||
@ -246,7 +246,7 @@ import Prelude hiding
|
||||
, reverse, iterate, init, and, or, lookup, (!!)
|
||||
, scanl, scanl1, replicate, concatMap, mconcat, foldMap, unzip
|
||||
, span, splitAt, break, mapM, zip)
|
||||
import Streamly.Internal.Data.Fold.Types
|
||||
import Streamly.Internal.Data.Fold.Type
|
||||
|
||||
-- $setup
|
||||
-- >>> :m
|
||||
|
@ -18,9 +18,9 @@ import Data.Coerce (coerce)
|
||||
#if __GLASGOW_HASKELL__ < 808
|
||||
import Data.Semigroup (Semigroup(..))
|
||||
#endif
|
||||
import Streamly.Internal.Data.Fold.Types (Fold)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold)
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as Fold
|
||||
import qualified Streamly.Internal.Data.Fold.Type as Fold
|
||||
|
||||
-- | The type @Tee m a b@ represents a left fold over an input stream of values
|
||||
-- of type @a@ to a single value of type @b@ in 'Monad' @m@.
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Fold.Types
|
||||
-- Module : Streamly.Internal.Data.Fold.Type
|
||||
-- Copyright : (c) 2019 Composewell Technologies
|
||||
-- (c) 2013 Gabriel Gonzalez
|
||||
-- License : BSD3
|
||||
@ -165,7 +165,7 @@
|
||||
-- then be used only for the case when the stream stops before the fold
|
||||
-- completes.
|
||||
|
||||
module Streamly.Internal.Data.Fold.Types
|
||||
module Streamly.Internal.Data.Fold.Type
|
||||
(
|
||||
-- * Types
|
||||
Step (..)
|
@ -199,12 +199,12 @@ import Control.Monad.Catch (MonadCatch)
|
||||
import Prelude
|
||||
hiding (any, all, take, takeWhile, sequence, concatMap, maybe, either)
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Parser.ParserK.Types (Parser)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Parser.ParserK.Type (Parser)
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as D
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as K
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as K
|
||||
|
||||
--
|
||||
-- $setup
|
||||
|
@ -163,15 +163,15 @@ where
|
||||
import Control.Exception (assert)
|
||||
import Control.Monad.Catch (MonadCatch, MonadThrow(..))
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
|
||||
import Prelude hiding
|
||||
(any, all, take, takeWhile, sequence, concatMap, maybe, either, span)
|
||||
import Streamly.Internal.Data.Parser.ParserD.Tee
|
||||
import Streamly.Internal.Data.Parser.ParserD.Types
|
||||
import Streamly.Internal.Data.Parser.ParserD.Type
|
||||
|
||||
--
|
||||
-- $setup
|
||||
|
@ -43,7 +43,7 @@ import Prelude
|
||||
hiding (any, all, takeWhile)
|
||||
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import Streamly.Internal.Data.Parser.ParserD.Types
|
||||
import Streamly.Internal.Data.Parser.ParserD.Type
|
||||
(Initial(..), Parser(..), Step(..), ParseError)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Parser.ParserD.Types
|
||||
-- Module : Streamly.Internal.Data.Parser.ParserD.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -11,7 +11,7 @@
|
||||
-- Streaming and backtracking parsers.
|
||||
--
|
||||
-- Parsers just extend folds. Please read the 'Fold' design notes in
|
||||
-- "Streamly.Internal.Data.Fold.Types" for background on the design.
|
||||
-- "Streamly.Internal.Data.Fold.Type" for background on the design.
|
||||
--
|
||||
-- = Parser Design
|
||||
--
|
||||
@ -109,7 +109,7 @@
|
||||
-- merge the resulting streams using different merge strategies (e.g.
|
||||
-- interleaving or serial).
|
||||
|
||||
module Streamly.Internal.Data.Parser.ParserD.Types
|
||||
module Streamly.Internal.Data.Parser.ParserD.Type
|
||||
(
|
||||
Initial (..)
|
||||
, Step (..)
|
||||
@ -138,10 +138,10 @@ import Control.Monad (MonadPlus(..))
|
||||
import Control.Monad.Catch (MonadCatch, try, throwM, MonadThrow)
|
||||
import Data.Bifunctor (Bifunctor(..))
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..), toList)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..), toList)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
|
||||
import Prelude hiding (concatMap)
|
||||
--
|
||||
@ -864,7 +864,7 @@ concatMap func (Parser stepL initialL extractL) = Parser step initial extract
|
||||
-- for small number of compositions but for a scalable implementation we need a
|
||||
-- CPS version.
|
||||
|
||||
-- | See documentation of 'Streamly.Internal.Data.Parser.ParserK.Types.Parser'.
|
||||
-- | See documentation of 'Streamly.Internal.Data.Parser.ParserK.Type.Parser'.
|
||||
--
|
||||
instance MonadThrow m => Monad (Parser m a) where
|
||||
{-# INLINE return #-}
|
||||
@ -873,7 +873,7 @@ instance MonadThrow m => Monad (Parser m a) where
|
||||
{-# INLINE (>>=) #-}
|
||||
(>>=) = flip concatMap
|
||||
|
||||
-- | See documentation of 'Streamly.Internal.Data.Parser.ParserK.Types.Parser'.
|
||||
-- | See documentation of 'Streamly.Internal.Data.Parser.ParserK.Type.Parser'.
|
||||
--
|
||||
instance MonadCatch m => MonadPlus (Parser m a) where
|
||||
{-# INLINE mzero #-}
|
@ -1,7 +1,7 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Parser.ParserK.Types
|
||||
-- Module : Streamly.Internal.Data.Parser.ParserK.Type
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -18,7 +18,7 @@
|
||||
-- The direct style representation does not allow for recursive definitions of
|
||||
-- "some" and "many" whereas CPS allows that.
|
||||
|
||||
module Streamly.Internal.Data.Parser.ParserK.Types
|
||||
module Streamly.Internal.Data.Parser.ParserK.Type
|
||||
(
|
||||
Parser (..)
|
||||
, yield
|
||||
@ -43,7 +43,7 @@ import Data.Semigroup ((<>))
|
||||
#endif
|
||||
import Streamly.Internal.Control.Exception
|
||||
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD.Types as D
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD.Type as D
|
||||
|
||||
-- | The parse driver result. The driver may stop with a final result, pause
|
||||
-- with a continuation to resume, or fail with an error.
|
@ -244,9 +244,9 @@ import Prelude
|
||||
|
||||
-- import Streamly.Prelude (MonadAsync, parallel)
|
||||
-- import Streamly.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Pipe.Types
|
||||
import Streamly.Internal.Data.Pipe.Type
|
||||
(Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
|
||||
-- import Streamly.Internal.Data.Array.Foreign.Types (Array)
|
||||
-- import Streamly.Internal.Data.Array.Foreign.Type (Array)
|
||||
-- import Streamly.Internal.Ring.Foreign (Ring)
|
||||
-- import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
-- import Streamly.Internal.Data.Stream.StreamK (IsStream())
|
||||
@ -256,7 +256,7 @@ import Streamly.Internal.Data.Pipe.Types
|
||||
|
||||
-- import Streamly.Internal.Data.Strict
|
||||
|
||||
-- import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
-- import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
-- import qualified Streamly.Prelude as S
|
||||
-- import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
-- import qualified Streamly.Internal.Data.Stream.StreamK as K
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "inline.hs"
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Pipe.Types
|
||||
-- Module : Streamly.Internal.Data.Pipe.Type
|
||||
-- Copyright : (c) 2019 Composewell Technologies
|
||||
-- License : BSD3
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
|
||||
module Streamly.Internal.Data.Pipe.Types
|
||||
module Streamly.Internal.Data.Pipe.Type
|
||||
( Step (..)
|
||||
, Pipe (..)
|
||||
, PipeState (..)
|
@ -47,7 +47,7 @@ where
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream(..))
|
||||
import Streamly.Internal.Data.SVar (defState)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import Streamly.Internal.Data.Producer.Type
|
||||
import Prelude hiding (concat)
|
||||
|
@ -42,7 +42,7 @@ import Streamly.Internal.Data.Producer.Type (Producer(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as ParserD
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as ParserK
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as ParserK
|
||||
|
||||
import Prelude hiding (read)
|
||||
|
||||
|
@ -66,8 +66,8 @@ import Prelude
|
||||
reverse, iterate, init, and, or, lookup, foldr1, (!!),
|
||||
scanl, scanl1, replicate, concatMap, mconcat, foldMap, unzip)
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..), Step(..))
|
||||
import Streamly.Internal.Data.Sink.Types (Sink(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..), Step(..))
|
||||
import Streamly.Internal.Data.Sink.Type (Sink(..))
|
||||
|
||||
import qualified Data.Map.Strict as Map
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Sink.Types
|
||||
-- Module : Streamly.Internal.Data.Sink.Type
|
||||
-- Copyright : (c) 2019 Composewell Technologies
|
||||
-- License : BSD3
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
|
||||
module Streamly.Internal.Data.Sink.Types
|
||||
module Streamly.Internal.Data.Sink.Type
|
||||
(
|
||||
Sink (..)
|
||||
)
|
@ -48,16 +48,16 @@ import Control.Monad.IO.Class (MonadIO, liftIO)
|
||||
import GHC.IO (unsafePerformIO)
|
||||
import Data.Functor.Identity (runIdentity)
|
||||
|
||||
import Streamly.Internal.Data.SmallArray.Types
|
||||
import Streamly.Internal.Data.SmallArray.Type
|
||||
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
|
||||
{-# NOINLINE bottomElement #-}
|
||||
bottomElement :: a
|
||||
|
@ -28,7 +28,7 @@
|
||||
-- The underlying type, 'SmallArray#', was introduced in GHC 7.10, so prior to
|
||||
-- that version, this module simply implements small arrays as 'Array'.
|
||||
|
||||
module Streamly.Internal.Data.SmallArray.Types
|
||||
module Streamly.Internal.Data.SmallArray.Type
|
||||
( SmallArray(..)
|
||||
, SmallMutableArray(..)
|
||||
, newSmallArray
|
@ -50,8 +50,8 @@ where
|
||||
import Control.Concurrent (threadDelay)
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Foreign.Storable (Storable)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold (..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold (..))
|
||||
import Streamly.Internal.Data.Stream.IsStream.Combinators (maxYields)
|
||||
import Streamly.Internal.Data.Stream.Prelude (fromStreamS, toStreamS)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
|
@ -156,14 +156,14 @@ import Streamly.Internal.Data.Stream.StreamD (fromStreamD, toStreamD)
|
||||
import Streamly.Internal.Data.Stream.StreamK (IsStream)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Stream.Parallel as Par
|
||||
import qualified Streamly.Internal.Data.Stream.Prelude as P
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as K
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as PRD
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as PRK
|
||||
import qualified System.IO as IO
|
||||
#ifdef USE_STREAMK_ONLY
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as S
|
||||
|
@ -89,7 +89,7 @@ where
|
||||
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Data.Void (Void)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold)
|
||||
import Streamly.Internal.Data.SVar (MonadAsync, Rate (..))
|
||||
import Streamly.Internal.Data.Stream.IsStream.Enumeration
|
||||
(Enumerable(..), enumerate, enumerateTo)
|
||||
|
@ -252,10 +252,10 @@ import Data.Heap (Entry(..))
|
||||
import Data.Kind (Type)
|
||||
import Data.Maybe (isNothing)
|
||||
import Foreign.Storable (Storable)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold (..), Fold2 (..))
|
||||
import Streamly.Internal.Data.Parser (Parser (..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold)
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array)
|
||||
import Streamly.Internal.Data.SVar (MonadAsync)
|
||||
import Streamly.Internal.Data.Stream.Ahead (ahead)
|
||||
import Streamly.Internal.Data.Stream.Async (async, wAsync)
|
||||
@ -285,9 +285,9 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
|
||||
import qualified Data.Heap as H
|
||||
import qualified Data.Map.Strict as Map
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
|
||||
import qualified Streamly.Internal.Data.Parser.ParserK.Type as PRK
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as PRD
|
||||
import qualified Streamly.Internal.Data.Stream.Parallel as Par
|
||||
import qualified Streamly.Internal.Data.Stream.Serial as Serial
|
||||
|
@ -216,8 +216,8 @@ import Data.Either (isLeft, isRight)
|
||||
import Data.Kind (Type)
|
||||
import Data.Maybe (isJust, fromJust)
|
||||
import Streamly.Internal.BaseCompat (fromLeft, fromRight)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold (..))
|
||||
import Streamly.Internal.Data.Pipe.Types (Pipe (..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold (..))
|
||||
import Streamly.Internal.Data.Pipe.Type (Pipe (..))
|
||||
import Streamly.Internal.Data.Stream.IsStream.Combinators
|
||||
( inspectMode, maxBuffer, maxThreads, rate, avgRate, minRate
|
||||
, maxRate, constRate)
|
||||
|
@ -58,7 +58,7 @@ import Prelude hiding (map)
|
||||
|
||||
import qualified Data.Set as Set
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
|
||||
import Streamly.Internal.Data.Stream.StreamK
|
||||
(IsStream(..), Stream, mkStream, foldStream, foldStreamShared, adapt)
|
||||
|
@ -69,7 +69,7 @@ import Control.Monad.Trans.Class (MonadTrans(..))
|
||||
import Prelude hiding (foldr, minimum, maximum)
|
||||
import qualified Prelude
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold (..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold (..))
|
||||
|
||||
#ifdef USE_STREAMK_ONLY
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as S
|
||||
|
@ -49,11 +49,11 @@ import Control.Monad.IO.Class (MonadIO(liftIO))
|
||||
import Data.IORef (newIORef, readIORef, mkWeakIORef, writeIORef)
|
||||
import Data.Maybe (isNothing)
|
||||
import Streamly.Internal.Data.Atomics (atomicModifyIORefCAS_)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
|
||||
import System.Mem (performMajorGC)
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
|
||||
|
@ -157,13 +157,13 @@ import Foreign.Storable (Storable(..))
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import GHC.Types (SPEC(..))
|
||||
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Parser (ParseError(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Parser as PR
|
||||
import qualified Streamly.Internal.Data.Parser.ParserD as PRD
|
||||
import qualified Streamly.Internal.Ring.Foreign as RB
|
||||
|
@ -133,16 +133,16 @@ import Foreign.Storable (Storable(..))
|
||||
import GHC.Types (SPEC(..))
|
||||
import qualified Control.Monad.Catch as MC
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Pipe.Types (Pipe(..), PipeState(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Pipe.Type (Pipe(..), PipeState(..))
|
||||
import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
|
||||
import Streamly.Internal.Data.Time.Units
|
||||
(TimeUnit64, toRelTime64, diffAbsTime64)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.IORef.Prim as Prim
|
||||
import qualified Streamly.Internal.Data.Pipe.Types as Pipe
|
||||
import qualified Streamly.Internal.Data.Pipe.Type as Pipe
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as K
|
||||
|
||||
import Prelude hiding
|
||||
|
@ -96,12 +96,12 @@ import GHC.Base (build)
|
||||
import GHC.Types (SPEC(..))
|
||||
import Prelude hiding (map, mapM, foldr, take, concatMap, takeWhile)
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..), Fold2(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..), Fold2(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step (..))
|
||||
import Streamly.Internal.Data.SVar (State, adaptState, defState)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -200,7 +200,7 @@ import qualified Prelude
|
||||
import Streamly.Internal.Data.SVar
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
|
||||
-- $setup
|
||||
-- >>> :m
|
||||
|
@ -178,7 +178,7 @@ import Data.IORef (newIORef, readIORef, mkWeakIORef, writeIORef)
|
||||
import Data.Maybe (isNothing)
|
||||
import Data.Void (Void)
|
||||
import GHC.Types (SPEC(..))
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.IOFinalizer
|
||||
(newIOFinalizer, runIOFinalizer, clearingIOFinalizer)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream(..), Step(..))
|
||||
@ -188,13 +188,13 @@ import System.Mem (performMajorGC)
|
||||
import qualified Prelude
|
||||
import qualified Control.Monad.Catch as MC
|
||||
import qualified Data.Tuple as Tuple
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK as K (uncons)
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
|
||||
import Streamly.Internal.Data.SVar
|
||||
import Streamly.Internal.Data.Unfold.Types
|
||||
import Streamly.Internal.Data.Unfold.Type
|
||||
import Prelude
|
||||
hiding (concat, map, mapM, takeWhile, take, filter, const, zipWith
|
||||
, drop, dropWhile)
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Unfold.Types
|
||||
-- Module : Streamly.Internal.Data.Unfold.Type
|
||||
-- Copyright : (c) 2019 Composewell Technologies
|
||||
-- License : BSD3
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
|
||||
module Streamly.Internal.Data.Unfold.Types
|
||||
module Streamly.Internal.Data.Unfold.Type
|
||||
( Unfold (..)
|
||||
, singletonM
|
||||
, singleton
|
@ -63,8 +63,8 @@ import Prelude hiding (read)
|
||||
|
||||
-- import Streamly.Data.Fold (Fold)
|
||||
import Streamly.Internal.BaseCompat (fromLeft, fromRight)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
-- import Streamly.Internal.Data.Array.Foreign.Types
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
-- import Streamly.Internal.Data.Array.Foreign.Type
|
||||
-- (Array(..), writeNUnsafe, defaultChunkSize, shrinkToFit,
|
||||
-- lpackArraysChunksOf)
|
||||
-- import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
@ -72,7 +72,7 @@ import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
|
||||
|
||||
-- import qualified Streamly.Data.Fold as FL
|
||||
-- import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
-- import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
-- import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as S
|
||||
@ -166,9 +166,9 @@ toChunks = toChunksWithBufferOf defaultChunkSize
|
||||
|
||||
-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
|
||||
-- device are performed using a buffer of size
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'. The
|
||||
-- size of arrays in the resulting stream are therefore less than or equal to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE readChunks #-}
|
||||
@ -343,7 +343,7 @@ fromStreamWithBufferOf n h m = fromChunks h $ S.arraysOf n m
|
||||
-- > write = 'writeWithBufferOf' A.defaultChunkSize
|
||||
--
|
||||
-- | Write a byte stream to a file handle. Accumulates the input in chunks of
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing.
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before writing.
|
||||
--
|
||||
-- NOTE: This may perform better than the 'write' fold, you can try this if you
|
||||
-- need some extra perf boost.
|
||||
@ -393,7 +393,7 @@ writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
|
||||
-- > write = 'writeWithBufferOf' A.defaultChunkSize
|
||||
--
|
||||
-- | Write a byte stream to a file handle. Accumulates the input in chunks of
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before writing
|
||||
-- to the IO device.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
|
@ -165,7 +165,7 @@ import GHC.IO.Handle.FD (fdToHandle)
|
||||
import Streamly.Prelude (SerialT)
|
||||
import Streamly.Internal.Data.Cont (contListMap)
|
||||
import Streamly.Internal.Data.Parser (Parser)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..))
|
||||
import System.IO (Handle, hClose)
|
||||
|
||||
import qualified Data.List.NonEmpty as NonEmpty
|
||||
|
@ -171,7 +171,7 @@ import GHC.IO.FD (fdFD, mkFD)
|
||||
import GHC.IO.Handle.FD (mkHandleFromFD)
|
||||
import Streamly.Prelude (SerialT)
|
||||
import Streamly.Internal.Data.Parser (Parser)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..))
|
||||
import System.IO (Handle, hClose, IOMode(ReadMode))
|
||||
#if !MIN_VERSION_base(4,10,0)
|
||||
import Control.Concurrent.MVar (readMVar)
|
||||
|
@ -130,8 +130,8 @@ import Prelude hiding (read)
|
||||
import qualified GHC.IO.FD as FD
|
||||
import qualified GHC.IO.Device as RawIO
|
||||
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Type (mutableArray)
|
||||
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
|
||||
|
@ -94,9 +94,9 @@ import Prelude hiding (read)
|
||||
import qualified Control.Monad.Catch as MC
|
||||
import qualified System.IO as SIO
|
||||
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Types
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type
|
||||
(Array(..), defaultChunkSize, writeNUnsafe)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
@ -104,7 +104,7 @@ import Streamly.Internal.Data.SVar (MonadAsync)
|
||||
-- import Streamly.Data.Fold (Fold)
|
||||
-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
import qualified Streamly.Internal.FileSystem.Handle as FH
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
@ -243,9 +243,9 @@ readChunksWithBufferOf = usingFile2 FH.readChunksWithBufferOf
|
||||
|
||||
-- | Unfolds a 'FilePath' into a stream of 'Word8' arrays. Requests to the IO
|
||||
-- device are performed using a buffer of size
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'. The
|
||||
-- size of arrays in the resulting stream are therefore less than or equal to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- /Pre-release/
|
||||
{-# INLINE readChunks #-}
|
||||
@ -262,7 +262,7 @@ readWithBufferOf = usingFile2 FH.readWithBufferOf
|
||||
|
||||
-- | Unfolds a file path into a byte stream. IO requests to the device are
|
||||
-- performed in sizes of
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE read #-}
|
||||
@ -382,7 +382,7 @@ writeWithBufferOf n path =
|
||||
-- > write = 'writeWithBufferOf' A.defaultChunkSize
|
||||
--
|
||||
-- | Write a byte stream to a file. Accumulates the input in chunks of up to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before writing to
|
||||
-- the IO device.
|
||||
--
|
||||
-- /Pre-release/
|
||||
|
@ -111,18 +111,18 @@ import Prelude hiding (read)
|
||||
|
||||
import Streamly.Prelude (MonadAsync)
|
||||
import Streamly.Data.Fold (Fold)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold2(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Types
|
||||
import Streamly.Internal.Data.Fold.Type (Fold2(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type
|
||||
(Array(..), writeNUnsafe, defaultChunkSize , unsafeFreezeWithShrink)
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Type (mutableArray)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
|
||||
import Streamly.Internal.Data.Array.Stream.Foreign (lpackArraysChunksOf)
|
||||
-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
|
||||
|
||||
import qualified Streamly.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as IA
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
@ -255,9 +255,9 @@ getBytes = toBytes stdin
|
||||
|
||||
-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
|
||||
-- device are performed using a buffer of size
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'. The
|
||||
-- size of arrays in the resulting stream are therefore less than or equal to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE readChunks #-}
|
||||
@ -294,7 +294,7 @@ toBytesWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
|
||||
--
|
||||
-- | Unfolds a file handle into a byte stream. IO requests to the device are
|
||||
-- performed in sizes of
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE read #-}
|
||||
@ -411,7 +411,7 @@ fromBytesWithBufferOf n h m = fromChunks h $ S.arraysOf n m
|
||||
-- > write = 'writeWithBufferOf' A.defaultChunkSize
|
||||
--
|
||||
-- | Write a byte stream to a file handle. Accumulates the input in chunks of
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing.
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before writing.
|
||||
--
|
||||
-- NOTE: This may perform better than the 'write' fold, you can try this if you
|
||||
-- need some extra perf boost.
|
||||
@ -469,7 +469,7 @@ writeWithBufferOf2 n = FL.chunksOf2 n (writeNUnsafe n) writeChunks2
|
||||
-- > write = 'writeWithBufferOf' A.defaultChunkSize
|
||||
--
|
||||
-- | Write a byte stream to a file handle. Accumulates the input in chunks of
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing
|
||||
-- up to 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before writing
|
||||
-- to the IO device.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
|
@ -103,13 +103,13 @@ import Network.Socket
|
||||
socket)
|
||||
import Prelude hiding (read)
|
||||
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..), defaultChunkSize, writeNUnsafe)
|
||||
import Streamly.Internal.Data.Fold.Types (Fold(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..), defaultChunkSize, writeNUnsafe)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.SVar (fork)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Network.Socket (SockSpec(..), accept, connections)
|
||||
import Streamly.Prelude (MonadAsync)
|
||||
|
||||
@ -119,7 +119,7 @@ import qualified Network.Socket as Net
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Prelude as S
|
||||
import qualified Streamly.Network.Socket as SK
|
||||
import qualified Streamly.Internal.Network.Socket as ISK
|
||||
|
@ -88,22 +88,22 @@ import Prelude hiding (read)
|
||||
import qualified Network.Socket as Net
|
||||
|
||||
import Streamly.Prelude (MonadAsync)
|
||||
import Streamly.Internal.Data.Unfold.Types (Unfold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Stream.Foreign (lpackArraysChunksOf)
|
||||
import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
|
||||
import Streamly.Internal.Data.Array.Foreign.Type (Array(..))
|
||||
import Streamly.Internal.Data.Array.Foreign.Mut.Type (mutableArray)
|
||||
import Streamly.Internal.Data.Stream.Serial (SerialT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
|
||||
import Streamly.Data.Fold (Fold)
|
||||
-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
|
||||
|
||||
import qualified Streamly.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Types as FL
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as IA
|
||||
import qualified Streamly.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Prelude as S
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
|
||||
@ -381,9 +381,9 @@ readChunksWithBufferOf = Unfold step return
|
||||
|
||||
-- | Unfolds a socket into a stream of 'Word8' arrays. Requests to the socket
|
||||
-- are performed using a buffer of size
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'. The
|
||||
-- size of arrays in the resulting stream are therefore less than or equal to
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE readChunks #-}
|
||||
@ -430,7 +430,7 @@ readWithBufferOf = UF.concat readChunksWithBufferOf A.read
|
||||
|
||||
-- | Unfolds a 'Socket' into a byte stream. IO requests to the socket are
|
||||
-- performed in sizes of
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'.
|
||||
--
|
||||
-- @since 0.7.0
|
||||
{-# INLINE read #-}
|
||||
|
@ -41,7 +41,7 @@ import Prelude hiding (length, concat)
|
||||
|
||||
import Control.Monad.IO.Class (MonadIO(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
|
||||
-- | A ring buffer is a mutable array of fixed size. Initially the array is
|
||||
-- empty, with ringStart pointing at the start of allocated memory. We call the
|
||||
|
@ -88,7 +88,7 @@ import Streamly.Internal.Data.Stream.IsStream (IsStream)
|
||||
import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as S
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD as D
|
||||
|
||||
|
@ -64,9 +64,9 @@
|
||||
-- = Programmer Notes
|
||||
--
|
||||
-- Read IO requests to connected stream sockets are performed in chunks of
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. Unless specified
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize'. Unless specified
|
||||
-- otherwise in the API, writes are collected into chunks of
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before they are
|
||||
-- 'Streamly.Internal.Data.Array.Foreign.Type.defaultChunkSize' before they are
|
||||
-- written to the socket. APIs are provided to control the chunking behavior.
|
||||
--
|
||||
-- > import qualified Streamly.Network.Socket as SK
|
||||
|
@ -439,31 +439,31 @@ library
|
||||
-- streamly-core-stream
|
||||
, Streamly.Internal.Data.SVar
|
||||
, Streamly.Internal.Data.Stream.StreamK.Type
|
||||
, Streamly.Internal.Data.Fold.Types
|
||||
, Streamly.Internal.Data.Fold.Type
|
||||
, Streamly.Internal.Data.Stream.StreamD.Step
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type
|
||||
, Streamly.Internal.Data.Stream.StreamDK.Type
|
||||
, Streamly.Internal.Data.Unfold.Types
|
||||
, Streamly.Internal.Data.Unfold.Type
|
||||
, Streamly.Internal.Data.Producer.Type
|
||||
, Streamly.Internal.Data.Producer
|
||||
, Streamly.Internal.Data.Producer.Source
|
||||
, Streamly.Internal.Data.Sink.Types
|
||||
, Streamly.Internal.Data.Parser.ParserK.Types
|
||||
, Streamly.Internal.Data.Parser.ParserD.Types
|
||||
, Streamly.Internal.Data.Pipe.Types
|
||||
, Streamly.Internal.Data.Sink.Type
|
||||
, Streamly.Internal.Data.Parser.ParserK.Type
|
||||
, Streamly.Internal.Data.Parser.ParserD.Type
|
||||
, Streamly.Internal.Data.Pipe.Type
|
||||
|
||||
-- Unboxed IORef
|
||||
, Streamly.Internal.Data.IORef.Prim
|
||||
|
||||
-- streamly-core-array
|
||||
-- May depend on streamly-core-stream
|
||||
, Streamly.Internal.Data.Array.Foreign.Mut.Types
|
||||
, Streamly.Internal.Data.Array.Foreign.Types
|
||||
, Streamly.Internal.Data.Array.Prim.Mut.Types
|
||||
, Streamly.Internal.Data.Array.Prim.Types
|
||||
, Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
|
||||
, Streamly.Internal.Data.Array.Prim.Pinned.Types
|
||||
, Streamly.Internal.Data.SmallArray.Types
|
||||
, Streamly.Internal.Data.Array.Foreign.Mut.Type
|
||||
, Streamly.Internal.Data.Array.Foreign.Type
|
||||
, Streamly.Internal.Data.Array.Prim.Mut.Type
|
||||
, Streamly.Internal.Data.Array.Prim.Type
|
||||
, Streamly.Internal.Data.Array.Prim.Pinned.Mut.Type
|
||||
, Streamly.Internal.Data.Array.Prim.Pinned.Type
|
||||
, Streamly.Internal.Data.SmallArray.Type
|
||||
|
||||
-- streamly-base-streams
|
||||
, Streamly.Internal.Data.Stream.StreamK
|
||||
|
@ -29,18 +29,18 @@ type Array = A.SmallArray
|
||||
import Data.Word(Word8)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as A
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
import qualified Streamly.Internal.Data.Array.Stream.Foreign as AS
|
||||
type Array = A.Array
|
||||
#elif defined(DATA_ARRAY_PRIM_PINNED)
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned as A
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Pinned.Type as A
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
type Array = A.Array
|
||||
#elif defined(DATA_ARRAY_PRIM)
|
||||
import qualified Streamly.Internal.Data.Array.Prim as A
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Types as A
|
||||
import qualified Streamly.Internal.Data.Array.Prim.Type as A
|
||||
import qualified Streamly.Internal.Data.Stream.IsStream as IP
|
||||
type Array = A.Array
|
||||
#else
|
||||
|
@ -19,7 +19,7 @@ import Streamly.Prelude (SerialT)
|
||||
import Test.QuickCheck (Property)
|
||||
import Test.QuickCheck.Monadic (monadicIO, assert, run)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as Array
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as Array
|
||||
import qualified Streamly.Internal.Data.Unfold as Unfold
|
||||
import qualified Streamly.Internal.Network.Inet.TCP as TCP
|
||||
import qualified Streamly.Internal.Network.Socket as Socket
|
||||
|
@ -19,7 +19,7 @@ import Streamly.Prelude (SerialT)
|
||||
import Test.QuickCheck (Property)
|
||||
import Test.QuickCheck.Monadic (monadicIO, assert, run)
|
||||
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Types as Array
|
||||
import qualified Streamly.Internal.Data.Array.Foreign.Type as Array
|
||||
import qualified Streamly.Internal.Network.Inet.TCP as TCP
|
||||
import qualified Streamly.Internal.Network.Socket as Socket
|
||||
import qualified Streamly.Internal.Unicode.Stream as Unicode
|
||||
|
Loading…
Reference in New Issue
Block a user