@@ -21,7 +21,8 @@ module Streamly.Streams
2121 (
2222 IsStream (..)
2323 , Streaming -- deprecated
24− , MonadAsync
24+ , MonadParallel
25+ , S.MonadAsync -- deprecated
2526
2627 -- * SVars
2728 , SVarSched (..)
@@ -65,7 +66,8 @@ module Streamly.Streams
6566 , ParallelT
6667 , ZipSerial
6768 , ZipStream -- deprecated
68− , ZipAsync
69+ , ZipParallel
70+ , ZipAsync -- deprecated
6971
7072 -- * Type Adapters
7173 , serially
@@ -74,8 +76,10 @@ module Streamly.Streams
7476 , coparallely
7577 , asyncly -- deprecated
7678 , parallely
77− , zipping
78− , zippingAsync
79+ , zipSerially
80+ , zipping -- deprecated
81+ , zipParallely
82+ , zippingAsync -- deprecated
7983 , adapt
8084
8185 -- * Running Streams
@@ -88,10 +92,10 @@ module Streamly.Streams
8892
8993 -- * Zipping
9094 , zipWith
91− , zipAsyncWith
95+ , zipParallelWith
96+ , zipAsyncWith -- deprecated
9297
9398 -- * Fold Utilities
94− -- $foldutils
9599 , foldWith
96100 , foldMapWith
97101 , forEachWith
@@ -109,7 +113,7 @@ import Control.Monad.State.Class (MonadState(..))
109113import Control.Monad.Trans.Class (MonadTrans)
110114import Data.Semigroup (Semigroup(..))
111115import Prelude hiding (zipWith)
112−import Streamly.Core ( MonadAsync, Stream(Stream)
116+import Streamly.Core ( MonadParallel, Stream(Stream)
113117 , SVar, SVarStyle(..)
114118 , SVarTag(..), SVarSched(..))
115119import qualified Streamly.Core as S
@@ -201,7 +205,7 @@ fromCallback :: IsStream t => (forall r. (a -> m r) -> m r) -> t m a
201205fromCallback k = fromStream $ Stream $ \_ _ yld -> k (\a -> yld a Nothing)
202206
203207-- | Read an SVar to get a stream.
204−fromSVar :: (MonadAsync m, IsStream t) => SVar m a -> t m a
208+fromSVar :: (MonadParallel m, IsStream t) => SVar m a -> t m a
205209fromSVar sv = fromStream $ S.fromStreamVar sv
206210
207211------------------------------------------------------------------------------
@@ -218,7 +222,9 @@ streamFold sv step blank m =
218222 yield a (Just x) = step a (Just (fromStream x))
219223 in (S.runStream (toStream m)) sv blank yield
220224
221−-- | Run a streaming composition, discard the results.
225+-- | Run a streaming composition, discard the results. By default it interprets
226+-- the stream as 'SerialT', to run other types of streams use the type adapting
227+-- combinators for example @runStream . 'parallely'@.
222228runStream :: Monad m => SerialT m a -> m ()
223229runStream m = go (toStream m)
224230 where
@@ -235,7 +241,7 @@ runStreaming = runStream . adapt
235241
236242-- | Write a stream to an 'SVar' in a non-blocking manner. The stream can then
237243-- be read back from the SVar using 'fromSVar'.
238−toSVar :: (IsStream t, MonadAsync m) => SVar m a -> t m a -> m ()
244+toSVar :: (IsStream t, MonadParallel m) => SVar m a -> t m a -> m ()
239245toSVar sv m = S.toStreamVar sv (toStream m)
240246
241247------------------------------------------------------------------------------
@@ -249,7 +255,7 @@ toSVar sv m = S.toStreamVar sv (toStream m)
249255-- not drained fully we may have a thread blocked forever and once exhausted it
250256-- will always return 'empty'.
251257
252−async :: (IsStream t, MonadAsync m) => t m a -> m (t m a)
258+async :: (IsStream t, MonadParallel m) => t m a -> m (t m a)
253259async m = do
254260 sv <- S.newStreamVar1 (SVarStyle Disjunction LIFO) (toStream m)
255261 return $ fromSVar sv
@@ -311,8 +317,8 @@ async m = do
311317newtype SerialT m a = SerialT {getSerialT :: Stream m a}
312318 deriving (Semigroup, Monoid, MonadTrans, MonadIO, MonadThrow)
313319
314−deriving instance MonadAsync m => Alternative (SerialT m)
315−deriving instance MonadAsync m => MonadPlus (SerialT m)
320+deriving instance MonadParallel m => Alternative (SerialT m)
321+deriving instance MonadParallel m => MonadPlus (SerialT m)
316322deriving instance (MonadBase b m, Monad m) => MonadBase b (SerialT m)
317323deriving instance MonadError e m => MonadError e (SerialT m)
318324deriving instance MonadReader r m => MonadReader r (SerialT m)
@@ -454,8 +460,8 @@ instance (Monad m, Floating a) => Floating (SerialT m a) where
454460newtype CoserialT m a = CoserialT {getCoserialT :: Stream m a}
455461 deriving (Monoid, MonadTrans, MonadIO, MonadThrow)
456462
457−deriving instance MonadAsync m => Alternative (CoserialT m)
458−deriving instance MonadAsync m => MonadPlus (CoserialT m)
463+deriving instance MonadParallel m => Alternative (CoserialT m)
464+deriving instance MonadParallel m => MonadPlus (CoserialT m)
459465deriving instance (MonadBase b m, Monad m) => MonadBase b (CoserialT m)
460466deriving instance MonadError e m => MonadError e (CoserialT m)
461467deriving instance MonadReader r m => MonadReader r (CoserialT m)
@@ -610,15 +616,15 @@ instance (Monad m, Floating a) => Floating (CoserialT m a) where
610616newtype CoparallelT m a = CoparallelT {getCoparallelT :: Stream m a}
611617 deriving (MonadTrans)
612618
613−deriving instance MonadAsync m => Monoid (CoparallelT m a)
614−deriving instance MonadAsync m => Alternative (CoparallelT m)
615−deriving instance MonadAsync m => MonadPlus (CoparallelT m)
616−deriving instance MonadAsync m => MonadIO (CoparallelT m)
617−deriving instance MonadAsync m => MonadThrow (CoparallelT m)
618−deriving instance (MonadBase b m, MonadAsync m) => MonadBase b (CoparallelT m)
619−deriving instance (MonadError e m, MonadAsync m) => MonadError e (CoparallelT m)
620−deriving instance (MonadReader r m, MonadAsync m) => MonadReader r (CoparallelT m)
621−deriving instance (MonadState s m, MonadAsync m) => MonadState s (CoparallelT m)
619+deriving instance MonadParallel m => Monoid (CoparallelT m a)
620+deriving instance MonadParallel m => Alternative (CoparallelT m)
621+deriving instance MonadParallel m => MonadPlus (CoparallelT m)
622+deriving instance MonadParallel m => MonadIO (CoparallelT m)
623+deriving instance MonadParallel m => MonadThrow (CoparallelT m)
624+deriving instance (MonadBase b m, MonadParallel m) => MonadBase b (CoparallelT m)
625+deriving instance (MonadError e m, MonadParallel m) => MonadError e (CoparallelT m)
626+deriving instance (MonadReader r m, MonadParallel m) => MonadReader r (CoparallelT m)
627+deriving instance (MonadState s m, MonadParallel m) => MonadState s (CoparallelT m)
622628
623629{-# DEPRECATED AsyncT "Please use 'CoparallelT' instead." #-}
624630type AsyncT = CoparallelT
@@ -635,16 +641,16 @@ instance IsStream CoparallelT where
635641-- polymorphic. Merges two streams possibly concurrently, preferring the
636642-- elements from the left one when available.
637643{-# INLINE coparallel #-}
638−coparallel :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
644+coparallel :: (IsStream t, MonadParallel m) => t m a -> t m a -> t m a
639645coparallel m1 m2 = fromStream $ S.coparallel (toStream m1) (toStream m2)
640646
641−instance MonadAsync m => Semigroup (CoparallelT m a) where
647+instance MonadParallel m => Semigroup (CoparallelT m a) where
642648 (<>) = coparallel
643649
644650-- | Same as 'coparallel'.
645651{-# DEPRECATED (<|) "Please use 'coparallel' instead." #-}
646652{-# INLINE (<|) #-}
647−(<|) :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
653+(<|) :: (IsStream t, MonadParallel m) => t m a -> t m a -> t m a
648654(<|) = coparallel
649655
650656------------------------------------------------------------------------------
@@ -666,7 +672,7 @@ parbind par m f = go m
666672 yield a (Just r) = run $ f a `par` go r
667673 in g Nothing stp yield
668674
669−instance MonadAsync m => Monad (CoparallelT m) where
675+instance MonadParallel m => Monad (CoparallelT m) where
670676 return = pure
671677 (CoparallelT m) >>= f = CoparallelT $ parbind par m g
672678 where g x = getCoparallelT (f x)
@@ -676,7 +682,7 @@ instance MonadAsync m => Monad (CoparallelT m) where
676682-- Applicative
677683------------------------------------------------------------------------------
678684
679−instance MonadAsync m => Applicative (CoparallelT m) where
685+instance MonadParallel m => Applicative (CoparallelT m) where
680686 pure a = CoparallelT $ S.cons a Nothing
681687 (<*>) = ap
682688
@@ -694,7 +700,7 @@ instance Monad m => Functor (CoparallelT m) where
694700-- Num
695701------------------------------------------------------------------------------
696702
697−instance (MonadAsync m, Num a) => Num (CoparallelT m a) where
703+instance (MonadParallel m, Num a) => Num (CoparallelT m a) where
698704 fromInteger n = pure (fromInteger n)
699705
700706 negate = fmap negate
@@ -705,14 +711,14 @@ instance (MonadAsync m, Num a) => Num (CoparallelT m a) where
705711 (*) = liftA2 (*)
706712 (-) = liftA2 (-)
707713
708−instance (MonadAsync m, Fractional a) => Fractional (CoparallelT m a) where
714+instance (MonadParallel m, Fractional a) => Fractional (CoparallelT m a) where
709715 fromRational n = pure (fromRational n)
710716
711717 recip = fmap recip
712718
713719 (/) = liftA2 (/)
714720
715−instance (MonadAsync m, Floating a) => Floating (CoparallelT m a) where
721+instance (MonadParallel m, Floating a) => Floating (CoparallelT m a) where
716722 pi = pure pi
717723
718724 exp = fmap exp
@@ -778,15 +784,15 @@ instance (MonadAsync m, Floating a) => Floating (CoparallelT m a) where
778784newtype ParallelT m a = ParallelT {getParallelT :: Stream m a}
779785 deriving (MonadTrans)
780786
781−deriving instance MonadAsync m => Monoid (ParallelT m a)
782−deriving instance MonadAsync m => Alternative (ParallelT m)
783−deriving instance MonadAsync m => MonadPlus (ParallelT m)
784−deriving instance MonadAsync m => MonadIO (ParallelT m)
785−deriving instance MonadAsync m => MonadThrow (ParallelT m)
786−deriving instance (MonadBase b m, MonadAsync m) => MonadBase b (ParallelT m)
787−deriving instance (MonadError e m, MonadAsync m) => MonadError e (ParallelT m)
788−deriving instance (MonadReader r m, MonadAsync m) => MonadReader r (ParallelT m)
789−deriving instance (MonadState s m, MonadAsync m) => MonadState s (ParallelT m)
787+deriving instance MonadParallel m => Monoid (ParallelT m a)
788+deriving instance MonadParallel m => Alternative (ParallelT m)
789+deriving instance MonadParallel m => MonadPlus (ParallelT m)
790+deriving instance MonadParallel m => MonadIO (ParallelT m)
791+deriving instance MonadParallel m => MonadThrow (ParallelT m)
792+deriving instance (MonadBase b m, MonadParallel m) => MonadBase b (ParallelT m)
793+deriving instance (MonadError e m, MonadParallel m) => MonadError e (ParallelT m)
794+deriving instance (MonadReader r m, MonadParallel m) => MonadReader r (ParallelT m)
795+deriving instance (MonadState s m, MonadParallel m) => MonadState s (ParallelT m)
790796
791797instance IsStream ParallelT where
792798 toStream = getParallelT
@@ -799,17 +805,17 @@ instance IsStream ParallelT where
799805-- | Polymorphic version of the 'Semigroup' operation '<>' of 'ParallelT'.
800806-- Merges two streams concurrently choosing elements from both fairly.
801807{-# INLINE parallel #-}
802−parallel :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
808+parallel :: (IsStream t, MonadParallel m) => t m a -> t m a -> t m a
803809parallel m1 m2 = fromStream $ S.parallel (toStream m1) (toStream m2)
804810
805−instance MonadAsync m => Semigroup (ParallelT m a) where
811+instance MonadParallel m => Semigroup (ParallelT m a) where
806812 (<>) = parallel
807813
808814------------------------------------------------------------------------------
809815-- Monad
810816------------------------------------------------------------------------------
811817
812−instance MonadAsync m => Monad (ParallelT m) where
818+instance MonadParallel m => Monad (ParallelT m) where
813819 return = pure
814820 (ParallelT m) >>= f = ParallelT $ parbind par m g
815821 where g x = getParallelT (f x)
@@ -819,7 +825,7 @@ instance MonadAsync m => Monad (ParallelT m) where
819825-- Applicative
820826------------------------------------------------------------------------------
821827
822−instance MonadAsync m => Applicative (ParallelT m) where
828+instance MonadParallel m => Applicative (ParallelT m) where
823829 pure a = ParallelT $ S.cons a Nothing
824830 (<*>) = ap
825831
@@ -838,7 +844,7 @@ instance Monad m => Functor (ParallelT m) where
838844-- Num
839845------------------------------------------------------------------------------
840846
841−instance (MonadAsync m, Num a) => Num (ParallelT m a) where
847+instance (MonadParallel m, Num a) => Num (ParallelT m a) where
842848 fromInteger n = pure (fromInteger n)
843849
844850 negate = fmap negate
@@ -849,14 +855,14 @@ instance (MonadAsync m, Num a) => Num (ParallelT m a) where
849855 (*) = liftA2 (*)
850856 (-) = liftA2 (-)
851857
852−instance (MonadAsync m, Fractional a) => Fractional (ParallelT m a) where
858+instance (MonadParallel m, Fractional a) => Fractional (ParallelT m a) where
853859 fromRational n = pure (fromRational n)
854860
855861 recip = fmap recip
856862
857863 (/) = liftA2 (/)
858864
859−instance (MonadAsync m, Floating a) => Floating (ParallelT m a) where
865+instance (MonadParallel m, Floating a) => Floating (ParallelT m a) where
860866 pi = pure pi
861867
862868 exp = fmap exp
@@ -897,11 +903,10 @@ zipWith f m1 m2 = fromStream $ go (toStream m1) (toStream m2)
897903
898904-- | The applicative instance of 'ZipSerial' zips a number of streams serially
899905-- i.e. it produces one element from each stream serially and then zips all
900−-- those elements. Note, for convenience we have used the 'zipping' combinator
901−-- in the following example instead of using a 'ZipSerial' type annotation.
906+-- those elements.
902907--
903908-- @
904−-- main = (toList . 'zipping' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
909+-- main = (toList . 'zipSerially' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
905910-- where s1 = fromFoldable [1, 2]
906911-- s2 = fromFoldable [3, 4]
907912-- s3 = fromFoldable [5, 6]
@@ -920,7 +925,7 @@ newtype ZipSerial m a = ZipSerial {getZipSerial :: Stream m a}
920925-- | Same as ZipSerial.
921926type ZipStream = ZipSerial
922927
923−deriving instance MonadAsync m => Alternative (ZipSerial m)
928+deriving instance MonadParallel m => Alternative (ZipSerial m)
924929
925930instance Monad m => Functor (ZipSerial m) where
926931 fmap f (ZipSerial (Stream m)) = ZipSerial $ Stream $ \_ stp yld ->
@@ -981,20 +986,25 @@ instance (Monad m, Floating a) => Floating (ZipSerial m a) where
981986-- Parallely Zipping Streams
982987------------------------------------------------------------------------------
983988
984−-- | Zip two streams asyncly (i.e. both the elements being zipped are generated
985−-- concurrently) using a pure zipping function.
986−zipAsyncWith :: (IsStream t, MonadAsync m)
989+-- | Zip two streams concurrently (i.e. both the elements being zipped are
990+-- generated concurrently) using a pure zipping function.
991+zipParallelWith :: (IsStream t, MonadParallel m)
987992 => (a -> b -> c) -> t m a -> t m b -> t m c
988−zipAsyncWith f m1 m2 = fromStream $ Stream $ \_ stp yld -> do
993+zipParallelWith f m1 m2 = fromStream $ Stream $ \_ stp yld -> do
989994 ma <- async m1
990995 mb <- async m2
991996 (S.runStream (toStream (zipWith f ma mb))) Nothing stp yld
992997
998+{-# DEPRECATED zipAsyncWith "Please use zipParallelWith instead." #-}
999+zipAsyncWith :: (IsStream t, MonadParallel m)
1000+ => (a -> b -> c) -> t m a -> t m b -> t m c
1001+zipAsyncWith = zipParallelWith
1002+
9931003-- | Like 'ZipSerial' but zips in parallel, it generates all the elements to
9941004-- be zipped concurrently.
9951005--
9961006-- @
997−-- main = (toList . 'zippingAsync' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
1007+-- main = (toList . 'zipParallely' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
9981008-- where s1 = fromFoldable [1, 2]
9991009-- s2 = fromFoldable [3, 4]
10001010-- s3 = fromFoldable [5, 6]
@@ -1006,27 +1016,30 @@ zipAsyncWith f m1 m2 = fromStream $ Stream $ \_ stp yld -> do
10061016-- The 'Semigroup' instance of this type works the same way as that of
10071017-- 'SerialT'.
10081018--
1009−newtype ZipAsync m a = ZipAsync {getZipAsync :: Stream m a}
1019+newtype ZipParallel m a = ZipParallel {getZipParallel :: Stream m a}
10101020 deriving (Semigroup, Monoid)
10111021
1012−deriving instance MonadAsync m => Alternative (ZipAsync m)
1022+{-# DEPRECATED ZipAsync "Please use ZipParallel instead." #-}
1023+type ZipAsync = ZipParallel
1024+
1025+deriving instance MonadParallel m => Alternative (ZipParallel m)
10131026
1014−instance Monad m => Functor (ZipAsync m) where
1015− fmap f (ZipAsync (Stream m)) = ZipAsync $ Stream $ \_ stp yld ->
1027+instance Monad m => Functor (ZipParallel m) where
1028+ fmap f (ZipParallel (Stream m)) = ZipParallel $ Stream $ \_ stp yld ->
10161029 let yield a Nothing = yld (f a) Nothing
10171030 yield a (Just r) = yld (f a)
1018− (Just (getZipAsync (fmap f (ZipAsync r))))
1031+ (Just (getZipParallel (fmap f (ZipParallel r))))
10191032 in m Nothing stp yield
10201033
1021−instance MonadAsync m => Applicative (ZipAsync m) where
1022− pure = ZipAsync . S.repeat
1023− (<*>) = zipAsyncWith id
1034+instance MonadParallel m => Applicative (ZipParallel m) where
1035+ pure = ZipParallel . S.repeat
1036+ (<*>) = zipParallelWith id
10241037
1025−instance IsStream ZipAsync where
1026− toStream = getZipAsync
1027− fromStream = ZipAsync
1038+instance IsStream ZipParallel where
1039+ toStream = getZipParallel
1040+ fromStream = ZipParallel
10281041
1029−instance (MonadAsync m, Num a) => Num (ZipAsync m a) where
1042+instance (MonadParallel m, Num a) => Num (ZipParallel m a) where
10301043 fromInteger n = pure (fromInteger n)
10311044
10321045 negate = fmap negate
@@ -1037,14 +1050,14 @@ instance (MonadAsync m, Num a) => Num (ZipAsync m a) where
10371050 (*) = liftA2 (*)
10381051 (-) = liftA2 (-)
10391052
1040−instance (MonadAsync m, Fractional a) => Fractional (ZipAsync m a) where
1053+instance (MonadParallel m, Fractional a) => Fractional (ZipParallel m a) where
10411054 fromRational n = pure (fromRational n)
10421055
10431056 recip = fmap recip
10441057
10451058 (/) = liftA2 (/)
10461059
1047−instance (MonadAsync m, Floating a) => Floating (ZipAsync m a) where
1060+instance (MonadParallel m, Floating a) => Floating (ZipParallel m a) where
10481061 pi = pure pi
10491062
10501063 exp = fmap exp
@@ -1101,12 +1114,22 @@ parallely :: IsStream t => ParallelT m a -> t m a
11011114parallely = adapt
11021115
11031116-- | Fix the type of a polymorphic stream as 'ZipSerial'.
1117+zipSerially :: IsStream t => ZipSerial m a -> t m a
1118+zipSerially = adapt
1119+
1120+-- | Same as 'zipParallely'.
1121+{-# DEPRECATED zipping "Please use zipSerially instead." #-}
11041122zipping :: IsStream t => ZipSerial m a -> t m a
1105−zipping = adapt
1123+zipping = zipSerially
1124+
1125+-- | Fix the type of a polymorphic stream as 'ZipParallel'.
1126+zipParallely :: IsStream t => ZipParallel m a -> t m a
1127+zipParallely = adapt
11061128
1107−-- | Fix the type of a polymorphic stream as 'ZipAsync'.
1108−zippingAsync :: IsStream t => ZipAsync m a -> t m a
1109−zippingAsync = adapt
1129+-- | Same as 'zipParallely'.
1130+{-# DEPRECATED zippingAsync "Please use zipParallely instead." #-}
1131+zippingAsync :: IsStream t => ZipParallel m a -> t m a
1132+zippingAsync = zipParallely
11101133
11111134-------------------------------------------------------------------------------
11121135-- Running Streams, convenience functions specialized to types
@@ -1133,38 +1156,33 @@ runParallelT :: Monad m => ParallelT m a -> m ()
11331156runParallelT = runStream . parallely
11341157
11351158-- | Same as @runStream . zipping@.
1136−{-# DEPRECATED runZipStream "Please use 'runStream . zipping instead." #-}
1159+{-# DEPRECATED runZipStream "Please use 'runStream . zipSerially instead." #-}
11371160runZipStream :: Monad m => ZipSerial m a -> m ()
1138−runZipStream = runStream . zipping
1161+runZipStream = runStream . zipSerially
11391162
11401163-- | Same as @runStream . zippingAsync@.
1141−{-# DEPRECATED runZipAsync "Please use 'runStream . zippingAsync instead." #-}
1142−runZipAsync :: Monad m => ZipAsync m a -> m ()
1143−runZipAsync = runStream . zippingAsync
1164+{-# DEPRECATED runZipAsync "Please use 'runStream . zipParallely instead." #-}
1165+runZipAsync :: Monad m => ZipParallel m a -> m ()
1166+runZipAsync = runStream . zipParallely
11441167
11451168------------------------------------------------------------------------------
11461169-- Fold Utilities
11471170------------------------------------------------------------------------------
11481171
1149−-- $foldutils
1150−-- These utilities are designed to pass the first argument as one of the sum
1151−-- style composition operators (i.e. '<>', '<=>', '<|', '<|>') to conveniently
1152−-- fold a container using any style of stream composition.
1153−
1154−-- | Like the 'Prelude' 'fold' but allows you to specify a binary sum style
1155−-- stream composition operator to fold a container of streams.
1172+-- | A variant of 'Data.Foldable.fold' that allows you to fold a 'Foldable'
1173+-- container of streams using the specified stream sum operation.
11561174--
1157−-- @foldWith (<>) $ map return [1..3]@
1175+-- @foldWith 'parallel' $ map return [1..3]@
11581176{-# INLINABLE foldWith #-}
11591177foldWith :: (IsStream t, Foldable f)
11601178 => (t m a -> t m a -> t m a) -> f (t m a) -> t m a
11611179foldWith f = foldr f nil
11621180
1163−-- | Like 'foldMap' but allows you to specify a binary sum style composition
1164−-- operator to fold a container of streams. Maps a monadic streaming action on
1165−-- the container before folding it.
1181+-- | A variant of 'foldMap' that allows you to map a monadic streaming action
1182+-- on a 'Foldable' container and then fold it using the specified stream sum
1183+-- operation.
11661184--
1167−-- @foldMapWith (<>) return [1..3]@
1185+-- @foldMapWith 'parallel' return [1..3]@
11681186{-# INLINABLE foldMapWith #-}
11691187foldMapWith :: (IsStream t, Foldable f)
11701188 => (t m b -> t m b -> t m b) -> (a -> t m b) -> f a -> t m b