@@ -289,46 +289,46 @@ append2 = combineWith id
289-- the left stream. This schedules all streams in a round robin fashion over
289-- the left stream. This schedules all streams in a round robin fashion over
290-- limited number of threads.
290-- limited number of threads.
292−-- >>> interleave2 = Async.combineWith Async.interleaved
292+-- >>> interleave2 = Async.combineWith (Async.interleaved True)
294{-# INLINE interleave2 #-}
294{-# INLINE interleave2 #-}
295interleave2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
295interleave2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
296−interleave2 = combineWith interleaved
296+interleave2 = combineWith (interleaved True)
298-- | Like 'append' but with 'ordered' on.
298-- | Like 'append' but with 'ordered' on.
300−-- >>> ahead2 = Async.combineWith Async.ordered
300+-- >>> ahead2 = Async.combineWith (Async.ordered True)
302{-# INLINE ahead2 #-}
302{-# INLINE ahead2 #-}
303ahead2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
303ahead2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
304−ahead2 = combineWith ordered
304+ahead2 = combineWith (ordered True)
306-- | Like 'append2' but with 'eager' on.
306-- | Like 'append2' but with 'eager' on.
308−-- >>> parallel2 = Async.combineWith Async.eager
308+-- >>> parallel2 = Async.combineWith (Async.eager True)
310{-# INLINE parallel2 #-}
310{-# INLINE parallel2 #-}
311parallel2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
311parallel2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
312−parallel2 = combineWith eager
312+parallel2 = combineWith (eager True)
314-- | Like 'parallel2' but stops the output as soon as the first stream stops.
314-- | Like 'parallel2' but stops the output as soon as the first stream stops.
316−-- >>> parallelFst2 = Async.combineWith (Async.eager . Async.stopWhen Async.FirstStops)
316+-- >>> parallelFst2 = Async.combineWith (Async.eager True . Async.stopWhen Async.FirstStops)
318-- /Pre-release/
318-- /Pre-release/
319{-# INLINE parallelFst2 #-}
319{-# INLINE parallelFst2 #-}
320parallelFst2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
320parallelFst2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
321−parallelFst2 = combineWith (eager . stopWhen FirstStops)
321+parallelFst2 = combineWith (eager True . stopWhen FirstStops)
323-- | Like 'parallel2' but stops the output as soon as any of the two streams
323-- | Like 'parallel2' but stops the output as soon as any of the two streams
326−-- >>> parallelMin2 = Async.combineWith (Async.eager . Async.stopWhen Async.AnyStops)
326+-- >>> parallelMin2 = Async.combineWith (Async.eager True . Async.stopWhen Async.AnyStops)
328-- /Pre-release/
328-- /Pre-release/
329{-# INLINE parallelMin2 #-}
329{-# INLINE parallelMin2 #-}
330parallelMin2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
330parallelMin2 :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
331−parallelMin2 = combineWith (eager . stopWhen AnyStops)
331+parallelMin2 = combineWith (eager True . stopWhen AnyStops)
333-------------------------------------------------------------------------------
333-------------------------------------------------------------------------------
334-- concat streams
334-- concat streams
@@ -482,11 +482,11 @@ concatMap = concatMapWith id
482-- evaluate the earlier stream first, this schedules all streams in a round
482-- evaluate the earlier stream first, this schedules all streams in a round
483-- robin fashion over the available threads.
483-- robin fashion over the available threads.
485−-- >>> concatMapInterleave = Async.concatMapWith Async.interleaved
485+-- >>> concatMapInterleave = Async.concatMapWith (Async.interleaved True)
487-- When used with a single thread it behaves like serial interleaving:
487-- When used with a single thread it behaves like serial interleaving:
489−-- >>> f cfg xs = Stream.fold Fold.toList $ Async.concatMapWith (Async.interleaved . cfg) id $ Stream.fromList xs
489+-- >>> f cfg xs = Stream.fold Fold.toList $ Async.concatMapWith (Async.interleaved True . cfg) id $ Stream.fromList xs
491-- >>> stream1 = Stream.fromList [1,2,3]
491-- >>> stream1 = Stream.fromList [1,2,3]
492-- >>> stream2 = Stream.fromList [4,5,6]
492-- >>> stream2 = Stream.fromList [4,5,6]
@@ -497,7 +497,7 @@ concatMap = concatMapWith id
498{-# INLINE concatMapInterleave #-}
498{-# INLINE concatMapInterleave #-}
499concatMapInterleave :: MonadAsync m => (a -> Stream m b) -> Stream m a -> Stream m b
499concatMapInterleave :: MonadAsync m => (a -> Stream m b) -> Stream m a -> Stream m b
500−concatMapInterleave = concatMapWith interleaved
500+concatMapInterleave = concatMapWith (interleaved True)
502-- | Like 'concat' but we can also specify the concurrent channel's
502-- | Like 'concat' but we can also specify the concurrent channel's
503-- configuration parameters using Config modifiers.
503-- configuration parameters using Config modifiers.
@@ -541,44 +541,44 @@ append = concatListWith id
541-- the left stream. This schedules all streams in a round robin fashion over
541-- the left stream. This schedules all streams in a round robin fashion over
542-- limited number of threads.
542-- limited number of threads.
544−-- >>> interleave = Async.concatListWith Async.interleaved
544+-- >>> interleave = Async.concatListWith (Async.interleaved True)
546{-# INLINE interleave #-}
546{-# INLINE interleave #-}
547interleave :: MonadAsync m => [Stream m a] -> Stream m a
547interleave :: MonadAsync m => [Stream m a] -> Stream m a
548−interleave = concatListWith interleaved
548+interleave = concatListWith (interleaved True)
550-- | Like 'append' but with 'ordered' on.
550-- | Like 'append' but with 'ordered' on.
552−-- >>> ahead = Async.concatListWith Async.ordered
552+-- >>> ahead = Async.concatListWith (Async.ordered True)
554{-# INLINE ahead #-}
554{-# INLINE ahead #-}
555ahead :: MonadAsync m => [Stream m a] -> Stream m a
555ahead :: MonadAsync m => [Stream m a] -> Stream m a
556−ahead = concatListWith ordered
556+ahead = concatListWith (ordered True)
558-- | Like 'append' but with 'eager' on.
558-- | Like 'append' but with 'eager' on.
560−-- >>> parallel = Async.concatListWith Async.eager
560+-- >>> parallel = Async.concatListWith (Async.eager True)
562{-# INLINE parallel #-}
562{-# INLINE parallel #-}
563parallel :: MonadAsync m => [Stream m a] -> Stream m a
563parallel :: MonadAsync m => [Stream m a] -> Stream m a
564−parallel = concatListWith eager
564+parallel = concatListWith (eager True)
566-- | Like 'parallel' but stops the output as soon as the first stream stops.
566-- | Like 'parallel' but stops the output as soon as the first stream stops.
568−-- >>> parallelFst = Async.concatListWith (Async.eager . Async.stopWhen Async.FirstStops)
568+-- >>> parallelFst = Async.concatListWith (Async.eager True . Async.stopWhen Async.FirstStops)
570{-# INLINE parallelFst #-}
570{-# INLINE parallelFst #-}
571parallelFst :: MonadAsync m => [Stream m a] -> Stream m a
571parallelFst :: MonadAsync m => [Stream m a] -> Stream m a
572−parallelFst = concatListWith (eager . stopWhen FirstStops)
572+parallelFst = concatListWith (eager True . stopWhen FirstStops)
574-- | Like 'parallel' but stops the output as soon as any of the two streams
574-- | Like 'parallel' but stops the output as soon as any of the two streams
577−-- >>> parallelMin = Async.concatListWith (Async.eager . Async.stopWhen Async.AnyStops)
577+-- >>> parallelMin = Async.concatListWith (Async.eager True . Async.stopWhen Async.AnyStops)
579{-# INLINE parallelMin #-}
579{-# INLINE parallelMin #-}
580parallelMin :: MonadAsync m => [Stream m a] -> Stream m a
580parallelMin :: MonadAsync m => [Stream m a] -> Stream m a
581−parallelMin = concatListWith (eager . stopWhen AnyStops)
581+parallelMin = concatListWith (eager True . stopWhen AnyStops)
583-------------------------------------------------------------------------------
583-------------------------------------------------------------------------------
584-- Applicative
584-- Applicative
@@ -671,7 +671,7 @@ zipWith f = zipWithM (\a b -> return $ f a b)
671{-# INLINE_NORMAL newCallbackStream #-}
671{-# INLINE_NORMAL newCallbackStream #-}
672newCallbackStream :: MonadAsync m => m (a -> m (), Stream m a)
672newCallbackStream :: MonadAsync m => m (a -> m (), Stream m a)
673newCallbackStream = do
673newCallbackStream = do
674− chan <- newChannel eager
674+ chan <- newChannel (eager True)
676 -- XXX Add our own thread-id to the SVar as we can not know the callback's
676 -- XXX Add our own thread-id to the SVar as we can not know the callback's
677 -- thread-id and the callback is not run in a managed worker. We need to
677 -- thread-id and the callback is not run in a managed worker. We need to