@@ -2,7 +2,7 @@
2{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE UndecidableInstances #-}
5−-- Module : Streamly.Internal.Data.Stream.StreamD.Type
5+-- Module : Streamly.Internal.Data.Stream.Type
6-- Copyright : (c) 2018 Composewell Technologies
6-- Copyright : (c) 2018 Composewell Technologies
7-- (c) Roman Leshchinskiy 2008-2010
7-- (c) Roman Leshchinskiy 2008-2010
8-- License : BSD-3-Clause
8-- License : BSD-3-Clause
@@ -14,7 +14,7 @@
14-- module have been originally adapted from the vector package (c) Roman
14-- module have been originally adapted from the vector package (c) Roman
15-- Leshchinskiy. See the notes in specific functions.
15-- Leshchinskiy. See the notes in specific functions.
17−module Streamly.Internal.Data.Stream.StreamD.Type
17+module Streamly.Internal.Data.Stream.Type
19 -- * The stream type
19 -- * The stream type
@@ -44,20 +44,20 @@ module Streamly.Internal.Data.Stream.StreamD.Type
44 , fromEffect
44 , fromEffect
46 -- ** From Containers
46 -- ** From Containers
47− , Streamly.Internal.Data.Stream.StreamD.Type.fromList
47+ , Streamly.Internal.Data.Stream.Type.fromList
49 -- * Elimination
49 -- * Elimination
50 -- ** Primitives
50 -- ** Primitives
53 -- ** Strict Left Folds
53 -- ** Strict Left Folds
54− , Streamly.Internal.Data.Stream.StreamD.Type.fold
54+ , Streamly.Internal.Data.Stream.Type.fold
55 , foldBreak
55 , foldBreak
56 , foldAddLazy
56 , foldAddLazy
58 , foldEither
58 , foldEither
60− , Streamly.Internal.Data.Stream.StreamD.Type.foldl'
60+ , Streamly.Internal.Data.Stream.Type.foldl'
63 , foldlMx'
63 , foldlMx'
@@ -65,12 +65,12 @@ module Streamly.Internal.Data.Stream.StreamD.Type
65 -- ** Lazy Right Folds
65 -- ** Lazy Right Folds
68− , Streamly.Internal.Data.Stream.StreamD.Type.foldr
68+ , Streamly.Internal.Data.Stream.Type.foldr
71 -- ** Specific Folds
71 -- ** Specific Folds
73− , Streamly.Internal.Data.Stream.StreamD.Type.toList
73+ , Streamly.Internal.Data.Stream.Type.toList
75 -- * Mapping
75 -- * Mapping
@@ -158,12 +158,12 @@ import Streamly.Internal.BaseCompat ((#.))
158import Streamly.Internal.Data.Fold.Type (Fold(..))
158import Streamly.Internal.Data.Fold.Type (Fold(..))
159import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
159import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
160import Streamly.Internal.Data.Refold.Type (Refold(..))
160import Streamly.Internal.Data.Refold.Type (Refold(..))
161−import Streamly.Internal.Data.Stream.StreamD.Step (Step (..))
161+import Streamly.Internal.Data.Stream.Step (Step (..))
162import Streamly.Internal.Data.SVar.Type (State, adaptState, defState)
162import Streamly.Internal.Data.SVar.Type (State, adaptState, defState)
163import Streamly.Internal.Data.Unfold.Type (Unfold(..))
163import Streamly.Internal.Data.Unfold.Type (Unfold(..))
165import qualified Streamly.Internal.Data.Fold.Type as FL hiding (foldr)
165import qualified Streamly.Internal.Data.Fold.Type as FL hiding (foldr)
166−import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
166+import qualified Streamly.Internal.Data.StreamK.Type as K
167#ifdef USE_UNFOLDS_EVERYWHERE
167#ifdef USE_UNFOLDS_EVERYWHERE
168import qualified Streamly.Internal.Data.Unfold.Type as Unfold
168import qualified Streamly.Internal.Data.Unfold.Type as Unfold
@@ -505,7 +505,7 @@ foldAddLazy (Fold fstep finitial fextract) (Stream sstep state) =
506foldAdd :: Monad m => Fold m a b -> Stream m a -> m (Fold m a b)
506foldAdd :: Monad m => Fold m a b -> Stream m a -> m (Fold m a b)
507foldAdd f =
507foldAdd f =
508− Streamly.Internal.Data.Stream.StreamD.Type.fold (FL.duplicate f)
508+ Streamly.Internal.Data.Stream.Type.fold (FL.duplicate f)
510------------------------------------------------------------------------------
510------------------------------------------------------------------------------
511-- Right Folds
511-- Right Folds
@@ -740,7 +740,7 @@ drain (Stream step state) = go SPEC state
741{-# INLINE_NORMAL toList #-}
741{-# INLINE_NORMAL toList #-}
742toList :: Monad m => Stream m a -> m [a]
742toList :: Monad m => Stream m a -> m [a]
743−toList = Streamly.Internal.Data.Stream.StreamD.Type.foldr (:) []
743+toList = Streamly.Internal.Data.Stream.Type.foldr (:) []
745-- Use foldr/build fusion to fuse with list consumers
745-- Use foldr/build fusion to fuse with list consumers
746-- This can be useful when using the IsList instance
746-- This can be useful when using the IsList instance
@@ -753,7 +753,7 @@ toListFB c n (Stream step state) = go state
753 Skip s -> go s
753 Skip s -> go s
754 Stop -> n
754 Stop -> n
756−{-# RULES "toList Identity" Streamly.Internal.Data.Stream.StreamD.Type.toList = toListId #-}
756+{-# RULES "toList Identity" Streamly.Internal.Data.Stream.Type.toList = toListId #-}
757{-# INLINE_EARLY toListId #-}
757{-# INLINE_EARLY toListId #-}
758toListId :: Stream Identity a -> Identity [a]
758toListId :: Stream Identity a -> Identity [a]
759toListId s = Identity $ build (\c n -> toListFB c n s)
759toListId s = Identity $ build (\c n -> toListFB c n s)
@@ -880,10 +880,10 @@ instance IsList (Stream Identity a) where
880 type (Item (Stream Identity a)) = a
880 type (Item (Stream Identity a)) = a
882 {-# INLINE fromList #-}
882 {-# INLINE fromList #-}
883− fromList = Streamly.Internal.Data.Stream.StreamD.Type.fromList
883+ fromList = Streamly.Internal.Data.Stream.Type.fromList
885 {-# INLINE toList #-}
885 {-# INLINE toList #-}
886− toList = runIdentity . Streamly.Internal.Data.Stream.StreamD.Type.toList
886+ toList = runIdentity . Streamly.Internal.Data.Stream.Type.toList
888instance Eq a => Eq (Stream Identity a) where
888instance Eq a => Eq (Stream Identity a) where
889 {-# INLINE (==) #-}
889 {-# INLINE (==) #-}
@@ -930,13 +930,13 @@ instance Show a => Show (Stream Identity a) where
930instance Read a => Read (Stream Identity a) where
930instance Read a => Read (Stream Identity a) where
931 readPrec = parens $ prec 10 $ do
931 readPrec = parens $ prec 10 $ do
932 Ident "fromList" <- lexP
932 Ident "fromList" <- lexP
933− Streamly.Internal.Data.Stream.StreamD.Type.fromList <$> readPrec
933+ Streamly.Internal.Data.Stream.Type.fromList <$> readPrec
935 readListPrec = readListPrecDefault
935 readListPrec = readListPrecDefault
937instance (a ~ Char) => IsString (Stream Identity a) where
937instance (a ~ Char) => IsString (Stream Identity a) where
938 {-# INLINE fromString #-}
938 {-# INLINE fromString #-}
939− fromString = Streamly.Internal.Data.Stream.StreamD.Type.fromList
939+ fromString = Streamly.Internal.Data.Stream.Type.fromList
941-------------------------------------------------------------------------------
941-------------------------------------------------------------------------------
942-- Foldable
942-- Foldable
@@ -957,7 +957,7 @@ instance (Foldable m, Monad m) => Foldable (Stream m) where
957 {-# INLINE foldMap #-}
957 {-# INLINE foldMap #-}
958 foldMap f =
958 foldMap f =
959 Data.Foldable.fold
959 Data.Foldable.fold
960− . Streamly.Internal.Data.Stream.StreamD.Type.foldr (mappend . f) mempty
960+ . Streamly.Internal.Data.Stream.Type.foldr (mappend . f) mempty
962 {-# INLINE foldr #-}
962 {-# INLINE foldr #-}
963 foldr f z t = appEndo (foldMap (Endo #. f) t) z
963 foldr f z t = appEndo (foldMap (Endo #. f) t) z