on master help sign in
Collect all internal Fold modules in one
5c890aeHarendra Kumar
src/Streamly/Data/Fold/Prelude.hs+1−1
@@ -55,7 +55,7 @@ import Streamly.Internal.Data.IsMap.HashMap ()
55--
55--
56-- >>> classify = Fold.toHashMapIO fst (Fold.lmap snd Fold.toList)
56-- >>> classify = Fold.toHashMapIO fst (Fold.lmap snd Fold.toList)
57-- >>> Stream.fold classify input :: IO (HashMap String [Double])
57-- >>> Stream.fold classify input :: IO (HashMap String [Double])
58−-- fromList [("k1",[1.0,1.1]),("k2",[2.0,2.2])]
58+-- fromList [("k2",[2.0,2.2]),("k1",[1.0,1.1])]
59--
59--
60-- /Pre-release/
60-- /Pre-release/
61--
61--
src/Streamly/Internal/Data/Fold/Concurrent.hs+1−44
@@ -50,51 +50,8 @@
50
50
51module Streamly.Internal.Data.Fold.Concurrent
51module Streamly.Internal.Data.Fold.Concurrent
52 (
52 (
53− -- * Configuration
53+ module Streamly.Internal.Data.Fold.Concurrent.Channel
54− Config
55− , maxBuffer
56− , boundThreads
57− , inspect
58−
59− -- * Combinators
60− -- | Stream combinators using Async channel
61−
62− , parEval
63 )
54 )
64where
55where
65
56
66−-- import Streamly.Internal.Control.Concurrent (MonadAsync)
67−-- import Streamly.Internal.Data.Fold (Fold)
68−
69import Streamly.Internal.Data.Fold.Concurrent.Channel
57import Streamly.Internal.Data.Fold.Concurrent.Channel
70−
71−-- $setup
72−--
73−-- Imports for example snippets in this module.
74−--
75−-- >>> :m
76−-- >>> :set -XFlexibleContexts
77−-- >>> import Control.Concurrent (threadDelay)
78−-- >>> import qualified Streamly.Data.Array as Array
79−-- >>> import qualified Streamly.Data.Fold as Fold
80−-- >>> import qualified Streamly.Data.Parser as Parser
81−-- >>> import qualified Streamly.Data.Stream as Stream
82−-- >>> import qualified Streamly.Internal.Data.Fold.Concurrent as Fold
83−-- >>> import Prelude hiding (concatMap, concat)
84−-- >>> :{
85−-- delay n = do
86−-- threadDelay (n * 1000000) -- sleep for n seconds
87−-- putStrLn (show n ++ " sec") -- print "n sec"
88−-- return n -- IO Int
89−-- :}
90−
91−{-
92−-- | Evaluate a stream asynchronously using a channel and serve the consumer
93−-- from the evaluation buffer.
94−--
95−-- >>> eval = Fold.parEval id
96−--
97−{-# INLINE eval #-}
98−eval :: MonadAsync m => Fold m a b -> Fold m a b
99−eval = parEval id
100−-}
src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs+1−3
@@ -8,11 +8,9 @@
8
8
9module Streamly.Internal.Data.Fold.Concurrent.Channel
9module Streamly.Internal.Data.Fold.Concurrent.Channel
10 (
10 (
11− -- * Channel
11+ module Streamly.Internal.Data.Fold.Concurrent.Channel.Type
12− Channel
13
12
14 -- * Configuration
13 -- * Configuration
15− , Config
16 , maxBuffer
14 , maxBuffer
17 , boundThreads
15 , boundThreads
18 , inspect
16 , inspect
src/Streamly/Internal/Data/Fold/Prelude.hsnew file+19
@@ -0,0 +1,19 @@
1+-- |
2+-- Module : Streamly.Internal.Data.Fold.Prelude
3+-- Copyright : (c) 2022 Composewell Technologies
4+-- License : BSD-3-Clause
5+-- Maintainer : streamly@composewell.com
6+-- Stability : experimental
7+-- Portability : GHC
8+--
9+module Streamly.Internal.Data.Fold.Prelude
10+ (
11+ module Streamly.Internal.Data.Fold.Async
12+ , module Streamly.Internal.Data.Fold.Concurrent
13+ , module Streamly.Internal.Data.Fold.SVar
14+ )
15+where
16+
17+import Streamly.Internal.Data.Fold.Async
18+import Streamly.Internal.Data.Fold.Concurrent
19+import Streamly.Internal.Data.Fold.SVar
streamly.cabal+7−5
@@ -375,9 +375,7 @@ library
375 , Streamly.Internal.Data.Stream.Channel.Worker
375 , Streamly.Internal.Data.Stream.Channel.Worker
376
376
377 , Streamly.Internal.Data.Unfold.Exception
377 , Streamly.Internal.Data.Unfold.Exception
378− , Streamly.Internal.Data.Fold.Concurrent.Channel.Type
378+ , Streamly.Internal.Data.Fold.Prelude
379− , Streamly.Internal.Data.Fold.Concurrent.Channel
380− , Streamly.Internal.Data.Fold.Concurrent
381
379
382 , Streamly.Internal.Data.Stream.Concurrent.Channel.Type
380 , Streamly.Internal.Data.Stream.Concurrent.Channel.Type
383 , Streamly.Internal.Data.Stream.Concurrent.Channel.Dispatcher
381 , Streamly.Internal.Data.Stream.Concurrent.Channel.Dispatcher
@@ -417,8 +415,6 @@ library
417 , Streamly.Internal.Data.SVar
415 , Streamly.Internal.Data.SVar
418
416
419 , Streamly.Internal.Data.Unfold.SVar
417 , Streamly.Internal.Data.Unfold.SVar
420− , Streamly.Internal.Data.Fold.SVar
421− , Streamly.Internal.Data.Fold.Async
422 , Streamly.Internal.Data.Stream.SVar.Generate
418 , Streamly.Internal.Data.Stream.SVar.Generate
423 , Streamly.Internal.Data.Stream.SVar.Eliminate
419 , Streamly.Internal.Data.Stream.SVar.Eliminate
424
420
@@ -465,6 +461,12 @@ library
465 , Streamly.Data.Stream.Concurrent
461 , Streamly.Data.Stream.Concurrent
466 , Streamly.Data.Stream.Time
462 , Streamly.Data.Stream.Time
467
463
464+ , Streamly.Internal.Data.Fold.SVar
465+ , Streamly.Internal.Data.Fold.Async
466+ , Streamly.Internal.Data.Fold.Concurrent.Channel.Type
467+ , Streamly.Internal.Data.Fold.Concurrent.Channel
468+ , Streamly.Internal.Data.Fold.Concurrent
469+
468 , Streamly.Internal.Data.Stream.Common
470 , Streamly.Internal.Data.Stream.Common
469 , Streamly.Internal.Data.Stream.IsStream.Type
471 , Streamly.Internal.Data.Stream.IsStream.Type
470 , Streamly.Internal.Data.Stream.IsStream.Generate
472 , Streamly.Internal.Data.Stream.IsStream.Generate