@@ -61,25 +61,28 @@ module Streamly.Data.Stream.Prelude
6161 -- | Stream combinators using a concurrent channel.
6262
6363 -- *** Evaluate
64− -- | Evaluates a serial stream asynchronously using a concurency channel.
64+ -- | Evaluate a stream as a whole concurrently with respect to the consumer
65+ -- of the stream.
6566
6667 , parEval
6768
6869 -- *** Generate
69− -- | Uses a concurrency channel to evaluate multiple actions concurrently.
70+ -- | Generate a stream by evaluating multiple actions concurrently.
7071 , parRepeatM
7172 , parReplicateM
7273 , fromCallback
7374
7475 -- *** Map
75− -- | Uses a concurrency channel to evaluate multiple mapped actions
76− -- concurrently.
76+ -- | Map actions on a stream such that the mapped actions are evaluated
77+ -- concurrently with each other.
7778
7879 , parMapM
7980 , parSequence
8081
8182 -- *** 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.
8386 , parZipWithM
8487 , parZipWith
8588 , parMergeByM
@@ -157,16 +160,18 @@ import Streamly.Internal.Data.Stream.Prelude
157160-- 'parConcatMap', and 'parConcatIterate', all concurrency combinators can be
158161-- expressed in terms of these.
159162--
160−-- 'parEval', evaluates a single stream asynchronously, a worker thread runs
161−-- the stream and buffers the results, and the consumer of the stream runs in
162−-- another thread consuming it from the buffer, thus decoupling the production
163−-- and consumption of the stream. This can be used to run different stages of a
164−-- pipeline concurrently.
165−--
166−-- 'parConcatMap' is used to evaluate multiple streams concurrently and combine
167−-- the results. A stream generator function is mapped to the input stream and
168−-- all the generated streams are then evaluated concurrently, and the results
169−-- are combined.
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
165+-- the stream ahead of time and buffers the results; the consumer of the stream
166+-- runs in another thread consuming the elements from the buffer, thus
167+-- decoupling the production and consumption of the stream. 'parEval' can be
168+-- used to run different stages of a pipeline concurrently.
169+--
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
172+-- combine the results. A stream generator function is mapped to the input
173+-- stream and all the generated streams are then evaluated concurrently, and
174+-- the results are combined.
170175--
171176-- 'parConcatIterate' is like 'parConcatMap' but iterates a stream generator
172177-- function recursively over the stream. This can be used to traverse trees or