on master help sign in
Re-export entire submodules from Producer (#2514)
e6051b1Ranjeet Ranjan
benchmark/Streamly/Benchmark/Data/Parser.hs+3−4
@@ -47,7 +47,6 @@ import qualified Streamly.Internal.Data.Fold as Fold
47import qualified Streamly.Internal.Data.Parser as PR
47import qualified Streamly.Internal.Data.Parser as PR
48import qualified Streamly.Data.Stream as Stream
48import qualified Streamly.Data.Stream as Stream
49import qualified Streamly.Internal.Data.Producer as Producer
49import qualified Streamly.Internal.Data.Producer as Producer
50−import qualified Streamly.Internal.Data.Producer.Source as Source
51import qualified Streamly.Internal.Data.Stream as Stream
50import qualified Streamly.Internal.Data.Stream as Stream
52
51
53import Gauge hiding (env)
52import Gauge hiding (env)
@@ -635,13 +634,13 @@ choice value =
635{-# INLINE parseManyUnfoldArrays #-}
634{-# INLINE parseManyUnfoldArrays #-}
636parseManyUnfoldArrays :: Int -> [Array.Array Int] -> IO ()
635parseManyUnfoldArrays :: Int -> [Array.Array Int] -> IO ()
637parseManyUnfoldArrays count arrays = do
636parseManyUnfoldArrays count arrays = do
638− let src = Source.source (Just (Producer.OuterLoop arrays))
637+ let src = Producer.source (Just (Producer.OuterLoop arrays))
639 let parser = PR.fromFold (Fold.take count Fold.drain)
638 let parser = PR.fromFold (Fold.take count Fold.drain)
640 let readSrc =
639 let readSrc =
641− Source.producer
640+ Producer.producer
642 $ Producer.concat Producer.fromList Array.producer
641 $ Producer.concat Producer.fromList Array.producer
643 let streamParser =
642 let streamParser =
644− Producer.simplify (Source.parseMany parser readSrc)
643+ Producer.simplify (Producer.parseMany parser readSrc)
645 Stream.fold Fold.drain $ Stream.unfold streamParser src
644 Stream.fold Fold.drain $ Stream.unfold streamParser src
646
645
647-------------------------------------------------------------------------------
646-------------------------------------------------------------------------------
core/src/Streamly/Internal/Data/Producer.hs+4−11
@@ -24,21 +24,13 @@
24-- unecessary function calls can be avoided.
24-- unecessary function calls can be avoided.
25
25
26module Streamly.Internal.Data.Producer
26module Streamly.Internal.Data.Producer
27− ( Producer (..)
27+ (
28+ module Streamly.Internal.Data.Producer.Source
29+ , module Streamly.Internal.Data.Producer.Type
28
30
29 -- * Converting
31 -- * Converting
30 , simplify
32 , simplify
31−
32− -- * Producers
33− , nil
34− , nilM
35− , unfoldrM
36 , fromStreamD
33 , fromStreamD
37− , fromList
38−
39− -- * Combinators
40− , NestedLoop (..)
41− , concat
42 )
34 )
43where
35where
44
36
@@ -49,6 +41,7 @@ import Streamly.Internal.Data.Stream.StreamD.Type (Stream(..))
49import Streamly.Internal.Data.SVar.Type (defState)
41import Streamly.Internal.Data.SVar.Type (defState)
50import Streamly.Internal.Data.Unfold.Type (Unfold(..))
42import Streamly.Internal.Data.Unfold.Type (Unfold(..))
51
43
44+import Streamly.Internal.Data.Producer.Source
52import Streamly.Internal.Data.Producer.Type
45import Streamly.Internal.Data.Producer.Type
53import Prelude hiding (concat)
46import Prelude hiding (concat)
54
47
core/streamly-core.cabal+3−2
@@ -291,9 +291,7 @@ library
291 -- streamly-core-stream-types
291 -- streamly-core-stream-types
292 , Streamly.Internal.Data.SVar.Type
292 , Streamly.Internal.Data.SVar.Type
293 , Streamly.Internal.Data.Refold.Type
293 , Streamly.Internal.Data.Refold.Type
294− , Streamly.Internal.Data.Producer.Type
295 , Streamly.Internal.Data.Producer
294 , Streamly.Internal.Data.Producer
296− , Streamly.Internal.Data.Producer.Source
297 , Streamly.Internal.Data.Parser.ParserK.Type
295 , Streamly.Internal.Data.Parser.ParserK.Type
298 , Streamly.Internal.Data.Parser.ParserD.Type
296 , Streamly.Internal.Data.Parser.ParserD.Type
299 , Streamly.Internal.Data.Pipe.Type
297 , Streamly.Internal.Data.Pipe.Type
@@ -432,6 +430,9 @@ library
432
430
433 , Streamly.Internal.Data.Array.Type
431 , Streamly.Internal.Data.Array.Type
434
432
433+ , Streamly.Internal.Data.Producer.Type
434+ , Streamly.Internal.Data.Producer.Source
435+
435 if flag(dev)
436 if flag(dev)
436 other-modules:
437 other-modules:
437 Streamly.Internal.Data.Stream.StreamK.Alt
438 Streamly.Internal.Data.Stream.StreamK.Alt
test/Streamly/Test/Data/Parser.hs+3−4
@@ -21,7 +21,6 @@ import qualified Streamly.Data.Stream as S
21import qualified Streamly.Internal.Data.Array as A
21import qualified Streamly.Internal.Data.Array as A
22import qualified Streamly.Internal.Data.Fold as FL
22import qualified Streamly.Internal.Data.Fold as FL
23import qualified Streamly.Internal.Data.Parser as P
23import qualified Streamly.Internal.Data.Parser as P
24−import qualified Streamly.Internal.Data.Producer.Source as Source
25import qualified Streamly.Internal.Data.Producer as Producer
24import qualified Streamly.Internal.Data.Producer as Producer
26import qualified Streamly.Internal.Data.Unfold as Unfold
25import qualified Streamly.Internal.Data.Unfold as Unfold
27import qualified Test.Hspec as H
26import qualified Test.Hspec as H
@@ -850,13 +849,13 @@ parseUnfold = do
850 <*> chooseInt (1, len)) $ \(ls, clen, tlen) ->
849 <*> chooseInt (1, len)) $ \(ls, clen, tlen) ->
851 monadicIO $ do
850 monadicIO $ do
852 arrays <- S.toList $ S.chunksOf clen (S.fromList ls)
851 arrays <- S.toList $ S.chunksOf clen (S.fromList ls)
853− let src = Source.source (Just (Producer.OuterLoop arrays))
852+ let src = Producer.source (Just (Producer.OuterLoop arrays))
854 let parser = P.fromFold (FL.take tlen FL.toList)
853 let parser = P.fromFold (FL.take tlen FL.toList)
855 let readSrc =
854 let readSrc =
856− Source.producer
855+ Producer.producer
857 $ Producer.concat Producer.fromList A.producer
856 $ Producer.concat Producer.fromList A.producer
858 let streamParser =
857 let streamParser =
859− Producer.simplify (Source.parseManyD parser readSrc)
858+ Producer.simplify (Producer.parseManyD parser readSrc)
860 xs <- run
859 xs <- run
861 $ S.toList
860 $ S.toList
862 $ S.unfoldMany Unfold.fromList
861 $ S.unfoldMany Unfold.fromList
test/Streamly/Test/Data/ParserK.hs+3−4
@@ -17,7 +17,6 @@ import qualified Streamly.Data.Stream as S
17import qualified Streamly.Internal.Data.Array as A
17import qualified Streamly.Internal.Data.Array as A
18import qualified Streamly.Internal.Data.Fold as FL
18import qualified Streamly.Internal.Data.Fold as FL
19import qualified Streamly.Internal.Data.Parser as P
19import qualified Streamly.Internal.Data.Parser as P
20−import qualified Streamly.Internal.Data.Producer.Source as Source
21import qualified Streamly.Internal.Data.Producer as Producer
20import qualified Streamly.Internal.Data.Producer as Producer
22import qualified Streamly.Internal.Data.Stream as S
21import qualified Streamly.Internal.Data.Stream as S
23import qualified Streamly.Internal.Data.Stream as D
22import qualified Streamly.Internal.Data.Stream as D
@@ -660,13 +659,13 @@ parseUnfold = do
660 <*> chooseInt (1, len)) $ \(ls, clen, tlen) ->
659 <*> chooseInt (1, len)) $ \(ls, clen, tlen) ->
661 monadicIO $ do
660 monadicIO $ do
662 arrays <- toList $ S.chunksOf clen (S.fromList ls)
661 arrays <- toList $ S.chunksOf clen (S.fromList ls)
663− let src = Source.source (Just (Producer.OuterLoop arrays))
662+ let src = Producer.source (Just (Producer.OuterLoop arrays))
664 let parser = P.fromFold (FL.take tlen FL.toList)
663 let parser = P.fromFold (FL.take tlen FL.toList)
665 let readSrc =
664 let readSrc =
666− Source.producer
665+ Producer.producer
667 $ Producer.concat Producer.fromList A.producer
666 $ Producer.concat Producer.fromList A.producer
668 let streamParser =
667 let streamParser =
669− Producer.simplify (Source.parseManyD parser readSrc)
668+ Producer.simplify (Producer.parseManyD parser readSrc)
670 xs <- run
669 xs <- run
671 $ toList
670 $ toList
672 $ S.unfoldMany Unfold.fromList
671 $ S.unfoldMany Unfold.fromList