@@ -17,8 +17,9 @@
1717
1818module Streamly.Data.Stream.Concurrent
1919 (
20− -- * Concurrency
2120 -- $concurrency
21+
22+ -- ** Types
2223 MonadAsync
2324
2425 -- ** Configuration
@@ -110,7 +111,7 @@ import Prelude hiding (mapM, sequence, concat, concatMap, zipWith)
110111
111112-- $concurrency
112113--
113−-- == Concurrency Channels
114+-- == Channels
114115--
115116-- At a lower level, concurrency is implemented using channels that support
116117-- concurrent evaluation of streams. We create a channel, and add one or more
@@ -118,7 +119,7 @@ import Prelude hiding (mapM, sequence, concat, concatMap, zipWith)
118119-- generates a single output stream from the results. How the streams are
119120-- combined depends on the configuration of the channel.
120121--
121−-- == Concurrency Primitives
122+-- == Primitives
122123--
123124-- There are only a few fundamental abstractions for concurrency, 'parEval',
124125-- 'parConcatMap', and 'parConcatIterate', all concurrency combinators can be
@@ -139,7 +140,7 @@ import Prelude hiding (mapM, sequence, concat, concatMap, zipWith)
139140-- function recursively over the stream. This can be used to traverse trees or
140141-- graphs.
141142--
142−-- == Concurrency Configuration
143+-- == Configuration
143144--
144145-- Concurrent combinators take a 'Config' argument which controls the
145146-- concurrent behavior. For example, maximum number of threads to be used
@@ -158,7 +159,7 @@ import Prelude hiding (mapM, sequence, concat, concatMap, zipWith)
158159-- documentation for the default behavior and default values of configuration
159160-- parameters.
160161--
161−-- == Scheduling behavior
162+-- == Scheduling
162163--
163164-- The most important configuration option is to control whether the output of
164165-- the concurrent execution is consumed in the same order as the corresponding
@@ -174,7 +175,7 @@ import Prelude hiding (mapM, sequence, concat, concatMap, zipWith)
174175-- if the stream consumer thread blocks it does not make any impact on the
175176-- scheduling of the available tasks.
176177--
177−-- == Concurrent Combinators
178+-- == Combinators
178179--
179180-- Using the few fundamental concurrency primitives we can implement all the
180181-- usual streaming combinators with concurrent behavior. Combinators like