on master help sign in
Remove 'eval', just keep parEval in conc folds
0e14d71Harendra Kumar
src/Streamly/Internal/Data/Fold/Concurrent.hs+4−6
@@ -18,9 +18,6 @@
18
18
19module Streamly.Internal.Data.Fold.Concurrent
19module Streamly.Internal.Data.Fold.Concurrent
20 (
20 (
21− -- * Imports
22− -- $setup
23−
24 -- * Configuration
21 -- * Configuration
25 Config
22 Config
26 , maxBuffer
23 , maxBuffer
@@ -30,13 +27,12 @@ module Streamly.Internal.Data.Fold.Concurrent
30 -- * Combinators
27 -- * Combinators
31 -- | Stream combinators using Async channel
28 -- | Stream combinators using Async channel
32
29
33− , eval
34 , parEval
30 , parEval
35 )
31 )
36where
32where
37
33
38−import Streamly.Internal.Control.Concurrent (MonadAsync)
34+-- import Streamly.Internal.Control.Concurrent (MonadAsync)
39−import Streamly.Internal.Data.Fold (Fold)
35+-- import Streamly.Internal.Data.Fold (Fold)
40
36
41import Streamly.Internal.Data.Fold.Concurrent.Channel
37import Streamly.Internal.Data.Fold.Concurrent.Channel
42
38
@@ -60,6 +56,7 @@ import Streamly.Internal.Data.Fold.Concurrent.Channel
60-- return n -- IO Int
56-- return n -- IO Int
61-- :}
57-- :}
62
58
59+{-
63-- | Evaluate a stream asynchronously using a channel and serve the consumer
60-- | Evaluate a stream asynchronously using a channel and serve the consumer
64-- from the evaluation buffer.
61-- from the evaluation buffer.
65--
62--
@@ -68,3 +65,4 @@ import Streamly.Internal.Data.Fold.Concurrent.Channel
68{-# INLINE eval #-}
65{-# INLINE eval #-}
69eval :: MonadAsync m => Fold m a b -> Fold m a b
66eval :: MonadAsync m => Fold m a b -> Fold m a b
70eval = parEval id
67eval = parEval id
68+-}
src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs+3−2
@@ -40,8 +40,9 @@ import Streamly.Internal.Data.Stream.Channel.Types
40
40
41-- XXX Cleanup the fold if the stream is interrupted. Add a GC hook.
41-- XXX Cleanup the fold if the stream is interrupted. Add a GC hook.
42
42
43−-- | Evaluate the fold asynchronously in a worker thread separate from the
43+-- | Evaluate a fold asynchronously using a concurrent channel. The driver just
44−-- driver thread.
44+-- queues the input stream values to the fold channel buffer and returns. The
45+-- fold evaluates the queued values asynchronously.
45--
46--
46{-# INLINABLE parEval #-}
47{-# INLINABLE parEval #-}
47parEval :: MonadAsync m => (Config -> Config) -> Fold m a b -> Fold m a b
48parEval :: MonadAsync m => (Config -> Config) -> Fold m a b -> Fold m a b