@@ -139,7 +139,7 @@ import Streamly.Internal.Data.Stream.Concurrent.Channel
139139-- >>> import qualified Streamly.Data.Fold as Fold
140140-- >>> import qualified Streamly.Data.Parser as Parser
141141-- >>> import qualified Streamly.Data.Stream as Stream
142−-- >>> import qualified Streamly.Internal.Data.Stream.Concurrent as Async
142+-- >>> import qualified Streamly.Internal.Data.Stream.Concurrent as Concur
143143-- >>> import Prelude hiding (concatMap, concat, zipWith)
144144-- >>> :{
145145-- delay n = do
@@ -185,7 +185,7 @@ evalWith modifier input = withChannel modifier input (const id)
185185-- | Evaluate a stream asynchronously using a channel and serve the consumer
186186-- from the evaluation buffer.
187187--
188−-- >>> eval = Async.evalWith id
188+-- >>> eval = Concur.evalWith id
189189--
190190{-# INLINE eval #-}
191191eval :: MonadAsync m => Stream m a -> Stream m a
@@ -270,13 +270,13 @@ combineWith modifier stream1 stream2 =
270270-- all streams. However, with this operation you can precisely control the
271271-- scheduling by creating arbitrary shape expression trees.
272272--
273−-- >>> append2 = Async.combineWith id
273+-- >>> append2 = Concur.combineWith id
274274--
275275-- The following code finishes in 4 seconds:
276276--
277277-- >>> stream1 = Stream.fromEffect (delay 4)
278278-- >>> stream2 = Stream.fromEffect (delay 2)
279−-- >>> Stream.fold Fold.toList $ stream1 `Async.append2` stream2
279+-- >>> Stream.fold Fold.toList $ stream1 `Concur.append2` stream2
280280-- 2 sec
281281-- 4 sec
282282-- [2,4]
@@ -289,7 +289,7 @@ append2 = combineWith id
289289-- the left stream. This schedules all streams in a round robin fashion over
290290-- limited number of threads.
291291--
292−-- >>> interleave2 = Async.combineWith (Async.interleaved True)
292+-- >>> interleave2 = Concur.combineWith (Concur.interleaved True)
293293--
294294{-# INLINE interleave2 #-}
295295interleave2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
@@ -297,7 +297,7 @@ interleave2 = combineWith (interleaved True)
297297
298298-- | Like 'append' but with 'ordered' on.
299299--
300−-- >>> ahead2 = Async.combineWith (Async.ordered True)
300+-- >>> ahead2 = Concur.combineWith (Concur.ordered True)
301301--
302302{-# INLINE ahead2 #-}
303303ahead2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
@@ -305,7 +305,7 @@ ahead2 = combineWith (ordered True)
305305
306306-- | Like 'append2' but with 'eager' on.
307307--
308−-- >>> parallel2 = Async.combineWith (Async.eager True)
308+-- >>> parallel2 = Concur.combineWith (Concur.eager True)
309309--
310310{-# INLINE parallel2 #-}
311311parallel2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
@@ -313,7 +313,7 @@ parallel2 = combineWith (eager True)
313313
314314-- | Like 'parallel2' but stops the output as soon as the first stream stops.
315315--
316−-- >>> parallelFst2 = Async.combineWith (Async.eager True . Async.stopWhen Async.FirstStops)
316+-- >>> parallelFst2 = Concur.combineWith (Concur.eager True . Concur.stopWhen Concur.FirstStops)
317317--
318318-- /Pre-release/
319319{-# INLINE parallelFst2 #-}
@@ -323,7 +323,7 @@ parallelFst2 = combineWith (eager True . stopWhen FirstStops)
323323-- | Like 'parallel2' but stops the output as soon as any of the two streams
324324-- stops.
325325--
326−-- >>> parallelMin2 = Async.combineWith (Async.eager True . Async.stopWhen Async.AnyStops)
326+-- >>> parallelMin2 = Concur.combineWith (Concur.eager True . Concur.stopWhen Concur.AnyStops)
327327--
328328-- /Pre-release/
329329{-# INLINE parallelMin2 #-}
@@ -440,9 +440,9 @@ concatMapWith modifier f stream =
440440-- concurrently but earlier streams are perferred. Output from the streams are
441441-- used as they arrive.
442442--
443−-- >>> concatMap = Async.concatMapWith id
443+-- >>> concatMap = Concur.concatMapWith id
444444--
445−-- >>> f cfg xs = Stream.fold Fold.toList $ Async.concatMapWith cfg id $ Stream.fromList xs
445+-- >>> f cfg xs = Stream.fold Fold.toList $ Concur.concatMapWith cfg id $ Stream.fromList xs
446446--
447447-- The following streams finish in 4 seconds:
448448--
@@ -458,19 +458,19 @@ concatMapWith modifier f stream =
458458-- Limiting threads to 2 schedules the third stream only after one of the first
459459-- two has finished, releasing a thread:
460460--
461−-- >>> f (Async.maxThreads 2) [stream1, stream2, stream3]
461+-- >>> f (Concur.maxThreads 2) [stream1, stream2, stream3]
462462-- ...
463463-- [2,1,4]
464464--
465465-- When used with a Single thread it behaves like serial concatMap:
466466--
467−-- >>> f (Async.maxThreads 1) [stream1, stream2, stream3]
467+-- >>> f (Concur.maxThreads 1) [stream1, stream2, stream3]
468468-- ...
469469-- [4,2,1]
470470--
471471-- >>> stream1 = Stream.fromList [1,2,3]
472472-- >>> stream2 = Stream.fromList [4,5,6]
473−-- >>> f (Async.maxThreads 1) [stream1, stream2]
473+-- >>> f (Concur.maxThreads 1) [stream1, stream2]
474474-- [1,2,3,4,5,6]
475475--
476476{-# INLINE concatMap #-}
@@ -482,15 +482,15 @@ concatMap = concatMapWith id
482482-- evaluate the earlier stream first, this schedules all streams in a round
483483-- robin fashion over the available threads.
484484--
485−-- >>> concatMapInterleave = Async.concatMapWith (Async.interleaved True)
485+-- >>> concatMapInterleave = Concur.concatMapWith (Concur.interleaved True)
486486--
487487-- When used with a single thread it behaves like serial interleaving:
488488--
489−-- >>> f cfg xs = Stream.fold Fold.toList $ Async.concatMapWith (Async.interleaved True . cfg) id $ Stream.fromList xs
489+-- >>> f cfg xs = Stream.fold Fold.toList $ Concur.concatMapWith (Concur.interleaved True . cfg) id $ Stream.fromList xs
490490--
491491-- >>> stream1 = Stream.fromList [1,2,3]
492492-- >>> stream2 = Stream.fromList [4,5,6]
493−-- >>> f (Async.maxThreads 1) [stream1, stream2]
493+-- >>> f (Concur.maxThreads 1) [stream1, stream2]
494494-- [1,4,2,5,3,6]
495495--
496496-- /Works only on finite number of streams/
@@ -502,7 +502,7 @@ concatMapInterleave = concatMapWith (interleaved True)
502502-- | Like 'concat' but we can also specify the concurrent channel's
503503-- configuration parameters using Config modifiers.
504504--
505−-- >>> concatWith modifier = Async.concatMapWith modifier id
505+-- >>> concatWith modifier = Concur.concatMapWith modifier id
506506--
507507{-# INLINE concatWith #-}
508508concatWith :: MonadAsync m =>
@@ -511,7 +511,7 @@ concatWith modifier = concatMapWith modifier id
511511
512512-- | Evaluate the streams in the input stream concurrently and combine them.
513513--
514−-- >>> concat = Async.concatWith id
514+-- >>> concat = Concur.concatWith id
515515--
516516{-# INLINE concat #-}
517517concat :: MonadAsync m => Stream m (Stream m a) -> Stream m a
@@ -523,7 +523,7 @@ concat = concatWith id
523523
524524-- | Like 'concatWith' but works on a list of streams.
525525--
526−-- >>> concatListWith modifier = Async.concatWith modifier . Stream.fromList
526+-- >>> concatListWith modifier = Concur.concatWith modifier . Stream.fromList
527527--
528528{-# INLINE concatListWith #-}
529529concatListWith :: MonadAsync m => (Config -> Config) -> [Stream m a] -> Stream m a
@@ -531,7 +531,7 @@ concatListWith modifier = concatWith modifier . Stream.fromList
531531
532532-- | Like 'concat' but works on a list of streams.
533533--
534−-- >>> append = Async.concatListWith id
534+-- >>> append = Concur.concatListWith id
535535--
536536{-# INLINE append #-}
537537append :: MonadAsync m => [Stream m a] -> Stream m a
@@ -541,7 +541,7 @@ append = concatListWith id
541541-- the left stream. This schedules all streams in a round robin fashion over
542542-- limited number of threads.
543543--
544−-- >>> interleave = Async.concatListWith (Async.interleaved True)
544+-- >>> interleave = Concur.concatListWith (Concur.interleaved True)
545545--
546546{-# INLINE interleave #-}
547547interleave :: MonadAsync m => [Stream m a] -> Stream m a
@@ -549,7 +549,7 @@ interleave = concatListWith (interleaved True)
549549
550550-- | Like 'append' but with 'ordered' on.
551551--
552−-- >>> ahead = Async.concatListWith (Async.ordered True)
552+-- >>> ahead = Concur.concatListWith (Concur.ordered True)
553553--
554554{-# INLINE ahead #-}
555555ahead :: MonadAsync m => [Stream m a] -> Stream m a
@@ -557,7 +557,7 @@ ahead = concatListWith (ordered True)
557557
558558-- | Like 'append' but with 'eager' on.
559559--
560−-- >>> parallel = Async.concatListWith (Async.eager True)
560+-- >>> parallel = Concur.concatListWith (Concur.eager True)
561561--
562562{-# INLINE parallel #-}
563563parallel :: MonadAsync m => [Stream m a] -> Stream m a
@@ -565,7 +565,7 @@ parallel = concatListWith (eager True)
565565
566566-- | Like 'parallel' but stops the output as soon as the first stream stops.
567567--
568−-- >>> parallelFst = Async.concatListWith (Async.eager True . Async.stopWhen Async.FirstStops)
568+-- >>> parallelFst = Concur.concatListWith (Concur.eager True . Concur.stopWhen Concur.FirstStops)
569569--
570570{-# INLINE parallelFst #-}
571571parallelFst :: MonadAsync m => [Stream m a] -> Stream m a
@@ -574,7 +574,7 @@ parallelFst = concatListWith (eager True . stopWhen FirstStops)
574574-- | Like 'parallel' but stops the output as soon as any of the two streams
575575-- stops.
576576--
577−-- >>> parallelMin = Async.concatListWith (Async.eager True . Async.stopWhen Async.AnyStops)
577+-- >>> parallelMin = Concur.concatListWith (Concur.eager True . Concur.stopWhen Concur.AnyStops)
578578--
579579{-# INLINE parallelMin #-}
580580parallelMin :: MonadAsync m => [Stream m a] -> Stream m a
@@ -605,7 +605,7 @@ apply = applyWith id
605605-------------------------------------------------------------------------------
606606
607607-- |
608−-- >>> mapMWith modifier f = Async.concatMapWith modifier (Stream.fromEffect . f)
608+-- >>> mapMWith modifier f = Concur.concatMapWith modifier (Stream.fromEffect . f)
609609--
610610{-# INLINE mapMWith #-}
611611mapMWith :: MonadAsync m =>
@@ -613,13 +613,13 @@ mapMWith :: MonadAsync m =>
613613mapMWith modifier f = concatMapWith modifier (Stream.fromEffect . f)
614614
615615-- |
616−-- >>> mapM = Async.mapMWith id
616+-- >>> mapM = Concur.mapMWith id
617617{-# INLINE mapM #-}
618618mapM :: MonadAsync m => (a -> m b) -> Stream m a -> Stream m b
619619mapM = mapMWith id
620620
621621-- |
622−-- >>> sequenceWith modifier = Async.mapMWith modifier id
622+-- >>> sequenceWith modifier = Concur.mapMWith modifier id
623623--
624624{-# INLINE sequenceWith #-}
625625sequenceWith :: MonadAsync m =>
@@ -627,7 +627,7 @@ sequenceWith :: MonadAsync m =>
627627sequenceWith modifier = mapMWith modifier id
628628
629629-- |
630−-- >>> sequence = Async.sequenceWith id
630+-- >>> sequence = Concur.sequenceWith id
631631--
632632{-# INLINE sequence #-}
633633sequence :: MonadAsync m =>
@@ -635,7 +635,7 @@ sequence :: MonadAsync m =>
635635sequence = sequenceWith id
636636
637637-- |
638−-- >>> zipWithM f m1 m2 = Stream.zipWithM f (Async.eval m1) (Async.eval m2)
638+-- >>> zipWithM f m1 m2 = Stream.zipWithM f (Concur.eval m1) (Concur.eval m2)
639639--
640640{-# INLINE zipWithM #-}
641641zipWithM :: MonadAsync m
@@ -647,7 +647,7 @@ zipWithM f m1 m2 = Stream.zipWithM f (eval m1) (eval m2)
647647--
648648-- >>> m1 = Stream.fromList [1,2,3]
649649-- >>> m2 = Stream.fromList [4,5,6]
650−-- >>> Stream.fold Fold.toList $ Async.zipWith (,) m1 m2
650+-- >>> Stream.fold Fold.toList $ Concur.zipWith (,) m1 m2
651651-- [(1,4),(2,5),(3,6)]
652652--
653653{-# INLINE zipWith #-}