on master help sign in
rename some zip operations and MonadAsync type
commit071a90a00c6b5fb2465070f2961fbfc311603ed3 authorHarendra Kumar <harendra.kumar@gmail.com> dateWed 18 Apr 2018, 20:14 (8 years ago) parentacd550c
10 files changed+234−180
Changelog.md+8−3 src/Streamly.hs+53−33 src/Streamly/Core.hs+21−17 src/Streamly/Examples/AcidRainGame.hs+1−1 src/Streamly/Examples/MergeSortedStreams.hs+2−2 src/Streamly/Examples/SearchEngineQuery.hs+1−1 src/Streamly/Prelude.hs+11−4 src/Streamly/Streams.hs+110−92 test/Main.hs+2−2 test/Prop.hs+25−25
Changelog.md+8−3
@@ -31,19 +31,24 @@
3131
3232### Deprecations
3333* Deprecate and rename the following symbols:
34+ * `Streaming` to `IsStream`
35+ * `runStreaming` to `runStream`
3436 * `StreamT` to `SerialT`
35− * `ZipStream` to `ZipSerial`
3637 * `AsyncT` to `CoparallelT`
38+ * `ZipStream` to `ZipSerial`
39+ * `ZipAsync` to `ZipParallel`
3740 * `interleaving` to `coserially`
3841 * `asyncly` to `coparallely`
39− * `Streaming` to `IsStream`
40− * `runStreaming` to `runStream`
42+ * `zipping` to `zipSerially`
43+ * `zippingAsync` to `zipParallely`
4144 * `<=>` to `coserial`
4245 * `<|` to `coparallel`
4346 * `each` to `fromFoldable`
4447 * `scan` to `scanx`
4548 * `foldl` to `foldx`
4649 * `foldlM` to `foldxM`
50+ * `zipAsyncWith` to `zipParallelWith`
51+ * `zipAsyncWithM` to `zipParallelWithM`
4752* Deprecate and remove the following symbols:
4853 * `runStreamT`
4954 * `runInterleavedT`
src/Streamly.hs+53−33
@@ -15,30 +15,23 @@ module Streamly
1515 -- * Overview
1616 -- $overview
1717
18− MonadAsync
18+ MonadParallel
1919 , IsStream
2020
21− -- * General Stream Styles
22− -- $product
21+ -- * Serial Streams
22+ -- $serial
2323 , SerialT
2424 , CoserialT
25+
26+ -- * Parallel Streams
27+ -- $parallel
2528 , CoparallelT
2629 , ParallelT
2730
28− -- * Zip Style Streams
31+ -- * Zipping Streams
2932 -- $zipping
3033 , ZipSerial
31− , ZipAsync
32−
33− -- * Polymorphic Sum Operations
34− -- $sum
35− , serial
36− , coserial
37− , coparallel
38− , parallel
39−
40− -- * Transformation
41− , async
34+ , ZipParallel
4235
4336 -- * Stream Type Adapters
4437 -- $adapters
@@ -46,14 +39,24 @@ module Streamly
4639 , coserially
4740 , coparallely
4841 , parallely
49− , zipping
50− , zippingAsync
42+ , zipSerially
43+ , zipParallely
5144 , adapt
5245
5346 -- * Running Streams
5447 , runStream
5548
56− -- * Fold Utilities
49+ -- * Transformation
50+ , async
51+
52+ -- * Polymorphic Sum Operations
53+ -- $sum
54+ , serial
55+ , coserial
56+ , coparallel
57+ , parallel
58+
59+ -- * Polymorphic Fold Utilities
5760 -- $foldutils
5861 , foldWith
5962 , foldMapWith
@@ -68,6 +71,7 @@ module Streamly
6871 , MonadTrans (..)
6972
7073 -- * Deprecated
74+ , MonadAsync
7175 , Streaming
7276 , runStreaming
7377 , runStreamT
@@ -80,8 +84,11 @@ module Streamly
8084 , InterleavedT
8185 , AsyncT
8286 , ZipStream
87+ , ZipAsync
8388 , interleaving
8489 , asyncly
90+ , zipping
91+ , zippingAsync
8592 , (<=>)
8693 , (<|)
8794 )
@@ -129,7 +136,7 @@ import Control.Monad.Trans.Class (MonadTrans (..))
129136-- $overview
130137--
131138-- Streamly provides six distinct stream types i.e. 'SerialT', 'CoserialT',
132−-- 'CoparallelT' and 'ParallelT', 'ZipStream' and 'ZipAsync', each representing a
139+-- 'CoparallelT' and 'ParallelT', 'ZipSerial' and 'ZipParallel', each representing a
133140-- stream of elements. All these types have the same underlying representation
134141-- and can be adapted from one to another using type adaptor combinators
135142-- described later. Each of these types belongs to the 'IsStream' type class
@@ -146,10 +153,10 @@ import Control.Monad.Trans.Class (MonadTrans (..))
146153-- whereas 'CoparallelT' and 'ParallelT' are their concurrent counterparts. See the
147154-- documentation of the respective types for more details.
148155--
149−-- The types 'ZipStream' and 'ZipAsync' provide 'Applicative' instances to zip
156+-- The types 'ZipSerial' and 'ZipParallel' provide 'Applicative' instances to zip
150157-- two streams together i.e. each element in one stream is combined with the
151−-- corresponding element in the other stream. 'ZipStream' generates the streams
152−-- being zipped serially whereas 'ZipAsync' produces both the elements being
158+-- corresponding element in the other stream. 'ZipSerial' generates the streams
159+-- being zipped serially whereas 'ZipParallel' produces both the elements being
153160-- zipped concurrently.
154161--
155162-- Two streams of the same type can be merged using a sum style composition to
@@ -158,25 +165,37 @@ import Control.Monad.Trans.Class (MonadTrans (..))
158165-- (concurrent or serial) in which the elements in the resulting stream are
159166-- produced depends on the type of the stream.
160167--
161−-- Concurrent composition types 'CoparallelT', 'ParallelT', 'ZipAsync' require the
162−-- underlying monad of the streaming monad transformer to be 'MonadAsync'.
163−--
164168-- For more details please see the "Streamly.Tutorial" and "Streamly.Examples"
165169-- (the latter is available only when built with the 'examples' build flag).
166170
167171-- A simple inline example here illustrating applicative, monad and alternative
168172-- compositions.
169173
170−-- $product
174+-- $serial
175+--
176+-- Serial streams compose serially or non-concurrently. In a composed stream,
177+-- at any point of time only one constituent stream runs and yields an element.
178+-- The two serial stream types 'SerialT' and 'CoserialT' differ in how they
179+-- merge streams together in a 'Semigroup' or 'Monad' composition. As these
180+-- streams are serial, the sequence of items in a composed stream can be solely
181+-- determined by the position of elements in the consituent streams.
182+
183+-- $parallel
171184--
172−-- Streams that compose serially or non-concurrently come in two flavors i.e.
173−-- 'SerialT' and 'CoserialT'. Both of these serial flavors have
174−-- corresponding concurrent equivalents, those are 'CoparallelT' and 'ParallelT'
175−-- respectively.
185+-- Parallel streams compose parallely or concurrently. In a composed stream, at
186+-- any point of time more than one stream can run concurrently and yield
187+-- elements. The two parallel types 'ParallelT' and 'CoparallelT' differ in how
188+-- they merge streams together in a 'Semigroup' or 'Monad' composition. As
189+-- these streams compose concurrently, the sequence of items in a composed
190+-- stream cannot be determined by the position of elements in the constituent
191+-- streams. The elements are yielded by the composed stream as they are
192+-- generated by the constituent streams on a first come first serve basis.
193+-- Therefore, on each run the stream may yield elements in a different sequence
194+-- depending on the delays introduced by scheduling.
176195
177196-- $zipping
178197--
179−-- 'ZipStream' and 'ZipAsync', provide 'Applicative' instances for zipping the
198+-- 'ZipSerial' and 'ZipParallel', provide 'Applicative' instances for zipping the
180199-- corresponding elements of two streams together. Note that these types are
181200-- not monads.
182201
@@ -204,5 +223,6 @@ import Control.Monad.Trans.Class (MonadTrans (..))
204223
205224-- $foldutils
206225--
207−-- These are some convenience functions to fold any 'Foldable' container using
208−-- one of the sum composition operators to convert it into a streamly stream.
226+-- These are variants of standard 'Foldable' fold functions that use a
227+-- polymorphic stream sum operation (e.g. 'parallel' or 'coserial') to fold a
228+-- container of streams.
src/Streamly/Core.hs+21−17
@@ -18,7 +18,8 @@
1818--
1919module Streamly.Core
2020 (
21− MonadAsync
21+ MonadParallel
22+ , MonadAsync -- deprecated
2223
2324 -- * Streams
2425 , Stream (..)
@@ -213,10 +214,13 @@ newtype Stream m a =
213214 -> m r
214215 }
215216
216−-- | A monad that can perform asynchronous/concurrent IO operations. Streams
217+-- | A monad that can perform concurrent or parallel IO operations. Streams
217218-- that can be composed concurrently require the underlying monad to be
218−-- 'MonadAsync'.
219−type MonadAsync m = (MonadIO m, MonadBaseControl IO m, MonadThrow m)
219+-- 'MonadParallel'.
220+type MonadParallel m = (MonadIO m, MonadBaseControl IO m, MonadThrow m)
221+
222+{-# DEPRECATED MonadAsync "Please use MonadParallel instead." #-}
223+type MonadAsync m = MonadParallel m
220224
221225cons :: a -> Maybe (Stream m a) -> Stream m a
222226cons a r = Stream $ \_ _ yld -> yld a r
@@ -377,7 +381,7 @@ handleChildException sv e = do
377381 send sv (ChildStop tid (Just e))
378382
379383{-# NOINLINE pushWorker #-}
380−pushWorker :: MonadAsync m => SVar m a -> m ()
384+pushWorker :: MonadParallel m => SVar m a -> m ()
381385pushWorker sv =
382386 doFork (runqueue sv) (handleChildException sv) >>= addThread sv
383387
@@ -386,7 +390,7 @@ pushWorker sv =
386390-- block or make it go away entirely, depending on the number of workers and
387391-- the type of the queue.
388392{-# INLINE sendWorkerWait #-}
389−sendWorkerWait :: MonadAsync m => SVar m a -> m ()
393+sendWorkerWait :: MonadParallel m => SVar m a -> m ()
390394sendWorkerWait sv = do
391395 case svarStyle sv of
392396 SVarStyle _ LIFO -> liftIO $ threadDelay 200
@@ -401,7 +405,7 @@ sendWorkerWait sv = do
401405
402406-- | Pull a stream from an SVar.
403407{-# NOINLINE fromStreamVar #-}
404−fromStreamVar :: MonadAsync m => SVar m a -> Stream m a
408+fromStreamVar :: MonadParallel m => SVar m a -> Stream m a
405409fromStreamVar sv = Stream $ \_ stp yld -> do
406410 -- XXX if reading the IORef is costly we can use a flag in the SVar to
407411 -- indicate we are done.
@@ -479,7 +483,7 @@ getLifoSVar ctype = do
479483 in return sv
480484
481485-- | Create a new empty SVar.
482−newEmptySVar :: MonadAsync m => SVarStyle -> m (SVar m a)
486+newEmptySVar :: MonadParallel m => SVarStyle -> m (SVar m a)
483487newEmptySVar style = do
484488 liftIO $
485489 case style of
@@ -487,7 +491,7 @@ newEmptySVar style = do
487491 SVarStyle _ LIFO -> getLifoSVar style
488492
489493-- | Create a new SVar and enqueue one stream computation on it.
490−newStreamVar1 :: MonadAsync m => SVarStyle -> Stream m a -> m (SVar m a)
494+newStreamVar1 :: MonadParallel m => SVarStyle -> Stream m a -> m (SVar m a)
491495newStreamVar1 style m = do
492496 sv <- newEmptySVar style
493497 -- Note: We must have all the work on the queue before sending the
@@ -498,7 +502,7 @@ newStreamVar1 style m = do
498502 return sv
499503
500504-- | Create a new SVar and enqueue two stream computations on it.
501−newStreamVar2 :: MonadAsync m
505+newStreamVar2 :: MonadParallel m
502506 => SVarStyle -> Stream m a -> Stream m a -> m (SVar m a)
503507newStreamVar2 style m1 m2 = do
504508 -- Note: We must have all the work on the queue before sending the
@@ -519,7 +523,7 @@ newStreamVar2 style m1 m2 = do
519523
520524-- | Write a stream to an 'SVar' in a non-blocking manner. The stream can then
521525-- be read back from the SVar using 'fromSVar'.
522−toStreamVar :: MonadAsync m => SVar m a -> Stream m a -> m ()
526+toStreamVar :: MonadParallel m => SVar m a -> Stream m a -> m ()
523527toStreamVar sv m = do
524528 liftIO $ (enqueue sv) m
525529 done <- allThreadsDone sv
@@ -561,7 +565,7 @@ toStreamVar sv m = do
561565-- just the number of CPUs.
562566
563567{-# NOINLINE withNewSVar2 #-}
564−withNewSVar2 :: MonadAsync m
568+withNewSVar2 :: MonadParallel m
565569 => SVarStyle -> Stream m a -> Stream m a -> Stream m a
566570withNewSVar2 style m1 m2 = Stream $ \_ stp yld -> do
567571 sv <- newStreamVar2 style m1 m2
@@ -596,7 +600,7 @@ withNewSVar2 style m1 m2 = Stream $ \_ stp yld -> do
596600-- of the two.
597601--
598602{-# INLINE joinStreamVar2 #-}
599−joinStreamVar2 :: MonadAsync m
603+joinStreamVar2 :: MonadParallel m
600604 => SVarStyle -> Stream m a -> Stream m a -> Stream m a
601605joinStreamVar2 style m1 m2 = Stream $ \st stp yld ->
602606 case st of
@@ -609,11 +613,11 @@ joinStreamVar2 style m1 m2 = Stream $ \st stp yld ->
609613------------------------------------------------------------------------------
610614
611615{-# INLINE coparallel #-}
612−coparallel :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
616+coparallel :: MonadParallel m => Stream m a -> Stream m a -> Stream m a
613617coparallel = joinStreamVar2 (SVarStyle Disjunction LIFO)
614618
615619{-# INLINE parallel #-}
616−parallel :: MonadAsync m => Stream m a -> Stream m a -> Stream m a
620+parallel :: MonadParallel m => Stream m a -> Stream m a -> Stream m a
617621parallel = joinStreamVar2 (SVarStyle Disjunction FIFO)
618622
619623-------------------------------------------------------------------------------
@@ -647,11 +651,11 @@ alt m1 m2 = Stream $ \_ stp yld ->
647651 yield = yld
648652 in runStream m1 Nothing stop yield
649653
650−instance MonadAsync m => Alternative (Stream m) where
654+instance MonadParallel m => Alternative (Stream m) where
651655 empty = nil
652656 (<|>) = alt
653657
654−instance MonadAsync m => MonadPlus (Stream m) where
658+instance MonadParallel m => MonadPlus (Stream m) where
655659 mzero = nil
656660 mplus = (<|>)
657661
src/Streamly/Examples/AcidRainGame.hs+1−1
@@ -26,7 +26,7 @@ userAction = cycle1 $ liftIO askUser
2626acidRain :: MonadIO m => SerialT m Event
2727acidRain = cycle1 $ liftIO (threadDelay 1000000) >> return (Harm 1)
2828
29−game :: (MonadAsync m, MonadState Int m) => SerialT m ()
29+game :: (MonadParallel m, MonadState Int m) => SerialT m ()
3030game = do
3131 event <- userAction `parallel` acidRain
3232 case event of
src/Streamly/Examples/MergeSortedStreams.hs+2−2
@@ -14,14 +14,14 @@ getSorted = do
1414 let ls = take 100000 (randoms g) :: [Word16]
1515 foldMapWith (<>) return (sort ls)
1616
17−mergeAsync :: (Ord a, MonadAsync m)
17+mergeAsync :: (Ord a, MonadParallel m)
1818 => SerialT m a -> SerialT m a -> SerialT m a
1919mergeAsync a b = do
2020 x <- lift $ async a
2121 y <- lift $ async b
2222 merge x y
2323
24−merge :: (Ord a, MonadAsync m) => SerialT m a -> SerialT m a -> SerialT m a
24+merge :: (Ord a, MonadParallel m) => SerialT m a -> SerialT m a -> SerialT m a
2525merge a b = do
2626 a1 <- lift $ A.uncons a
2727 case a1 of
src/Streamly/Examples/SearchEngineQuery.hs+1−1
@@ -10,7 +10,7 @@ searchEngineQuery = do
1010 runStream . parallely $ google <> bing <> duckduckgo
1111
1212 putStrLn "\nUsing parallel applicative zip"
13− runStream . zippingAsync $ (,,) <$> google <*> bing <*> duckduckgo
13+ runStream . zipParallely $ (,,) <$> google <*> bing <*> duckduckgo
1414
1515 where
1616 get :: IsStream t => String -> t IO ()
src/Streamly/Prelude.hs+11−4
@@ -72,8 +72,8 @@ module Streamly.Prelude
7272 -- * Zipping
7373 , zipWith
7474 , zipWithM
75− , zipAsyncWith
76− , zipAsyncWithM
75+ , zipParallelWith
76+ , zipParallelWithM
7777
7878 -- * IO
7979 , fromHandle
@@ -84,6 +84,8 @@ module Streamly.Prelude
8484 , scan
8585 , foldl
8686 , foldlM
87+ , zipAsyncWith
88+ , zipAsyncWithM
8789 )
8890where
8991
@@ -569,9 +571,14 @@ zipWithM f m1 m2 = fromStream $ go (toStream m1) (toStream m2)
569571
570572-- | Zip two streams asyncly (i.e. both the elements being zipped are generated
571573-- concurrently) using a monadic zipping function.
572−zipAsyncWithM :: (IsStream t, MonadAsync m)
574+zipParallelWithM :: (IsStream t, MonadParallel m)
573575 => (a -> b -> t m c) -> t m a -> t m b -> t m c
574−zipAsyncWithM f m1 m2 = fromStream $ Stream $ \_ stp yld -> do
576+zipParallelWithM f m1 m2 = fromStream $ Stream $ \_ stp yld -> do
575577 ma <- async m1
576578 mb <- async m2
577579 (S.runStream (toStream (zipWithM f ma mb))) Nothing stp yld
580+
581+{-# DEPRECATED zipAsyncWithM "Please use zipParallelWithM instead." #-}
582+zipAsyncWithM :: (IsStream t, MonadParallel m)
583+ => (a -> b -> t m c) -> t m a -> t m b -> t m c
584+zipAsyncWithM = zipParallelWithM
src/Streamly/Streams.hs+110−92
@@ -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
test/Main.hs+2−2
@@ -91,8 +91,8 @@ main = hspec $ do
9191 describe "Interleaved Composition" $ compose coserially mempty sort
9292 describe "Left biased parallel Composition" $ compose coparallely mempty sort
9393 describe "Fair parallel Composition" $ compose parallely mempty sort
94− describe "Semigroup Composition for ZipSerial" $ compose zipping mempty id
95− describe "Semigroup Composition for ZipAsync" $ compose zippingAsync mempty id
94+ describe "Semigroup Composition for ZipSerial" $ compose zipSerially mempty id
95+ describe "Semigroup Composition for ZipAsync" $ compose zipParallely mempty id
9696 -- XXX need to check alternative compositions as well
9797 ---------------------------------------------------------------------------
9898 -- Monoidal Composition ordering checks
test/Prop.hs+25−25
@@ -260,7 +260,7 @@ zipMonadic constr t eq (a, b) =
260260 stream2 <-
261261 run
262262 ((A.toList . t)
263− (A.zipAsyncWithM (\x y -> return (x, y)) (constr a) (constr b)))
263+ (A.zipParallelWithM (\x y -> return (x, y)) (constr a) (constr b)))
264264 let list = getZipList $ (,) <$> ZipList a <*> ZipList b
265265 equals eq stream1 list
266266 equals eq stream2 list
@@ -322,18 +322,18 @@ main = hspec $ do
322322 functorOps folded "coparallely folded" coparallely sortEq
323323 functorOps A.fromFoldable "parallely" parallely sortEq
324324 functorOps folded "parallely folded" parallely sortEq
325− functorOps A.fromFoldable "zipping" zipping (==)
326− functorOps folded "zipping folded" zipping (==)
327− functorOps A.fromFoldable "zippingAsync" zippingAsync (==)
328− functorOps folded "zippingAsync folded" zippingAsync (==)
325+ functorOps A.fromFoldable "zipSerially" zipSerially (==)
326+ functorOps folded "zipSerially folded" zipSerially (==)
327+ functorOps A.fromFoldable "zipParallely" zipParallely (==)
328+ functorOps folded "zipParallely folded" zipParallely (==)
329329
330330 describe "Semigroup operations" $ do
331331 semigroupOps "serially" serially (==)
332332 semigroupOps "coserially" coserially (==)
333333 semigroupOps "coparallely" coparallely sortEq
334334 semigroupOps "parallely" parallely sortEq
335− semigroupOps "zipping" zipping (==)
336− semigroupOps "zippingAsync" zippingAsync (==)
335+ semigroupOps "zipSerially" zipSerially (==)
336+ semigroupOps "zipParallely" zipParallely (==)
337337
338338 describe "Applicative operations" $ do
339339 -- The tests using sorted equality are weaker tests
@@ -348,9 +348,9 @@ main = hspec $ do
348348 prop "parallely applicative folded" $ applicativeOps folded parallely sortEq
349349
350350 describe "Zip operations" $ do
351− prop "zipping applicative" $ zipApplicative A.fromFoldable zipping (==)
351+ prop "zipSerially applicative" $ zipApplicative A.fromFoldable zipSerially (==)
352352 -- XXX this hangs
353− -- prop "zippingAsync applicative" $ zipApplicative zippingAsync (==)
353+ -- prop "zipParallely applicative" $ zipApplicative zipParallely (==)
354354 prop "zip monadic serially" $ zipMonadic A.fromFoldable serially (==)
355355 prop "zip monadic serially folded" $ zipMonadic folded serially (==)
356356 prop "zip monadic coserially" $ zipMonadic A.fromFoldable coserially (==)
@@ -379,54 +379,54 @@ main = hspec $ do
379379 describe "Stream transform operations" $ do
380380 transformOps A.fromFoldable "serially" serially (==)
381381 transformOps A.fromFoldable "coserially" coserially (==)
382− transformOps A.fromFoldable "zipping" zipping (==)
383− transformOps A.fromFoldable "zippingAsync" zippingAsync (==)
382+ transformOps A.fromFoldable "zipSerially" zipSerially (==)
383+ transformOps A.fromFoldable "zipParallely" zipParallely (==)
384384 transformOps A.fromFoldable "coparallely" coparallely sortEq
385385 transformOps A.fromFoldable "parallely" parallely sortEq
386386
387387 transformOps folded "serially folded" serially (==)
388388 transformOps folded "coserially folded" coserially (==)
389− transformOps folded "zipping folded" zipping (==)
390− transformOps folded "zippingAsync folded" zippingAsync (==)
389+ transformOps folded "zipSerially folded" zipSerially (==)
390+ transformOps folded "zipParallely folded" zipParallely (==)
391391 transformOps folded "coparallely folded" coparallely sortEq
392392 transformOps folded "parallely folded" parallely sortEq
393393
394394 transformOpsWord8 A.fromFoldable "serially" serially
395395 transformOpsWord8 A.fromFoldable "coserially" coserially
396− transformOpsWord8 A.fromFoldable "zipping" zipping
397− transformOpsWord8 A.fromFoldable "zippingAsync" zippingAsync
396+ transformOpsWord8 A.fromFoldable "zipSerially" zipSerially
397+ transformOpsWord8 A.fromFoldable "zipParallely" zipParallely
398398 transformOpsWord8 A.fromFoldable "coparallely" coparallely
399399 transformOpsWord8 A.fromFoldable "parallely" parallely
400400
401401 transformOpsWord8 folded "serially folded" serially
402402 transformOpsWord8 folded "coserially folded" coserially
403− transformOpsWord8 folded "zipping folded" zipping
404− transformOpsWord8 folded "zippingAsync folded" zippingAsync
403+ transformOpsWord8 folded "zipSerially folded" zipSerially
404+ transformOpsWord8 folded "zipParallely folded" zipParallely
405405 transformOpsWord8 folded "coparallely folded" coparallely
406406 transformOpsWord8 folded "parallely folded" parallely
407407
408408 describe "Stream elimination operations" $ do
409409 eliminationOps A.fromFoldable "serially" serially
410410 eliminationOps A.fromFoldable "coserially" coserially
411− eliminationOps A.fromFoldable "zipping" zipping
412− eliminationOps A.fromFoldable "zippingAsync" zippingAsync
411+ eliminationOps A.fromFoldable "zipSerially" zipSerially
412+ eliminationOps A.fromFoldable "zipParallely" zipParallely
413413 eliminationOps A.fromFoldable "coparallely" coparallely
414414 eliminationOps A.fromFoldable "parallely" parallely
415415
416416 eliminationOps folded "serially folded" serially
417417 eliminationOps folded "coserially folded" coserially
418− eliminationOps folded "zipping folded" zipping
419− eliminationOps folded "zippingAsync folded" zippingAsync
418+ eliminationOps folded "zipSerially folded" zipSerially
419+ eliminationOps folded "zipParallely folded" zipParallely
420420 eliminationOps folded "coparallely folded" coparallely
421421 eliminationOps folded "parallely folded" parallely
422422
423423 describe "Stream elimination operations" $ do
424424 serialEliminationOps A.fromFoldable "serially" serially
425425 serialEliminationOps A.fromFoldable "coserially" coserially
426− serialEliminationOps A.fromFoldable "zipping" zipping
427− serialEliminationOps A.fromFoldable "zippingAsync" zippingAsync
426+ serialEliminationOps A.fromFoldable "zipSerially" zipSerially
427+ serialEliminationOps A.fromFoldable "zipParallely" zipParallely
428428
429429 serialEliminationOps folded "serially folded" serially
430430 serialEliminationOps folded "coserially folded" coserially
431− serialEliminationOps folded "zipping folded" zipping
432− serialEliminationOps folded "zippingAsync folded" zippingAsync
431+ serialEliminationOps folded "zipSerially folded" zipSerially
432+ serialEliminationOps folded "zipParallely folded" zipParallely