@@ -61,25 +61,28 @@ module Streamly.Data.Stream.Prelude
61 -- | Stream combinators using a concurrent channel.
61 -- | Stream combinators using a concurrent channel.
63 -- *** Evaluate
63 -- *** Evaluate
64− -- | Evaluates a serial stream asynchronously using a concurency channel.
64+ -- | Evaluate a stream as a whole concurrently with respect to the consumer
68 -- *** Generate
69 -- *** Generate
69− -- | Uses a concurrency channel to evaluate multiple actions concurrently.
70+ -- | Generate a stream by evaluating multiple actions concurrently.
70 , parRepeatM
71 , parRepeatM
71 , parReplicateM
72 , parReplicateM
72 , fromCallback
73 , fromCallback
74 -- *** Map
75 -- *** Map
75− -- | Uses a concurrency channel to evaluate multiple mapped actions
76+ -- | Map actions on a stream such that the mapped actions are evaluated
76− -- concurrently.
77+ -- concurrently with each other.
79 , parSequence
80 , parSequence
81 -- *** Combine two
82 -- *** Combine two
82− -- | Use a channel for each pair.
83+ -- | Combine two streams such that each stream as a whole is evaluated
84+ -- concurrently with respect to the other stream as well as the consumer of
85+ -- the resulting stream.
83 , parZipWithM
86 , parZipWithM
84 , parZipWith
87 , parZipWith
85 , parMergeByM
88 , parMergeByM
@@ -157,16 +160,18 @@ import Streamly.Internal.Data.Stream.Prelude
157-- 'parConcatMap', and 'parConcatIterate', all concurrency combinators can be
160-- 'parConcatMap', and 'parConcatIterate', all concurrency combinators can be
158-- expressed in terms of these.
161-- expressed in terms of these.
160−-- 'parEval', evaluates a single stream asynchronously, a worker thread runs
163+-- 'parEval' evaluates a stream as a whole asynchronously with respect to
164+-- the consumer of the stream. A worker thread evaluates multiple elements of
161−-- the stream and buffers the results, and the consumer of the stream runs in
165+-- the stream ahead of time and buffers the results; the consumer of the stream
162−-- another thread consuming it from the buffer, thus decoupling the production
166+-- runs in another thread consuming the elements from the buffer, thus
163−-- and consumption of the stream. This can be used to run different stages of a
167+-- decoupling the production and consumption of the stream. 'parEval' can be
164−-- pipeline concurrently.
168+-- used to run different stages of a pipeline concurrently.
166−-- 'parConcatMap' is used to evaluate multiple streams concurrently and combine
170+-- 'parConcatMap' is used to evaluate multiple actions in a stream concurrently
171+-- with respect to each other or to evaluate multiple streams concurrently and
167−-- the results. A stream generator function is mapped to the input stream and
172+-- combine the results. A stream generator function is mapped to the input
168−-- all the generated streams are then evaluated concurrently, and the results
173+-- stream and all the generated streams are then evaluated concurrently, and
169−-- are combined.
174+-- the results are combined.
171-- 'parConcatIterate' is like 'parConcatMap' but iterates a stream generator
176-- 'parConcatIterate' is like 'parConcatMap' but iterates a stream generator
172-- function recursively over the stream. This can be used to traverse trees or
177-- function recursively over the stream. This can be used to traverse trees or