mirror of
https://github.com/composewell/streamly.git
synced 2024-08-16 15:00:25 +03:00
Move StreamK and StreamD folder up (#2543)
This commit is contained in:
parent
e2d5628204
commit
1c584e545a
4
.github/workflows/regression-check.yml
vendored
4
.github/workflows/regression-check.yml
vendored
@ -26,8 +26,8 @@ jobs:
|
||||
Data.Fold.Window
|
||||
Data.Parser
|
||||
Data.ParserK
|
||||
Data.Stream.StreamD
|
||||
Data.Stream.StreamK:6
|
||||
Data.StreamD
|
||||
Data.StreamK:6
|
||||
Data.Unfold
|
||||
Data.Stream
|
||||
Data.Stream.Concurrent
|
||||
|
@ -461,7 +461,7 @@ inspect $ 'unfoldManyRepl `hasNoType` ''SPEC
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
moduleName :: String
|
||||
moduleName = "Data.Stream.StreamD"
|
||||
moduleName = "Data.StreamD"
|
||||
|
||||
o_1_space :: [Benchmark]
|
||||
o_1_space =
|
||||
|
@ -632,7 +632,7 @@ filterAllInNestedList str = do
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
moduleName :: String
|
||||
moduleName = "Data.Stream.StreamK"
|
||||
moduleName = "Data.StreamK"
|
||||
|
||||
o_1_space_generation :: Int -> Benchmark
|
||||
o_1_space_generation streamLen =
|
||||
|
@ -18,7 +18,7 @@ import Prelude hiding ()
|
||||
-- import qualified Prelude as P
|
||||
-- import qualified Data.List as List
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Alt as S
|
||||
import qualified Streamly.Internal.Data.StreamK.Alt as S
|
||||
-- import qualified Streamly.Internal.Data.Stream.Common as SP
|
||||
-- import qualified Streamly.Internal.Data.SVar as S
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- |
|
||||
-- Module : Streamly.Benchmark.Data.Stream.StreamK
|
||||
-- Module : Streamly.Benchmark.Data.StreamK
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
--
|
||||
-- License : BSD3
|
||||
|
@ -39,7 +39,7 @@ import Streamly.Benchmark.Common.Handle
|
||||
|
||||
#ifdef INSPECTION
|
||||
import Streamly.Internal.Data.Unbox (Unbox)
|
||||
import Streamly.Internal.Data.Stream.StreamD (Step(..))
|
||||
import Streamly.Internal.Data.Stream (Step(..))
|
||||
import qualified Streamly.Internal.Data.Fold as Fold
|
||||
import qualified Streamly.Internal.Data.Tuple.Strict as Strict
|
||||
import qualified Streamly.Internal.Data.Array as Array
|
||||
|
@ -60,9 +60,9 @@ rtsOpts exeName benchName0 = unwords [general, exeSpecific, benchSpecific]
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
| "Data.Stream.StreamD/o-n-space.elimination.toList" == benchName =
|
||||
| "Data.StreamD/o-n-space.elimination.toList" == benchName =
|
||||
"-K2M"
|
||||
| "Data.Stream.StreamK/o-n-space.elimination.toList" == benchName =
|
||||
| "Data.StreamK/o-n-space.elimination.toList" == benchName =
|
||||
"-K2M"
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -467,7 +467,7 @@ benchmark Data.ParserK.Chunked.Generic
|
||||
-- Raw Streams
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
benchmark Data.Stream.StreamD
|
||||
benchmark Data.StreamD
|
||||
import: bench-options
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: Streamly/Benchmark/Data/Stream
|
||||
@ -475,7 +475,7 @@ benchmark Data.Stream.StreamD
|
||||
if impl(ghcjs)
|
||||
buildable: False
|
||||
|
||||
benchmark Data.Stream.StreamK
|
||||
benchmark Data.StreamK
|
||||
import: bench-options
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: Streamly/Benchmark/Data/Stream
|
||||
@ -491,7 +491,7 @@ benchmark Data.Stream.ToStreamK
|
||||
if !flag(dev) || impl(ghcjs)
|
||||
buildable: False
|
||||
|
||||
benchmark Data.Stream.StreamK.Alt
|
||||
benchmark Data.StreamK.Alt
|
||||
import: bench-options
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: Streamly/Benchmark/Data/Stream
|
||||
|
@ -42,9 +42,6 @@ module Streamly.Data.Stream
|
||||
-- * Construction
|
||||
-- | Functions ending in the general shape @b -> Stream m a@.
|
||||
--
|
||||
-- See also: "Streamly.Internal.Data.Stream.StreamD.Generate" for
|
||||
-- @Pre-release@ functions.
|
||||
--
|
||||
-- Useful Idioms:
|
||||
--
|
||||
-- >>> fromIndices f = fmap f $ Stream.enumerateFrom 0
|
||||
@ -117,8 +114,6 @@ module Streamly.Data.Stream
|
||||
-- | Functions ending in the general shape @Stream m a -> m b@ or @Stream m
|
||||
-- a -> m (b, Stream m a)@
|
||||
--
|
||||
-- See also: "Streamly.Internal.Data.Stream.StreamD.Eliminate" for @Pre-release@
|
||||
-- functions.
|
||||
|
||||
-- EXPLANATION: In imperative terms a fold can be considered as a loop over the stream
|
||||
-- that reduces the stream to a single value.
|
||||
@ -259,8 +254,6 @@ module Streamly.Data.Stream
|
||||
-- * Scanning
|
||||
-- | Stateful one-to-one transformations.
|
||||
--
|
||||
-- See also: "Streamly.Internal.Data.Stream.StreamD.Transform" for
|
||||
-- @Pre-release@ functions.
|
||||
|
||||
{-
|
||||
-- ** Left scans
|
||||
@ -485,9 +478,6 @@ module Streamly.Data.Stream
|
||||
-- For example, instead of calling them on a stream of chars call them on a
|
||||
-- stream of arrays before flattening it to a stream of chars.
|
||||
--
|
||||
-- See also: "Streamly.Internal.Data.Stream.StreamD.Exception" for
|
||||
-- @Pre-release@ functions.
|
||||
|
||||
, onException
|
||||
, handle
|
||||
|
||||
|
@ -39,7 +39,7 @@ module Streamly.Data.Unfold
|
||||
|
||||
-- * Unfolds
|
||||
-- One to one correspondence with
|
||||
-- "Streamly.Internal.Data.Stream.StreamD.Generate"
|
||||
-- "Streamly.Internal.Data.Stream.Generate"
|
||||
|
||||
-- ** Basic Constructors
|
||||
, unfoldrM
|
||||
|
@ -59,7 +59,7 @@ import GHC.IO (unsafePerformIO)
|
||||
import Text.Read (readPrec)
|
||||
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.System.IO (unsafeInlineIO)
|
||||
|
||||
@ -68,8 +68,8 @@ import qualified Streamly.Internal.Data.Fold.Type as FL
|
||||
import qualified Streamly.Internal.Data.Producer.Type as Producer
|
||||
import qualified Streamly.Internal.Data.Producer as Producer
|
||||
import qualified Streamly.Internal.Data.Ring.Generic as RB
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Generate as D
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as D
|
||||
import qualified Text.ParserCombinators.ReadPrec as ReadPrec
|
||||
|
||||
import Prelude hiding (Foldable(..), read)
|
||||
|
@ -105,7 +105,7 @@ import GHC.IO (unsafePerformIO)
|
||||
import GHC.Ptr (Ptr(..))
|
||||
import Streamly.Internal.Data.MutArray.Type (MutArray(..), MutableByteArray)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Unbox (Unbox(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Text.Read (readPrec)
|
||||
@ -114,9 +114,9 @@ import Prelude hiding (Foldable(..), read, unlines, splitAt)
|
||||
|
||||
import qualified GHC.Exts as Exts
|
||||
import qualified Streamly.Internal.Data.MutArray.Type as MA
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Generate as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as D
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Unbox as Unboxed
|
||||
import qualified Streamly.Internal.Data.Unfold.Type as Unfold
|
||||
import qualified Text.ParserCombinators.ReadPrec as ReadPrec
|
||||
|
@ -240,7 +240,7 @@ import Streamly.Internal.Data.Pipe.Type (Pipe (..), PipeState(..))
|
||||
import Streamly.Internal.Data.Unbox (Unbox, sizeOf)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
|
||||
import qualified Prelude
|
||||
import qualified Streamly.Internal.Data.MutArray.Type as MA
|
||||
@ -248,7 +248,7 @@ import qualified Streamly.Internal.Data.Array.Type as Array
|
||||
import qualified Streamly.Internal.Data.Fold.Window as Fold
|
||||
import qualified Streamly.Internal.Data.Pipe.Type as Pipe
|
||||
import qualified Streamly.Internal.Data.Ring as Ring
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as StreamD
|
||||
import qualified Streamly.Internal.Data.Stream.Type as StreamD
|
||||
|
||||
import Prelude hiding
|
||||
( Foldable(..), filter, drop, dropWhile, take, takeWhile, zipWith
|
||||
|
@ -452,7 +452,7 @@ import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Refold.Type (Refold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
|
||||
import Prelude hiding (Foldable(..), concatMap, filter, map, take)
|
||||
|
||||
|
@ -47,7 +47,7 @@ import Streamly.Internal.Data.Unbox
|
||||
, sizeOf
|
||||
)
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
|
||||
-- | An 'IORef' holds a single 'Unbox'-able value.
|
||||
newtype IORef a = IORef MutableByteArray
|
||||
|
@ -66,19 +66,19 @@ where
|
||||
import Control.Arrow (second)
|
||||
import Data.Functor.Identity (Identity, runIdentity)
|
||||
import GHC.Exts (IsList(..), IsString(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
( CrossStream
|
||||
, mkCross
|
||||
, unCross
|
||||
)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Text.Read
|
||||
( Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec
|
||||
, readListPrecDefault)
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Generate as Stream
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as Stream
|
||||
|
||||
-- XXX Rename to PureStream.
|
||||
|
||||
|
@ -182,15 +182,15 @@ import GHC.Int (Int(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Producer.Type (Producer (..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.SVar.Type (adaptState)
|
||||
|
||||
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.StreamD.Generate as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Lift as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as D
|
||||
import qualified Streamly.Internal.Data.Stream.Lift as D
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
|
||||
import Prelude hiding (read, length)
|
||||
|
||||
|
@ -256,17 +256,17 @@ import GHC.Ptr (Ptr(..))
|
||||
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Producer.Type (Producer (..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type (StreamK)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.StreamK.Type (StreamK)
|
||||
import Streamly.Internal.Data.SVar.Type (adaptState, defState)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.System.IO (arrayPayloadSize, defaultChunkSize)
|
||||
|
||||
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.StreamD.Lift as D
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Lift as D
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Unbox as Unboxed
|
||||
import qualified Prelude
|
||||
|
||||
|
@ -266,12 +266,12 @@ import Streamly.Internal.Data.SVar.Type (defState)
|
||||
import Streamly.Internal.Data.Either.Strict (Either'(..))
|
||||
import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
|
||||
import qualified Data.Foldable as Foldable
|
||||
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.StreamD.Generate as D
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as D
|
||||
|
||||
import Prelude hiding
|
||||
(any, all, take, takeWhile, sequence, concatMap, maybe, either, span
|
||||
|
@ -261,8 +261,8 @@ import qualified Streamly.Internal.Data.Parser.ParserK.Type as K
|
||||
import Streamly.Internal.Data.StreamK (Stream)
|
||||
import qualified Streamly.Internal.Data.StreamK as Stream
|
||||
#else
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as Stream
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import qualified Streamly.Internal.Data.Stream.Type as Stream
|
||||
#endif
|
||||
|
||||
import Prelude hiding
|
||||
|
@ -36,8 +36,8 @@ where
|
||||
|
||||
#include "inline.hs"
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream(..))
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Type (Stream(..))
|
||||
import Streamly.Internal.Data.SVar.Type (defState)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
|
@ -38,7 +38,7 @@ import GHC.Exts (SpecConstrAnnotation(..))
|
||||
import GHC.Types (SPEC(..))
|
||||
import Streamly.Internal.Data.Parser (ParseError(..), Step(..))
|
||||
import Streamly.Internal.Data.Producer.Type (Producer(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Parser as ParserD
|
||||
-- import qualified Streamly.Internal.Data.Parser.ParserK.Type as ParserK
|
||||
|
@ -33,7 +33,7 @@ where
|
||||
#include "inline.hs"
|
||||
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
import Prelude hiding (concat, map)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -84,8 +84,8 @@ import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
|
||||
import GHC.Ptr (Ptr(..))
|
||||
import Streamly.Internal.Data.MutArray.Type (MutArray)
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..), Step(..), lmap)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.System.IO (unsafeInlineIO)
|
||||
|
||||
|
@ -26,7 +26,7 @@ module Streamly.Internal.Data.Ring.Generic
|
||||
#include "assert.hs"
|
||||
|
||||
import Control.Monad.IO.Class (liftIO, MonadIO)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.MutArray.Generic
|
||||
@ -36,7 +36,7 @@ import Streamly.Internal.Data.MutArray.Generic
|
||||
, putIndexUnsafe
|
||||
, putSliceUnsafe
|
||||
)
|
||||
-- import qualified Streamly.Internal.Data.Stream.StreamD.Type as Stream
|
||||
-- import qualified Streamly.Internal.Data.Stream.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Fold.Type as Fold
|
||||
|
||||
-- XXX Use MutableArray rather than keeping a MutArray here.
|
||||
|
@ -17,26 +17,26 @@
|
||||
|
||||
module Streamly.Internal.Data.Stream
|
||||
(
|
||||
module Streamly.Internal.Data.Stream.StreamD.Type
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Eliminate
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Exception
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Lift
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Transformer
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Nesting
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Top
|
||||
, module Streamly.Internal.Data.Stream.StreamD.Container
|
||||
module Streamly.Internal.Data.Stream.Type
|
||||
, module Streamly.Internal.Data.Stream.Generate
|
||||
, module Streamly.Internal.Data.Stream.Eliminate
|
||||
, module Streamly.Internal.Data.Stream.Exception
|
||||
, module Streamly.Internal.Data.Stream.Lift
|
||||
, module Streamly.Internal.Data.Stream.Transformer
|
||||
, module Streamly.Internal.Data.Stream.Nesting
|
||||
, module Streamly.Internal.Data.Stream.Transform
|
||||
, module Streamly.Internal.Data.Stream.Top
|
||||
, module Streamly.Internal.Data.Stream.Container
|
||||
)
|
||||
where
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
import Streamly.Internal.Data.Stream.StreamD.Eliminate
|
||||
import Streamly.Internal.Data.Stream.StreamD.Exception
|
||||
import Streamly.Internal.Data.Stream.StreamD.Lift
|
||||
import Streamly.Internal.Data.Stream.StreamD.Transformer
|
||||
import Streamly.Internal.Data.Stream.StreamD.Nesting
|
||||
import Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
import Streamly.Internal.Data.Stream.StreamD.Top
|
||||
import Streamly.Internal.Data.Stream.StreamD.Container
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
import Streamly.Internal.Data.Stream.Generate
|
||||
import Streamly.Internal.Data.Stream.Eliminate
|
||||
import Streamly.Internal.Data.Stream.Exception
|
||||
import Streamly.Internal.Data.Stream.Lift
|
||||
import Streamly.Internal.Data.Stream.Transformer
|
||||
import Streamly.Internal.Data.Stream.Nesting
|
||||
import Streamly.Internal.Data.Stream.Transform
|
||||
import Streamly.Internal.Data.Stream.Top
|
||||
import Streamly.Internal.Data.Stream.Container
|
||||
|
@ -32,8 +32,8 @@ where
|
||||
|
||||
import Streamly.Internal.Data.Fold.Type (Fold (..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
|
||||
import Prelude hiding (Foldable(..), repeat)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Container
|
||||
-- Module : Streamly.Internal.Data.Stream.Container
|
||||
-- Copyright : (c) 2019 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -9,7 +9,7 @@
|
||||
--
|
||||
-- Stream operations that require transformers or containers like Set or Map.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Container
|
||||
module Streamly.Internal.Data.Stream.Container
|
||||
(
|
||||
nub
|
||||
|
||||
@ -30,8 +30,8 @@ import Control.Monad.IO.Class (MonadIO)
|
||||
import Control.Monad.Trans.State.Strict (get, put)
|
||||
import Data.Function ((&))
|
||||
import Data.Maybe (isJust)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
(Stream(..), mkCross, unCross)
|
||||
|
||||
import qualified Data.Map.Strict as Map
|
||||
@ -39,11 +39,11 @@ import qualified Data.Set as Set
|
||||
import qualified Streamly.Data.Fold as Fold
|
||||
import qualified Streamly.Internal.Data.Array.Generic as Array
|
||||
import qualified Streamly.Internal.Data.MutArray.Type as MA
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Nesting as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Generate as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Transform as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Transformer as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Nesting as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Transform as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Transformer as Stream
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Eliminate
|
||||
-- Module : Streamly.Internal.Data.Stream.Eliminate
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- (c) Roman Leshchinskiy 2008-2010
|
||||
-- License : BSD-3-Clause
|
||||
@ -11,7 +11,7 @@
|
||||
-- A few functions in this module have been adapted from the vector package
|
||||
-- (c) Roman Leshchinskiy.
|
||||
--
|
||||
module Streamly.Internal.Data.Stream.StreamD.Eliminate
|
||||
module Streamly.Internal.Data.Stream.Eliminate
|
||||
(
|
||||
-- * Running a 'Fold'
|
||||
fold
|
||||
@ -99,15 +99,15 @@ import qualified Streamly.Internal.Data.Array.Type as Array
|
||||
import qualified Streamly.Internal.Data.Fold as Fold
|
||||
import qualified Streamly.Internal.Data.Parser as PR
|
||||
import qualified Streamly.Internal.Data.Parser as PRD
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Generate as StreamD
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Nesting as Nesting
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Transform as StreamD
|
||||
import qualified Streamly.Internal.Data.Stream.Generate as StreamD
|
||||
import qualified Streamly.Internal.Data.Stream.Nesting as Nesting
|
||||
import qualified Streamly.Internal.Data.Stream.Transform as StreamD
|
||||
|
||||
import Prelude hiding
|
||||
( Foldable(..), all, any, head, last, lookup, mapM, mapM_
|
||||
, notElem, splitAt, tail, (!!))
|
||||
import Data.Foldable (length)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
||||
@ -820,8 +820,6 @@ isSuffixOfUnbox suffix stream =
|
||||
-- stripSuffix on that especially if the elements have a Storable or Prim
|
||||
-- instance.
|
||||
--
|
||||
-- See also "Streamly.Internal.Data.Stream.StreamD.Reduce.dropSuffix".
|
||||
--
|
||||
-- Space: @O(n)@, buffers the entire input stream as well as the suffix
|
||||
--
|
||||
-- /Pre-release/
|
@ -1,13 +1,13 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Exception
|
||||
-- Module : Streamly.Internal.Data.Stream.Exception
|
||||
-- Copyright : (c) 2020 Composewell Technologies and Contributors
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Exception
|
||||
module Streamly.Internal.Data.Stream.Exception
|
||||
(
|
||||
gbracket_
|
||||
, gbracket
|
||||
@ -36,7 +36,7 @@ import Streamly.Internal.Data.IOFinalizer
|
||||
|
||||
import qualified Control.Monad.Catch as MC
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
-- Module : Streamly.Internal.Data.Stream.Generate
|
||||
-- Copyright : (c) 2020 Composewell Technologies and Contributors
|
||||
-- (c) Roman Leshchinskiy 2008-2010
|
||||
-- License : BSD-3-Clause
|
||||
@ -12,7 +12,7 @@
|
||||
-- A few combinators in this module have been adapted from the vector package
|
||||
-- (c) Roman Leshchinskiy. See the notes in specific combinators.
|
||||
--
|
||||
module Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
module Streamly.Internal.Data.Stream.Generate
|
||||
(
|
||||
-- * Primitives
|
||||
nil
|
||||
@ -135,7 +135,7 @@ import Data.Ratio
|
||||
import Data.Word
|
||||
import Numeric.Natural
|
||||
import Prelude hiding (iterate, repeat, replicate, take, takeWhile)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Lift
|
||||
-- Module : Streamly.Internal.Data.Stream.Lift
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -9,7 +9,7 @@
|
||||
--
|
||||
-- Transform the underlying monad of a stream.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Lift
|
||||
module Streamly.Internal.Data.Stream.Lift
|
||||
(
|
||||
-- * Generalize Inner Monad
|
||||
morphInner
|
||||
@ -27,7 +27,7 @@ where
|
||||
import Data.Functor.Identity (Identity(..))
|
||||
import Streamly.Internal.Data.SVar.Type (adaptState)
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -35,7 +35,7 @@ import Streamly.Internal.Data.Unbox (Unbox, sizeOf)
|
||||
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.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.MutArray.Type as MArray
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Nesting
|
||||
-- Module : Streamly.Internal.Data.Stream.Nesting
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- (c) Roman Leshchinskiy 2008-2010
|
||||
-- License : BSD-3-Clause
|
||||
@ -24,7 +24,7 @@
|
||||
-- The zipWithM combinator in this module has been adapted from the vector
|
||||
-- package (c) Roman Leshchinskiy.
|
||||
--
|
||||
module Streamly.Internal.Data.Stream.StreamD.Nesting
|
||||
module Streamly.Internal.Data.Stream.Nesting
|
||||
(
|
||||
-- * Generate
|
||||
-- | Combining streams to generate streams.
|
||||
@ -197,9 +197,9 @@ import qualified Streamly.Internal.Data.Parser as PR
|
||||
import qualified Streamly.Internal.Data.Parser as PRD
|
||||
import qualified Streamly.Internal.Data.Ring as RB
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
import Streamly.Internal.Data.Stream.Transform
|
||||
(intersperse, intersperseMSuffix)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
import Prelude hiding (concatMap, mapM, zipWith)
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Step
|
||||
-- Module : Streamly.Internal.Data.Stream.Step
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Step
|
||||
module Streamly.Internal.Data.Stream.Step
|
||||
(
|
||||
-- * The stream type
|
||||
Step (..)
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Top
|
||||
-- Module : Streamly.Internal.Data.Stream.Top
|
||||
-- Copyright : (c) 2020 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -9,7 +9,7 @@
|
||||
--
|
||||
-- Top level module that can depend on all other lower level Stream modules.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Top
|
||||
module Streamly.Internal.Data.Stream.Top
|
||||
(
|
||||
-- * Transformation
|
||||
-- ** Sampling
|
||||
@ -49,13 +49,13 @@ import Control.Monad.IO.Class (MonadIO(..))
|
||||
import Data.IORef (newIORef, readIORef, modifyIORef')
|
||||
import Streamly.Internal.Data.Fold.Type (Fold)
|
||||
import Streamly.Internal.Data.Stream.Common ()
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream, cross)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream, cross)
|
||||
|
||||
import qualified Data.List as List
|
||||
import qualified Streamly.Internal.Data.Fold as Fold
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Nesting as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.StreamD.Transform as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Type as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Nesting as Stream
|
||||
import qualified Streamly.Internal.Data.Stream.Transform as Stream
|
||||
|
||||
import Prelude hiding (filter, zipWith, concatMap, concat)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
-- Module : Streamly.Internal.Data.Stream.Transform
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- (c) Roman Leshchinskiy 2008-2010
|
||||
-- License : BSD-3-Clause
|
||||
@ -13,7 +13,7 @@
|
||||
-- A few functions in this module have been adapted from the vector package
|
||||
-- (c) Roman Leshchinskiy. See the notes in specific combinators.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
module Streamly.Internal.Data.Stream.Transform
|
||||
(
|
||||
-- * Piping
|
||||
-- | Pass through a 'Pipe'.
|
||||
@ -173,15 +173,15 @@ import Streamly.Internal.System.IO (defaultChunkSize)
|
||||
import qualified Streamly.Internal.Data.Array.Type as A
|
||||
import qualified Streamly.Internal.Data.Fold as FL
|
||||
import qualified Streamly.Internal.Data.Pipe.Type as Pipe
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
|
||||
import Prelude hiding
|
||||
( drop, dropWhile, filter, map, mapM, reverse
|
||||
, scanl, scanl1, sequence, take, takeWhile, zipWith)
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
import Streamly.Internal.Data.Stream.Generate
|
||||
(absTimesWith, relTimesWith)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Transformer
|
||||
-- Module : Streamly.Internal.Data.Stream.Transformer
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- License : BSD-3-Clause
|
||||
-- Maintainer : streamly@composewell.com
|
||||
@ -9,7 +9,7 @@
|
||||
--
|
||||
-- Transform the underlying monad of a stream using a monad transfomer.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Transformer
|
||||
module Streamly.Internal.Data.Stream.Transformer
|
||||
(
|
||||
foldlT
|
||||
, foldrT
|
||||
@ -35,7 +35,7 @@ import Streamly.Internal.Data.SVar.Type (defState, adaptState)
|
||||
import qualified Control.Monad.Trans.Reader as Reader
|
||||
import qualified Control.Monad.Trans.State.Strict as State
|
||||
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type
|
||||
import Streamly.Internal.Data.Stream.Type
|
||||
|
||||
#include "DocTestDataStream.hs"
|
||||
|
@ -2,7 +2,7 @@
|
||||
{-# LANGUAGE UndecidableInstances #-}
|
||||
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamD.Type
|
||||
-- Module : Streamly.Internal.Data.Stream.Type
|
||||
-- Copyright : (c) 2018 Composewell Technologies
|
||||
-- (c) Roman Leshchinskiy 2008-2010
|
||||
-- License : BSD-3-Clause
|
||||
@ -14,7 +14,7 @@
|
||||
-- module have been originally adapted from the vector package (c) Roman
|
||||
-- Leshchinskiy. See the notes in specific functions.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamD.Type
|
||||
module Streamly.Internal.Data.Stream.Type
|
||||
(
|
||||
-- * The stream type
|
||||
Step (..)
|
||||
@ -44,20 +44,20 @@ module Streamly.Internal.Data.Stream.StreamD.Type
|
||||
, fromEffect
|
||||
|
||||
-- ** From Containers
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type.fromList
|
||||
, Streamly.Internal.Data.Stream.Type.fromList
|
||||
|
||||
-- * Elimination
|
||||
-- ** Primitives
|
||||
, uncons
|
||||
|
||||
-- ** Strict Left Folds
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type.fold
|
||||
, Streamly.Internal.Data.Stream.Type.fold
|
||||
, foldBreak
|
||||
, foldAddLazy
|
||||
, foldAdd
|
||||
, foldEither
|
||||
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type.foldl'
|
||||
, Streamly.Internal.Data.Stream.Type.foldl'
|
||||
, foldlM'
|
||||
, foldlx'
|
||||
, foldlMx'
|
||||
@ -65,12 +65,12 @@ module Streamly.Internal.Data.Stream.StreamD.Type
|
||||
-- ** Lazy Right Folds
|
||||
, foldrM
|
||||
, foldrMx
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type.foldr
|
||||
, Streamly.Internal.Data.Stream.Type.foldr
|
||||
, foldrS
|
||||
|
||||
-- ** Specific Folds
|
||||
, drain
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type.toList
|
||||
, Streamly.Internal.Data.Stream.Type.toList
|
||||
|
||||
-- * Mapping
|
||||
, map
|
||||
@ -158,12 +158,12 @@ import Streamly.Internal.BaseCompat ((#.))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
|
||||
import Streamly.Internal.Data.Refold.Type (Refold(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step (..))
|
||||
import Streamly.Internal.Data.Stream.Step (Step (..))
|
||||
import Streamly.Internal.Data.SVar.Type (State, adaptState, defState)
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
|
||||
import qualified Streamly.Internal.Data.Fold.Type as FL hiding (foldr)
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
#ifdef USE_UNFOLDS_EVERYWHERE
|
||||
import qualified Streamly.Internal.Data.Unfold.Type as Unfold
|
||||
#endif
|
||||
@ -505,7 +505,7 @@ foldAddLazy (Fold fstep finitial fextract) (Stream sstep state) =
|
||||
--
|
||||
foldAdd :: Monad m => Fold m a b -> Stream m a -> m (Fold m a b)
|
||||
foldAdd f =
|
||||
Streamly.Internal.Data.Stream.StreamD.Type.fold (FL.duplicate f)
|
||||
Streamly.Internal.Data.Stream.Type.fold (FL.duplicate f)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Right Folds
|
||||
@ -740,7 +740,7 @@ drain (Stream step state) = go SPEC state
|
||||
--
|
||||
{-# INLINE_NORMAL toList #-}
|
||||
toList :: Monad m => Stream m a -> m [a]
|
||||
toList = Streamly.Internal.Data.Stream.StreamD.Type.foldr (:) []
|
||||
toList = Streamly.Internal.Data.Stream.Type.foldr (:) []
|
||||
|
||||
-- Use foldr/build fusion to fuse with list consumers
|
||||
-- This can be useful when using the IsList instance
|
||||
@ -753,7 +753,7 @@ toListFB c n (Stream step state) = go state
|
||||
Skip s -> go s
|
||||
Stop -> n
|
||||
|
||||
{-# RULES "toList Identity" Streamly.Internal.Data.Stream.StreamD.Type.toList = toListId #-}
|
||||
{-# RULES "toList Identity" Streamly.Internal.Data.Stream.Type.toList = toListId #-}
|
||||
{-# INLINE_EARLY toListId #-}
|
||||
toListId :: Stream Identity a -> Identity [a]
|
||||
toListId s = Identity $ build (\c n -> toListFB c n s)
|
||||
@ -880,10 +880,10 @@ instance IsList (Stream Identity a) where
|
||||
type (Item (Stream Identity a)) = a
|
||||
|
||||
{-# INLINE fromList #-}
|
||||
fromList = Streamly.Internal.Data.Stream.StreamD.Type.fromList
|
||||
fromList = Streamly.Internal.Data.Stream.Type.fromList
|
||||
|
||||
{-# INLINE toList #-}
|
||||
toList = runIdentity . Streamly.Internal.Data.Stream.StreamD.Type.toList
|
||||
toList = runIdentity . Streamly.Internal.Data.Stream.Type.toList
|
||||
|
||||
instance Eq a => Eq (Stream Identity a) where
|
||||
{-# INLINE (==) #-}
|
||||
@ -930,13 +930,13 @@ instance Show a => Show (Stream Identity a) where
|
||||
instance Read a => Read (Stream Identity a) where
|
||||
readPrec = parens $ prec 10 $ do
|
||||
Ident "fromList" <- lexP
|
||||
Streamly.Internal.Data.Stream.StreamD.Type.fromList <$> readPrec
|
||||
Streamly.Internal.Data.Stream.Type.fromList <$> readPrec
|
||||
|
||||
readListPrec = readListPrecDefault
|
||||
|
||||
instance (a ~ Char) => IsString (Stream Identity a) where
|
||||
{-# INLINE fromString #-}
|
||||
fromString = Streamly.Internal.Data.Stream.StreamD.Type.fromList
|
||||
fromString = Streamly.Internal.Data.Stream.Type.fromList
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Foldable
|
||||
@ -957,7 +957,7 @@ instance (Foldable m, Monad m) => Foldable (Stream m) where
|
||||
{-# INLINE foldMap #-}
|
||||
foldMap f =
|
||||
Data.Foldable.fold
|
||||
. Streamly.Internal.Data.Stream.StreamD.Type.foldr (mappend . f) mempty
|
||||
. Streamly.Internal.Data.Stream.Type.foldr (mappend . f) mempty
|
||||
|
||||
{-# INLINE foldr #-}
|
||||
foldr f z t = appEndo (foldMap (Endo #. f) t) z
|
@ -17,8 +17,8 @@ module Streamly.Internal.Data.StreamK
|
||||
-- $setup
|
||||
|
||||
-- * The stream type
|
||||
module Streamly.Internal.Data.Stream.StreamK.Type
|
||||
, module Streamly.Internal.Data.Stream.StreamK.Transformer
|
||||
module Streamly.Internal.Data.StreamK.Type
|
||||
, module Streamly.Internal.Data.StreamK.Transformer
|
||||
|
||||
, StreamK(..)
|
||||
, fromList
|
||||
@ -159,8 +159,8 @@ import Prelude
|
||||
notElem, head, tail, init, zipWith, lookup,
|
||||
(!!), replicate, reverse, concatMap, iterate, splitAt)
|
||||
import Data.Foldable (sum, length)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type
|
||||
import Streamly.Internal.Data.Stream.StreamK.Transformer
|
||||
import Streamly.Internal.Data.StreamK.Type
|
||||
import Streamly.Internal.Data.StreamK.Transformer
|
||||
import Streamly.Internal.Data.Parser (ParseError(..))
|
||||
|
||||
#include "DocTestDataStreamK.hs"
|
||||
|
@ -92,7 +92,7 @@
|
||||
-- a push style CPS representation should be able to be used along with StreamK
|
||||
-- to efficiently implement composable folds.
|
||||
|
||||
module Streamly.Internal.Data.Stream.StreamK.Alt
|
||||
module Streamly.Internal.Data.StreamK.Alt
|
||||
(
|
||||
-- * Stream Type
|
||||
|
@ -1,12 +1,12 @@
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamK.Transformer
|
||||
-- Module : Streamly.Internal.Data.StreamK.Transformer
|
||||
-- Copyright : (c) 2017 Composewell Technologies
|
||||
-- License : BSD3
|
||||
-- Maintainer : streamly@composewell.com
|
||||
-- Stability : experimental
|
||||
-- Portability : GHC
|
||||
--
|
||||
module Streamly.Internal.Data.Stream.StreamK.Transformer
|
||||
module Streamly.Internal.Data.StreamK.Transformer
|
||||
(
|
||||
foldlT
|
||||
, foldrT
|
||||
@ -18,7 +18,7 @@ where
|
||||
|
||||
import Control.Monad.Trans.Class (MonadTrans(lift))
|
||||
import Control.Monad.Trans.State.Strict (StateT)
|
||||
import Streamly.Internal.Data.Stream.StreamK.Type
|
||||
import Streamly.Internal.Data.StreamK.Type
|
||||
(StreamK, nil, cons, uncons, concatEffect)
|
||||
|
||||
import qualified Control.Monad.Trans.State.Strict as State
|
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE UndecidableInstances #-}
|
||||
-- |
|
||||
-- Module : Streamly.Internal.Data.Stream.StreamK.Type
|
||||
-- Module : Streamly.Internal.Data.StreamK.Type
|
||||
-- Copyright : (c) 2017 Composewell Technologies
|
||||
--
|
||||
-- License : BSD3
|
||||
@ -13,7 +13,7 @@
|
||||
-- Continuation passing style (CPS) stream implementation. The symbol 'K' below
|
||||
-- denotes a function as well as a Kontinuation.
|
||||
--
|
||||
module Streamly.Internal.Data.Stream.StreamK.Type
|
||||
module Streamly.Internal.Data.StreamK.Type
|
||||
(
|
||||
-- * StreamK type
|
||||
Stream
|
||||
@ -82,11 +82,11 @@ module Streamly.Internal.Data.Stream.StreamK.Type
|
||||
, uncons
|
||||
|
||||
-- ** Strict Left Folds
|
||||
, Streamly.Internal.Data.Stream.StreamK.Type.foldl'
|
||||
, Streamly.Internal.Data.StreamK.Type.foldl'
|
||||
, foldlx'
|
||||
|
||||
-- ** Lazy Right Folds
|
||||
, Streamly.Internal.Data.Stream.StreamK.Type.foldr
|
||||
, Streamly.Internal.Data.StreamK.Type.foldr
|
||||
|
||||
-- ** Specific Folds
|
||||
, drain
|
||||
@ -1070,7 +1070,7 @@ instance (Foldable m, Monad m) => Foldable (StreamK m) where
|
||||
{-# INLINE foldMap #-}
|
||||
foldMap f =
|
||||
fold
|
||||
. Streamly.Internal.Data.Stream.StreamK.Type.foldr (mappend . f) mempty
|
||||
. Streamly.Internal.Data.StreamK.Type.foldr (mappend . f) mempty
|
||||
|
||||
{-# INLINE foldr #-}
|
||||
foldr f z t = appEndo (foldMap (Endo #. f) t) z
|
||||
@ -1121,7 +1121,7 @@ instance Traversable (StreamK Identity) where
|
||||
{-# INLINE traverse #-}
|
||||
traverse f xs =
|
||||
runIdentity
|
||||
$ Streamly.Internal.Data.Stream.StreamK.Type.foldr
|
||||
$ Streamly.Internal.Data.StreamK.Type.foldr
|
||||
consA (pure mempty) xs
|
||||
|
||||
where
|
@ -20,7 +20,7 @@ module Streamly.Internal.Data.Unfold
|
||||
|
||||
-- * Unfolds
|
||||
-- One to one correspondence with
|
||||
-- "Streamly.Internal.Data.Stream.StreamD.Generate"
|
||||
-- "Streamly.Internal.Data.Stream.Generate"
|
||||
-- ** Basic Constructors
|
||||
, nilM
|
||||
, nil
|
||||
@ -120,14 +120,14 @@ import GHC.Types (SPEC(..))
|
||||
import Streamly.Internal.Data.Fold.Type (Fold(..))
|
||||
import Streamly.Internal.Data.IOFinalizer
|
||||
(newIOFinalizer, runIOFinalizer, clearingIOFinalizer)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream(..))
|
||||
import Streamly.Internal.Data.Stream.Type (Stream(..))
|
||||
import Streamly.Internal.Data.SVar.Type (defState)
|
||||
|
||||
import qualified Control.Monad.Catch as MC
|
||||
import qualified Data.Tuple as Tuple
|
||||
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
|
||||
import qualified Streamly.Internal.Data.Stream.Type as D
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K
|
||||
import qualified Prelude
|
||||
|
||||
import Streamly.Internal.Data.Unfold.Enumeration
|
||||
|
@ -112,7 +112,7 @@ import Control.Monad ((>=>))
|
||||
import Data.Void (Void)
|
||||
import Fusion.Plugin.Types (Fuse(..))
|
||||
import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
|
||||
import Streamly.Internal.Data.Stream.StreamD.Step (Step(..))
|
||||
import Streamly.Internal.Data.Stream.Step (Step(..))
|
||||
|
||||
import Prelude hiding (map, mapM, concatMap, zipWith, takeWhile)
|
||||
|
||||
|
@ -132,7 +132,7 @@ import Streamly.Internal.Data.Refold.Type (Refold(..))
|
||||
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
|
||||
import Streamly.Internal.Data.Array.Type
|
||||
(Array(..), pinnedWriteNUnsafe, unsafeFreezeWithShrink, byteLength)
|
||||
import Streamly.Internal.Data.Stream.StreamD.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Type (Stream)
|
||||
import Streamly.Internal.Data.Stream.Chunked (lpackArraysChunksOf)
|
||||
-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
|
||||
import Streamly.Internal.System.IO (defaultChunkSize)
|
||||
@ -148,7 +148,7 @@ import qualified Streamly.Internal.Data.Stream as S
|
||||
import qualified Streamly.Internal.Data.Stream as D
|
||||
(Stream(..), Step(..))
|
||||
import qualified Streamly.Internal.Data.Unfold as UF
|
||||
import qualified Streamly.Internal.Data.Stream.StreamK.Type as K (mkStream)
|
||||
import qualified Streamly.Internal.Data.StreamK.Type as K (mkStream)
|
||||
|
||||
#include "DocTestFileSystemHandle.hs"
|
||||
|
||||
|
@ -556,7 +556,7 @@ decodeUtf8WithD cfm (D.Stream step state) =
|
||||
|
||||
where
|
||||
|
||||
prefix = "Streamly.Internal.Data.Stream.StreamD.decodeUtf8With: "
|
||||
prefix = "Streamly.Internal.Data.Stream.decodeUtf8With: "
|
||||
|
||||
{-# INLINE handleError #-}
|
||||
handleError e s =
|
||||
@ -720,7 +720,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
|
||||
case cfm of
|
||||
ErrorOnCodingFailure ->
|
||||
error $
|
||||
show "Streamly.Internal.Data.Stream.StreamD."
|
||||
show "Streamly.Internal.Data.Stream."
|
||||
++ "decodeUtf8ArraysWith: Input Underflow"
|
||||
TransliterateCodingFailure -> YAndC replacementChar D
|
||||
DropOnCodingFailure -> D
|
||||
@ -769,7 +769,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
|
||||
Skip $
|
||||
transliterateOrError
|
||||
(
|
||||
"Streamly.Internal.Data.Stream.StreamD."
|
||||
"Streamly.Internal.Data.Stream."
|
||||
++ "decodeUtf8ArraysWith: Invalid UTF8"
|
||||
++ " codepoint encountered"
|
||||
)
|
||||
@ -792,7 +792,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
|
||||
Skip $
|
||||
transliterateOrError
|
||||
(
|
||||
"Streamly.Internal.Data.Stream.StreamD."
|
||||
"Streamly.Internal.Data.Stream."
|
||||
++ "decodeUtf8ArraysWith: Invalid UTF8"
|
||||
++ " codepoint encountered"
|
||||
)
|
||||
|
@ -405,20 +405,20 @@ library
|
||||
, Streamly.Internal.Data.Fold.Container
|
||||
, Streamly.Internal.Data.Fold.Window
|
||||
|
||||
, Streamly.Internal.Data.Stream.StreamD.Container
|
||||
, Streamly.Internal.Data.Stream.StreamD.Eliminate
|
||||
, Streamly.Internal.Data.Stream.StreamD.Exception
|
||||
, Streamly.Internal.Data.Stream.StreamD.Generate
|
||||
, Streamly.Internal.Data.Stream.StreamD.Lift
|
||||
, Streamly.Internal.Data.Stream.StreamD.Nesting
|
||||
, Streamly.Internal.Data.Stream.StreamD.Step
|
||||
, Streamly.Internal.Data.Stream.StreamD.Top
|
||||
, Streamly.Internal.Data.Stream.StreamD.Transform
|
||||
, Streamly.Internal.Data.Stream.StreamD.Transformer
|
||||
, Streamly.Internal.Data.Stream.StreamD.Type
|
||||
, Streamly.Internal.Data.Stream.Container
|
||||
, Streamly.Internal.Data.Stream.Eliminate
|
||||
, Streamly.Internal.Data.Stream.Exception
|
||||
, Streamly.Internal.Data.Stream.Generate
|
||||
, Streamly.Internal.Data.Stream.Lift
|
||||
, Streamly.Internal.Data.Stream.Nesting
|
||||
, Streamly.Internal.Data.Stream.Step
|
||||
, Streamly.Internal.Data.Stream.Top
|
||||
, Streamly.Internal.Data.Stream.Transform
|
||||
, Streamly.Internal.Data.Stream.Transformer
|
||||
, Streamly.Internal.Data.Stream.Type
|
||||
|
||||
, Streamly.Internal.Data.Stream.StreamK.Type
|
||||
, Streamly.Internal.Data.Stream.StreamK.Transformer
|
||||
, Streamly.Internal.Data.StreamK.Type
|
||||
, Streamly.Internal.Data.StreamK.Transformer
|
||||
|
||||
, Streamly.Internal.Data.Pipe.Type
|
||||
|
||||
@ -434,7 +434,7 @@ library
|
||||
|
||||
if flag(dev)
|
||||
other-modules:
|
||||
Streamly.Internal.Data.Stream.StreamK.Alt
|
||||
Streamly.Internal.Data.StreamK.Alt
|
||||
, Streamly.Internal.Data.List
|
||||
|
||||
build-depends:
|
||||
|
4
hie.yaml
4
hie.yaml
@ -31,9 +31,9 @@ cradle:
|
||||
- path: "./benchmark/Streamly/Benchmark/Data/ParserK.hs"
|
||||
component: "bench:Data.ParserK"
|
||||
- path: "./benchmark/Streamly/Benchmark/Data/Stream/StreamD.hs"
|
||||
component: "bench:Data.Stream.StreamD"
|
||||
component: "bench:Data.StreamD"
|
||||
- path: "./benchmark/Streamly/Benchmark/Data/Stream/StreamK.hs"
|
||||
component: "bench:Data.Stream.StreamK"
|
||||
component: "bench:Data.StreamK"
|
||||
- path: "./benchmark/Streamly/Benchmark/Data/Stream/ToStreamK.hs"
|
||||
component: "bench:Data.Stream.ToStreamK"
|
||||
- path: "./benchmark/Streamly/Benchmark/Data/Stream/Common.hs"
|
||||
|
@ -10,13 +10,13 @@ where
|
||||
targets :: [(String, [String])]
|
||||
targets =
|
||||
[ -- Base streams
|
||||
("Data.Stream.StreamD",
|
||||
("Data.Stream",
|
||||
[ "base_stream_grp"
|
||||
, "base_stream_cmp"
|
||||
, "noTest"
|
||||
]
|
||||
)
|
||||
, ("Data.Stream.StreamK",
|
||||
, ("Data.StreamK",
|
||||
[ "base_stream_grp"
|
||||
, "base_stream_cmp"
|
||||
, "noTest"
|
||||
|
Loading…
Reference in New Issue
Block a user