on master help sign in
Rename evalWith to parEval in the concurrent Fold module
bc1f936Harendra Kumar
src/Streamly/Internal/Data/Fold/Concurrent.hs+3−3
@@ -30,7 +30,7 @@ module Streamly.Internal.Data.Fold.Concurrent
30 -- | Stream combinators using Async channel
30 -- | Stream combinators using Async channel
31
31
32 , eval
32 , eval
33− , evalWith
33+ , parEval
34 )
34 )
35where
35where
36
36
@@ -62,8 +62,8 @@ import Streamly.Internal.Data.Fold.Concurrent.Channel
62-- | Evaluate a stream asynchronously using a channel and serve the consumer
62-- | Evaluate a stream asynchronously using a channel and serve the consumer
63-- from the evaluation buffer.
63-- from the evaluation buffer.
64--
64--
65−-- >>> eval = Fold.evalWith id
65+-- >>> eval = Fold.parEval id
66--
66--
67{-# INLINE eval #-}
67{-# INLINE eval #-}
68eval :: MonadAsync m => Fold m a b -> Fold m a b
68eval :: MonadAsync m => Fold m a b -> Fold m a b
69−eval = evalWith id
69+eval = parEval id
src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs+5−5
@@ -17,7 +17,7 @@ module Streamly.Internal.Data.Fold.Concurrent.Channel
17 , inspect
17 , inspect
18
18
19 -- * Fold operations
19 -- * Fold operations
20− , evalWith
20+ , parEval
21 )
21 )
22where
22where
23
23
@@ -42,9 +42,9 @@ import Streamly.Internal.Data.Stream.Channel.Types
42-- | Evaluate the fold asynchronously in a worker thread separate from the
42-- | Evaluate the fold asynchronously in a worker thread separate from the
43-- driver thread.
43-- driver thread.
44--
44--
45−{-# INLINABLE evalWith #-}
45+{-# INLINABLE parEval #-}
46−evalWith :: MonadAsync m => (Config -> Config) -> Fold m a b -> Fold m a b
46+parEval :: MonadAsync m => (Config -> Config) -> Fold m a b -> Fold m a b
47−evalWith modifier f =
47+parEval modifier f =
48 Fold step initial extract
48 Fold step initial extract
49
49
50 where
50 where
@@ -79,7 +79,7 @@ evalWith modifier f =
79 $ withDiagMVar
79 $ withDiagMVar
80 (svarInspectMode chan)
80 (svarInspectMode chan)
81 (dumpSVar chan)
81 (dumpSVar chan)
82− "evalWith: waiting to drain"
82+ "parEval: waiting to drain"
83 $ takeMVar (outputDoorBellFromConsumer chan)
83 $ takeMVar (outputDoorBellFromConsumer chan)
84 -- XXX remove recursion
84 -- XXX remove recursion
85 extract chan
85 extract chan