on master help sign in
rename the default stream type to StreamT

This was earlier changed from StreamT to SerialT. However we have made this the default type now and it makes more sense to call it StreamT now. A bigger motivation for the change is that StreamT immediately conveys that it is a stream which is helpful and intuitive for new learners. Also we have a plan to have a specialized type called "Stream a = StreamT IO a", so the name StreamT is in line with that common default type "Stream a". Calling that type as "Serial a" does not sound as intuitive as calling it "Stream a".

commita526207acd8dccea64e345862b003e7d8e27d2c4 authorHarendra Kumar <harendra.kumar@gmail.com> dateTue 24 Apr 2018, 20:30 (8 years ago) parentac39277
17 files changed+367−380
Changelog.md+9−11 benchmark/LinearOps.hs+1−1 benchmark/Nested.hs+22−22 benchmark/NestedOps.hs+11−11 examples/loops.hs+6−6 examples/nested-loops.hs+1−1 examples/parallel-loops.hs+1−1 src/Streamly.hs+20−22 src/Streamly/Core.hs+8−8 src/Streamly/Examples/AcidRainGame.hs+3−3 src/Streamly/Examples/MergeSortedStreams.hs+3−3 src/Streamly/Examples/SearchEngineQuery.hs+2−1 src/Streamly/Prelude.hs+25−25 src/Streamly/Streams.hs+91−101 src/Streamly/Tutorial.hs+32−32 test/Main.hs+64−64 test/Prop.hs+68−68
Changelog.md+9−11
@@ -9,17 +9,17 @@
99 * For `ParallelT`, the `<>` operation now concurrently meges the two streams
1010 in a fairly parallel manner.
1111
12− To adapt to the new changes, replace `<>` with `serial` wherever it is used
12+ To adapt to the new changes, replace `<>` with `splice` wherever it is used
1313 for stream types other than `StreamT`.
1414
1515* Change the semantics of `Alternative` instance. The `<|>` operator now has a
1616 different behavior for each type. See the documentation for more details. To
1717 adapt to this change replace any usage of `<|>` with `parallel` and
1818 `empty` with `nil`.
19−* Stream type now defaults to the `SerialT` type unless explicitly specified
19+* Stream type now defaults to the `StreamT` type unless explicitly specified
2020 using a type combinator or a monomorphic type. This change reduces puzzling
2121 type errors for beginners. It includes the following two changes:
22− * Change the type of all stream elimination functions to use `SerialT`
22+ * Change the type of all stream elimination functions to use `StreamT`
2323 instead of a polymorphic type. This makes sure that the stream type is
2424 always fixed at all exits.
2525 * Change the type combinators (e.g. `parallely`) to only fix the argument
@@ -28,8 +28,8 @@
2828 Stream types may have to be changed or type combinators may have to be added
2929 or removed to adapt to this change.
3030* Change the type of `foldrM` to make it consistent with `foldrM` in base.
31−* Remove the MonadError instance as it was not working correctly for
32− parallel compositions. Use MonadThrow instead for error propagation.
31+* Remove the `MonadError` instance as it was not working correctly for
32+ parallel compositions. Use `MonadThrow` instead for error propagation.
3333* Remove Num/Fractional/Floating instances as they are not very useful. Use
3434 `fmap` and `liftA2` instead.
3535
@@ -37,15 +37,13 @@
3737* Deprecate and rename the following symbols:
3838 * `Streaming` to `IsStream`
3939 * `runStreaming` to `runStream`
40− * `StreamT` to `SerialT`
4140 * `AsyncT` to `CoparallelT`
42− * `ZipStream` to `ZipSerial`
4341 * `ZipAsync` to `ZipParallel`
44− * `interleaving` to `coserially`
42+ * `interleaving` to `costreamly`
4543 * `asyncly` to `coparallely`
46− * `zipping` to `zipSerially`
44+ * `zipping` to `zipStreamly`
4745 * `zippingAsync` to `zipParallely`
48− * `<=>` to `coserial`
46+ * `<=>` to `cosplice`
4947 * `<|` to `coparallel`
5048 * `each` to `fromFoldable`
5149 * `scan` to `scanx`
@@ -66,7 +64,7 @@
6664 * `scanl'` strict left scan
6765 * `foldl'` strict left fold
6866 * `foldlM'` strict left fold with a monadic fold function
69− * `serial` run two streams serially one after the other
67+ * `splice` run two streams serially one after the other
7068 * `parallel` run two streams in parallel (replaces `<|>`)
7169
7270## 0.1.2
benchmark/LinearOps.hs+1−1
@@ -58,7 +58,7 @@ last :: Monad m => Stream m Int -> m (Maybe Int)
5858-- Stream generation and elimination
5959-------------------------------------------------------------------------------
6060
61−type Stream m a = S.SerialT m a
61+type Stream m a = S.StreamT m a
6262
6363source :: Int -> Stream m Int
6464source n = S.fromFoldable [n..n+value]
benchmark/Nested.hs+22−22
@@ -27,30 +27,30 @@ main = do
2727 , benchIO "toListLinear" Ops.toListLinear
2828 ]
2929
30− , bgroup "Serially"
31− [ benchIO "append" $ Ops.append serially
32− , benchIO "toNull0" $ Ops.toNull0 serially
33− , benchIO "toList0" $ Ops.toList0 serially
34− , benchIO "toNull" $ Ops.toNull serially
35− , benchIO "toList" $ Ops.toList serially
36− , benchIO "toListSome" $ Ops.toListSome serially
37− , benchIO "filterAllOut" $ Ops.filterAllOut serially
38− , benchIO "filterAllIn" $ Ops.filterAllIn serially
39− , benchIO "filterSome" $ Ops.filterSome serially
40− , benchIO "breakAfterSome" $ Ops.breakAfterSome serially
30+ , bgroup "streamly"
31+ [ benchIO "append" $ Ops.append streamly
32+ , benchIO "toNull0" $ Ops.toNull0 streamly
33+ , benchIO "toList0" $ Ops.toList0 streamly
34+ , benchIO "toNull" $ Ops.toNull streamly
35+ , benchIO "toList" $ Ops.toList streamly
36+ , benchIO "toListSome" $ Ops.toListSome streamly
37+ , benchIO "filterAllOut" $ Ops.filterAllOut streamly
38+ , benchIO "filterAllIn" $ Ops.filterAllIn streamly
39+ , benchIO "filterSome" $ Ops.filterSome streamly
40+ , benchIO "breakAfterSome" $ Ops.breakAfterSome streamly
4141 ]
4242
43− , bgroup "Coserially"
44− [ benchIO "append" $ Ops.append coserially
45− , benchIO "toNull0" $ Ops.toNull0 coserially
46− , benchIO "toList0" $ Ops.toList0 coserially
47− , benchIO "toNull" $ Ops.toNull coserially
48− , benchIO "toList" $ Ops.toList coserially
49− , benchIO "toListSome" $ Ops.toListSome coserially
50− , benchIO "filterAllOut" $ Ops.filterAllOut coserially
51− , benchIO "filterAllIn" $ Ops.filterAllIn coserially
52− , benchIO "filterSome" $ Ops.filterSome coserially
53− , benchIO "breakAfterSome" $ Ops.breakAfterSome coserially
43+ , bgroup "costreamly"
44+ [ benchIO "append" $ Ops.append costreamly
45+ , benchIO "toNull0" $ Ops.toNull0 costreamly
46+ , benchIO "toList0" $ Ops.toList0 costreamly
47+ , benchIO "toNull" $ Ops.toNull costreamly
48+ , benchIO "toList" $ Ops.toList costreamly
49+ , benchIO "toListSome" $ Ops.toListSome costreamly
50+ , benchIO "filterAllOut" $ Ops.filterAllOut costreamly
51+ , benchIO "filterAllIn" $ Ops.filterAllIn costreamly
52+ , benchIO "filterSome" $ Ops.filterSome costreamly
53+ , benchIO "breakAfterSome" $ Ops.breakAfterSome costreamly
5454 ]
5555
5656 , bgroup "Coparallely"
benchmark/NestedOps.hs+11−11
@@ -25,7 +25,7 @@ prodCount = 1000
2525-- Stream generation and elimination
2626-------------------------------------------------------------------------------
2727
28−type Stream m a = S.SerialT m a
28+type Stream m a = S.StreamT m a
2929
3030{-# INLINE source #-}
3131source :: S.IsStream t => Int -> Int -> t m Int
@@ -54,13 +54,13 @@ toListLinear start = runToList $ source start sumCount
5454{-# INLINE append #-}
5555append
5656 :: (Monoid (t m Int), Monad m, Monad (t m))
57− => (t m Int -> S.SerialT m Int) -> Int -> m ()
57+ => (t m Int -> S.StreamT m Int) -> Int -> m ()
5858append t start = runStream $ t $ foldMap return [start..start+sumCount]
5959
6060{-# INLINE toNull0 #-}
6161toNull0
6262 :: (S.IsStream t, Monad m, Monad (t m))
63− => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m ()
63+ => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m ()
6464toNull0 t start = runStream . t $ do
6565 x <- source start prodCount
6666 y <- source start prodCount
@@ -69,7 +69,7 @@ toNull0 t start = runStream . t $ do
6969{-# INLINE toList0 #-}
7070toList0
7171 :: (S.IsStream t, Monad m, Monad (t m))
72− => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m [(Int, Int)]
72+ => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m [(Int, Int)]
7373toList0 t start = runToList . t $ do
7474 x <- source start prodCount
7575 y <- source start prodCount
@@ -78,7 +78,7 @@ toList0 t start = runToList . t $ do
7878{-# INLINE toNull #-}
7979toNull
8080 :: (S.IsStream t, Monad m, Monad (t m))
81− => (t m Int -> S.SerialT m Int) -> Int -> m ()
81+ => (t m Int -> S.StreamT m Int) -> Int -> m ()
8282toNull t start = runStream . t $ do
8383 x <- source start prodCount
8484 y <- source start prodCount
@@ -87,7 +87,7 @@ toNull t start = runStream . t $ do
8787{-# INLINE toList #-}
8888toList
8989 :: (S.IsStream t, Monad m, Monad (t m))
90− => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
90+ => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
9191toList t start = runToList . t $ do
9292 x <- source start prodCount
9393 y <- source start prodCount
@@ -96,7 +96,7 @@ toList t start = runToList . t $ do
9696{-# INLINE toListSome #-}
9797toListSome
9898 :: (S.IsStream t, Monad m, Monad (t m))
99− => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
99+ => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
100100toListSome t start =
101101 runToList . t $ S.take 1000 $ do
102102 x <- source start prodCount
@@ -106,7 +106,7 @@ toListSome t start =
106106{-# INLINE filterAllOut #-}
107107filterAllOut
108108 :: (S.IsStream t, Monad m, Monad (t m))
109− => (t m Int -> S.SerialT m Int) -> Int -> m ()
109+ => (t m Int -> S.StreamT m Int) -> Int -> m ()
110110filterAllOut t start = runStream . t $ do
111111 x <- source start prodCount
112112 y <- source start prodCount
@@ -118,7 +118,7 @@ filterAllOut t start = runStream . t $ do
118118{-# INLINE filterAllIn #-}
119119filterAllIn
120120 :: (S.IsStream t, Monad m, Monad (t m))
121− => (t m Int -> S.SerialT m Int) -> Int -> m ()
121+ => (t m Int -> S.StreamT m Int) -> Int -> m ()
122122filterAllIn t start = runStream . t $ do
123123 x <- source start prodCount
124124 y <- source start prodCount
@@ -130,7 +130,7 @@ filterAllIn t start = runStream . t $ do
130130{-# INLINE filterSome #-}
131131filterSome
132132 :: (S.IsStream t, Monad m, Monad (t m))
133− => (t m Int -> S.SerialT m Int) -> Int -> m ()
133+ => (t m Int -> S.StreamT m Int) -> Int -> m ()
134134filterSome t start = runStream . t $ do
135135 x <- source start prodCount
136136 y <- source start prodCount
@@ -142,7 +142,7 @@ filterSome t start = runStream . t $ do
142142{-# INLINE breakAfterSome #-}
143143breakAfterSome
144144 :: (S.IsStream t, Monad (t IO))
145− => (t IO Int -> S.SerialT IO Int) -> Int -> IO ()
145+ => (t IO Int -> S.StreamT IO Int) -> Int -> IO ()
146146breakAfterSome t start = do
147147 (_ :: Either ErrorCall ()) <- try $ runStream . t $ do
148148 x <- source start prodCount
examples/loops.hs+6−6
@@ -25,9 +25,9 @@ main = do
2525 x <- loopHeadA 0
2626 liftIO $ print (x :: Int)
2727
28− putStrLn $ "\ncoserial:\n"
28+ putStrLn $ "\ncosplice:\n"
2929 runStream $ do
30− x <- (return 0 <> return 1) `coserial` (return 100 <> return 101)
30+ x <- (return 0 <> return 1) `cosplice` (return 100 <> return 101)
3131 liftIO $ print (x :: Int)
3232
3333 putStrLn $ "\nParallel interleave:\n"
@@ -47,7 +47,7 @@ main = do
4747
4848 -- Generates a value and then loops. Can be used to generate an infinite
4949 -- stream. Interleaves the generator and the consumer.
50− loopTail :: Int -> SerialT IO Int
50+ loopTail :: Int -> StreamT IO Int
5151 loopTail x = do
5252 liftIO $ putStrLn "LoopTail..."
5353 return x <> (if x < 3 then loopTail (x + 1) else nil)
@@ -55,7 +55,7 @@ main = do
5555 -- Loops and then generates a value. The consumer can run only after the
5656 -- loop has finished. An infinite generator will not let the consumer run
5757 -- at all.
58− loopHead :: Int -> SerialT IO Int
58+ loopHead :: Int -> StreamT IO Int
5959 loopHead x = do
6060 liftIO $ putStrLn "LoopHead..."
6161 (if x < 3 then loopHead (x + 1) else nil) <> return x
@@ -69,12 +69,12 @@ main = do
6969 -- then the action on the right is also spawned concurrently. In other
7070 -- words, both actions may run concurrently based on the need.
7171
72− loopTailA :: Int -> SerialT IO Int
72+ loopTailA :: Int -> StreamT IO Int
7373 loopTailA x = do
7474 liftIO $ putStrLn "LoopTailA..."
7575 return x `coparallel` (if x < 3 then loopTailA (x + 1) else nil)
7676
77− loopHeadA :: Int -> SerialT IO Int
77+ loopHeadA :: Int -> StreamT IO Int
7878 loopHeadA x = do
7979 liftIO $ putStrLn "LoopHeadA..."
8080 (if x < 3 then loopHeadA (x + 1) else nil) `coparallel` return x
examples/nested-loops.hs+1−1
@@ -15,7 +15,7 @@ main = runStream $ do
1515
1616 where
1717
18− loop :: String -> Int -> SerialT IO String
18+ loop :: String -> Int -> StreamT IO String
1919 loop name n = do
2020 rnd <- liftIO (randomIO :: IO Int)
2121 let result = (name ++ show rnd)
examples/parallel-loops.hs+1−1
@@ -13,7 +13,7 @@ main = runStream $ do
1313
1414 where
1515
16− loop :: String -> SerialT IO (String, Int)
16+ loop :: String -> StreamT IO (String, Int)
1717 loop name = do
1818 liftIO $ threadDelay 1000000
1919 rnd <- liftIO (randomIO :: IO Int)
src/Streamly.hs+20−22
@@ -20,8 +20,8 @@ module Streamly
2020
2121 -- * Serial Streams
2222 -- $serial
23− , SerialT
24− , CoserialT
23+ , StreamT
24+ , CostreamT
2525
2626 -- * Parallel Streams
2727 -- $parallel
@@ -30,16 +30,16 @@ module Streamly
3030
3131 -- * Zipping Streams
3232 -- $zipping
33− , ZipSerial
33+ , ZipStream
3434 , ZipParallel
3535
3636 -- * Stream Type Adapters
3737 -- $adapters
38− , serially
39− , coserially
38+ , streamly
39+ , costreamly
4040 , coparallely
4141 , parallely
42− , zipSerially
42+ , zipStreamly
4343 , zipParallely
4444 , adapt
4545
@@ -51,8 +51,8 @@ module Streamly
5151
5252 -- * Polymorphic Sum Operations
5353 -- $sum
54− , serial
55− , coserial
54+ , splice
55+ , cosplice
5656 , coparallel
5757 , parallel
5858
@@ -80,10 +80,8 @@ module Streamly
8080 , runZipAsync
8181 , runAsyncT
8282 , runZipStream
83− , StreamT
8483 , InterleavedT
8584 , AsyncT
86− , ZipStream
8785 , ZipAsync
8886 , interleaving
8987 , asyncly
@@ -108,7 +106,7 @@ import Control.Monad.Trans.Class (MonadTrans (..))
108106-- functional programming equivalent of nested loops from imperative
109107-- programming. Composing each element in one stream with each element in the
110108-- other stream generalizes the monadic product of single elements. You can
111−-- think of the IO monad as a special case of the more general @SerialT IO@
109+-- think of the IO monad as a special case of the more general @StreamT IO@
112110-- monad; with single element streams. List transformers and logic programming
113111-- monads also provide a similar product style composition of streams, however
114112-- streamly generalizes it with the time dimension; allowing streams to be
@@ -135,27 +133,27 @@ import Control.Monad.Trans.Class (MonadTrans (..))
135133
136134-- $overview
137135--
138−-- Streamly provides six distinct stream types i.e. 'SerialT', 'CoserialT',
139−-- 'CoparallelT' and 'ParallelT', 'ZipSerial' and 'ZipParallel', each representing a
136+-- Streamly provides six distinct stream types i.e. 'StreamT', 'CostreamT',
137+-- 'CoparallelT' and 'ParallelT', 'ZipStream' and 'ZipParallel', each representing a
140138-- stream of elements. All these types have the same underlying representation
141139-- and can be adapted from one to another using type adaptor combinators
142140-- described later. Each of these types belongs to the 'IsStream' type class
143141-- which helps converting the specific type to and from the underlying generic
144142-- stream type.
145143--
146−-- The types 'SerialT', 'CoserialT', 'CoparallelT' and 'ParallelT' are 'Monad'
144+-- The types 'StreamT', 'CostreamT', 'CoparallelT' and 'ParallelT' are 'Monad'
147145-- transformers with the monadic bind operation combining streams in a product
148146-- style in much the same way as a list monad or a list transformer i.e. each
149147-- element from one stream is combined with every element of the other stream.
150148-- However, the applicative and monadic composition of these types differ in
151149-- terms of the ordering and time sequence in which the elements from two
152−-- streams are combined. 'SerialT' and 'CoserialT' compose streams serially
150+-- streams are combined. 'StreamT' and 'CostreamT' compose streams streamly
153151-- whereas 'CoparallelT' and 'ParallelT' are their concurrent counterparts. See the
154152-- documentation of the respective types for more details.
155153--
156−-- The types 'ZipSerial' and 'ZipParallel' provide 'Applicative' instances to zip
154+-- The types 'ZipStream' and 'ZipParallel' provide 'Applicative' instances to zip
157155-- two streams together i.e. each element in one stream is combined with the
158−-- corresponding element in the other stream. 'ZipSerial' generates the streams
156+-- corresponding element in the other stream. 'ZipStream' generates the streams
159157-- being zipped serially whereas 'ZipParallel' produces both the elements being
160158-- zipped concurrently.
161159--
@@ -175,7 +173,7 @@ import Control.Monad.Trans.Class (MonadTrans (..))
175173--
176174-- Serial streams compose serially or non-concurrently. In a composed stream,
177175-- 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
176+-- The two serial stream types 'StreamT' and 'CostreamT' differ in how they
179177-- merge streams together in a 'Semigroup' or 'Monad' composition. As these
180178-- streams are serial, the sequence of items in a composed stream can be solely
181179-- determined by the position of elements in the consituent streams.
@@ -195,7 +193,7 @@ import Control.Monad.Trans.Class (MonadTrans (..))
195193
196194-- $zipping
197195--
198−-- 'ZipSerial' and 'ZipParallel', provide 'Applicative' instances for zipping the
196+-- 'ZipStream' and 'ZipParallel', provide 'Applicative' instances for zipping the
199197-- corresponding elements of two streams together. Note that these types are
200198-- not monads.
201199
@@ -212,9 +210,9 @@ import Control.Monad.Trans.Class (MonadTrans (..))
212210-- to make them interwork with each other.
213211--
214212-- To adapt from one monomorphic type (e.g. 'ParallelT') to another monomorphic
215−-- type (e.g. 'SerialT') use the 'adapt' combinator. To give a polymorphic code
213+-- type (e.g. 'StreamT') use the 'adapt' combinator. To give a polymorphic code
216214-- a specific interpretation or to adapt a specific type to a polymorphic type
217−-- use the type specific combinators e.g. 'parallely' or 'coserially'. You
215+-- use the type specific combinators e.g. 'parallely' or 'costreamly'. You
218216-- cannot adapt polymorphic code to polymorphic code, as it would not know
219217-- which specific type you are converting from or to. If you see a an
220218-- @ambiguous type variable@ error then most likely you are using 'adapt'
@@ -224,5 +222,5 @@ import Control.Monad.Trans.Class (MonadTrans (..))
224222-- $foldutils
225223--
226224-- These are variants of standard 'Foldable' fold functions that use a
227−-- polymorphic stream sum operation (e.g. 'parallel' or 'coserial') to fold a
225+-- polymorphic stream sum operation (e.g. 'parallel' or 'cosplice') to fold a
228226-- container of streams.
src/Streamly/Core.hs+8−8
@@ -31,8 +31,8 @@ module Streamly.Core
3131 , nil
3232
3333 -- * Semigroup Style Composition
34− , serial
35− , coserial
34+ , splice
35+ , cosplice
3636 , coparallel
3737 , parallel
3838
@@ -191,8 +191,8 @@ repeat a = let x = cons a x in x
191191
192192-- | Concatenates two streams sequentially i.e. the first stream is
193193-- exhausted completely before yielding any element from the second stream.
194−serial :: Stream m a -> Stream m a -> Stream m a
195−serial m1 m2 = go m1
194+splice :: Stream m a -> Stream m a -> Stream m a
195+splice m1 m2 = go m1
196196 where
197197 go (Stream m) = Stream $ \_ stp sng yld ->
198198 let stop = (runStream m2) Nothing stp sng yld
@@ -201,7 +201,7 @@ serial m1 m2 = go m1
201201 in m Nothing stop single yield
202202
203203instance Semigroup (Stream m a) where
204− (<>) = serial
204+ (<>) = splice
205205
206206------------------------------------------------------------------------------
207207-- Monoid
@@ -215,11 +215,11 @@ instance Monoid (Stream m a) where
215215-- Interleave
216216------------------------------------------------------------------------------
217217
218−coserial :: Stream m a -> Stream m a -> Stream m a
219−coserial m1 m2 = Stream $ \_ stp sng yld -> do
218+cosplice :: Stream m a -> Stream m a -> Stream m a
219+cosplice m1 m2 = Stream $ \_ stp sng yld -> do
220220 let stop = (runStream m2) Nothing stp sng yld
221221 single a = yld a m2
222− yield a r = yld a (coserial m2 r)
222+ yield a r = yld a (cosplice m2 r)
223223 (runStream m1) Nothing stop single yield
224224
225225------------------------------------------------------------------------------
src/Streamly/Examples/AcidRainGame.hs+3−3
@@ -13,7 +13,7 @@ import Data.Semigroup (cycle1)
1313
1414data Event = Harm Int | Heal Int | Quit deriving (Show)
1515
16−userAction :: MonadIO m => SerialT m Event
16+userAction :: MonadIO m => StreamT m Event
1717userAction = cycle1 $ liftIO askUser
1818 where
1919 askUser = do
@@ -23,10 +23,10 @@ userAction = cycle1 $ liftIO askUser
2323 "quit" -> return Quit
2424 _ -> putStrLn "What?" >> askUser
2525
26−acidRain :: MonadIO m => SerialT m Event
26+acidRain :: MonadIO m => StreamT m Event
2727acidRain = cycle1 $ liftIO (threadDelay 1000000) >> return (Harm 1)
2828
29−game :: (MonadParallel m, MonadState Int m) => SerialT m ()
29+game :: (MonadParallel m, MonadState Int m) => StreamT m ()
3030game = do
3131 event <- userAction `parallel` acidRain
3232 case event of
src/Streamly/Examples/MergeSortedStreams.hs+3−3
@@ -8,20 +8,20 @@ import Data.List (sort)
88import Streamly
99import qualified Streamly.Prelude as A
1010
11−getSorted :: MonadIO m => SerialT m Word16
11+getSorted :: MonadIO m => StreamT m Word16
1212getSorted = do
1313 g <- liftIO getStdGen
1414 let ls = take 100000 (randoms g) :: [Word16]
1515 foldMapWith (<>) return (sort ls)
1616
1717mergeAsync :: (Ord a, MonadParallel m)
18− => SerialT m a -> SerialT m a -> SerialT m a
18+ => StreamT m a -> StreamT m a -> StreamT 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, MonadParallel m) => SerialT m a -> SerialT m a -> SerialT m a
24+merge :: (Ord a, MonadParallel m) => StreamT m a -> StreamT m a -> StreamT m a
2525merge a b = do
2626 a1 <- lift $ A.uncons a
2727 case a1 of
src/Streamly/Examples/SearchEngineQuery.hs+2−1
@@ -14,8 +14,9 @@ searchEngineQuery = do
1414
1515 where
1616 get :: IsStream t => String -> t IO ()
17+ get s = streamly $ liftIO (httpNoBody (parseRequest_ s) >> putStrLn (show s))
18+
1719 google, bing, duckduckgo :: IsStream t => t IO ()
18− get s = serially $ liftIO (httpNoBody (parseRequest_ s) >> putStrLn (show s))
1920 google = get "https://www.google.com/search?q=haskell"
2021 bing = get "https://www.bing.com/search?q=haskell"
2122 duckduckgo = get "https://www.duckduckgo.com/?q=haskell"
src/Streamly/Prelude.hs+25−25
@@ -176,7 +176,7 @@ fromHandle h = fromStream go
176176-- >> runIdentity $ foldr (:) [] (serially $ fromFoldable [1,2,3])
177177-- [1,2,3]
178178-- @
179−foldr :: Monad m => (a -> b -> b) -> b -> SerialT m a -> m b
179+foldr :: Monad m => (a -> b -> b) -> b -> StreamT m a -> m b
180180foldr step acc m = go (toStream m)
181181 where
182182 go m1 =
@@ -193,7 +193,7 @@ foldr step acc m = go (toStream m)
193193-- [1,2,3]
194194-- @
195195{-# INLINE foldrM #-}
196−foldrM :: Monad m => (a -> b -> m b) -> b -> SerialT m a -> m b
196+foldrM :: Monad m => (a -> b -> m b) -> b -> StreamT m a -> m b
197197foldrM step acc m = go (toStream m)
198198 where
199199 go m1 =
@@ -234,7 +234,7 @@ scanl' step begin m = scanx step begin id m
234234-- argument) to the folded value at the end. This is designed to work with the
235235-- @foldl@ library. The suffix @x@ is a mnemonic for extraction.
236236{-# INLINE foldx #-}
237−foldx :: Monad m => (x -> a -> x) -> x -> (x -> b) -> SerialT m a -> m b
237+foldx :: Monad m => (x -> a -> x) -> x -> (x -> b) -> StreamT m a -> m b
238238foldx step begin done m = get $ go (toStream m) begin
239239 where
240240 {-# NOINLINE get #-}
@@ -255,17 +255,17 @@ foldx step begin done m = get $ go (toStream m) begin
255255 in (S.runStream m1) Nothing stop single yield
256256
257257{-# DEPRECATED foldl "Please use foldx instead." #-}
258−foldl :: Monad m => (x -> a -> x) -> x -> (x -> b) -> SerialT m a -> m b
258+foldl :: Monad m => (x -> a -> x) -> x -> (x -> b) -> StreamT m a -> m b
259259foldl = foldx
260260
261261-- | Strict left associative fold.
262262{-# INLINE foldl' #-}
263−foldl' :: Monad m => (b -> a -> b) -> b -> SerialT m a -> m b
263+foldl' :: Monad m => (b -> a -> b) -> b -> StreamT m a -> m b
264264foldl' step begin m = foldx step begin id m
265265
266266-- XXX replace the recursive "go" with explicit continuations.
267267-- | Like 'foldx', but with a monadic step function.
268−foldxM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> SerialT m a -> m b
268+foldxM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> StreamT m a -> m b
269269foldxM step begin done m = go begin (toStream m)
270270 where
271271 go !acc m1 =
@@ -275,17 +275,17 @@ foldxM step begin done m = go begin (toStream m)
275275 in (S.runStream m1) Nothing stop single yield
276276
277277{-# DEPRECATED foldlM "Please use foldxM instead." #-}
278−foldlM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> SerialT m a -> m b
278+foldlM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> StreamT m a -> m b
279279foldlM = foldxM
280280
281281-- | Like 'foldl'' but with a monadic step function.
282−foldlM' :: Monad m => (b -> a -> m b) -> b -> SerialT m a -> m b
282+foldlM' :: Monad m => (b -> a -> m b) -> b -> StreamT m a -> m b
283283foldlM' step begin m = foldxM step (return begin) return m
284284
285285-- | Decompose a stream into its head and tail. If the stream is empty, returns
286286-- 'Nothing'. If the stream is non-empty, returns 'Just (a, ma)', where 'a' is
287287-- the head of the stream and 'ma' its tail.
288−uncons :: (IsStream t, Monad m) => SerialT m a -> m (Maybe (a, t m a))
288+uncons :: (IsStream t, Monad m) => StreamT m a -> m (Maybe (a, t m a))
289289uncons m =
290290 let stop = return Nothing
291291 single a = return (Just (a, nil))
@@ -293,7 +293,7 @@ uncons m =
293293 in (S.runStream (toStream m)) Nothing stop single yield
294294
295295-- | Write a stream of Strings to an IO Handle.
296−toHandle :: MonadIO m => IO.Handle -> SerialT m String -> m ()
296+toHandle :: MonadIO m => IO.Handle -> StreamT m String -> m ()
297297toHandle h m = go (toStream m)
298298 where
299299 go m1 =
@@ -308,7 +308,7 @@ toHandle h m = go (toStream m)
308308
309309-- | Convert a stream into a list in the underlying monad.
310310{-# INLINABLE toList #-}
311−toList :: Monad m => SerialT m a -> m [a]
311+toList :: Monad m => StreamT m a -> m [a]
312312toList = foldrM (\a xs -> return (a : xs)) []
313313
314314-- | Take first 'n' elements from the stream and discard the rest.
@@ -370,7 +370,7 @@ dropWhile p m = fromStream $ go (toStream m)
370370 in (S.runStream m1) ctx stp single yield
371371
372372-- | Determine whether all elements of a stream satisfy a predicate.
373−all :: Monad m => (a -> Bool) -> SerialT m a -> m Bool
373+all :: Monad m => (a -> Bool) -> StreamT m a -> m Bool
374374all p m = go (toStream m)
375375 where
376376 go m1 =
@@ -381,7 +381,7 @@ all p m = go (toStream m)
381381 in (S.runStream m1) Nothing (return True) single yield
382382
383383-- | Determine whether any of the elements of a stream satisfy a predicate.
384−any :: Monad m => (a -> Bool) -> SerialT m a -> m Bool
384+any :: Monad m => (a -> Bool) -> StreamT m a -> m Bool
385385any p m = go (toStream m)
386386 where
387387 go m1 =
@@ -392,15 +392,15 @@ any p m = go (toStream m)
392392 in (S.runStream m1) Nothing (return False) single yield
393393
394394-- | Determine the sum of all elements of a stream of numbers
395−sum :: (Monad m, Num a) => SerialT m a -> m a
395+sum :: (Monad m, Num a) => StreamT m a -> m a
396396sum = foldl (+) 0 id
397397
398398-- | Determine the product of all elements of a stream of numbers
399−product :: (Monad m, Num a) => SerialT m a -> m a
399+product :: (Monad m, Num a) => StreamT m a -> m a
400400product = foldl (*) 1 id
401401
402402-- | Extract the first element of the stream, if any.
403−head :: Monad m => SerialT m a -> m (Maybe a)
403+head :: Monad m => StreamT m a -> m (Maybe a)
404404head m =
405405 let stop = return Nothing
406406 single a = return (Just a)
@@ -408,7 +408,7 @@ head m =
408408 in (S.runStream (toStream m)) Nothing stop single yield
409409
410410-- | Extract all but the first element of the stream, if any.
411−tail :: (IsStream t, Monad m) => SerialT m a -> m (Maybe (t m a))
411+tail :: (IsStream t, Monad m) => StreamT m a -> m (Maybe (t m a))
412412tail m =
413413 let stop = return Nothing
414414 single _ = return $ Just nil
@@ -417,11 +417,11 @@ tail m =
417417
418418-- | Extract the last element of the stream, if any.
419419{-# INLINE last #-}
420−last :: Monad m => SerialT m a -> m (Maybe a)
420+last :: Monad m => StreamT m a -> m (Maybe a)
421421last = foldl (\_ y -> Just y) Nothing id
422422
423423-- | Determine whether the stream is empty.
424−null :: Monad m => SerialT m a -> m Bool
424+null :: Monad m => StreamT m a -> m Bool
425425null m =
426426 let stop = return True
427427 single _ = return False
@@ -429,7 +429,7 @@ null m =
429429 in (S.runStream (toStream m)) Nothing stop single yield
430430
431431-- | Determine whether an element is present in the stream.
432−elem :: (Monad m, Eq a) => a -> SerialT m a -> m Bool
432+elem :: (Monad m, Eq a) => a -> StreamT m a -> m Bool
433433elem e m = go (toStream m)
434434 where
435435 go m1 =
@@ -439,7 +439,7 @@ elem e m = go (toStream m)
439439 in (S.runStream m1) Nothing stop single yield
440440
441441-- | Determine whether an element is not present in the stream.
442−notElem :: (Monad m, Eq a) => a -> SerialT m a -> m Bool
442+notElem :: (Monad m, Eq a) => a -> StreamT m a -> m Bool
443443notElem e m = go (toStream m)
444444 where
445445 go m1 =
@@ -449,7 +449,7 @@ notElem e m = go (toStream m)
449449 in (S.runStream m1) Nothing stop single yield
450450
451451-- | Determine the length of the stream.
452−length :: Monad m => SerialT m a -> m Int
452+length :: Monad m => StreamT m a -> m Int
453453length = foldl (\n _ -> n + 1) 0 id
454454
455455-- | Returns the elements of the stream in reverse order.
@@ -466,7 +466,7 @@ reverse m = fromStream $ go S.nil (toStream m)
466466
467467-- XXX replace the recursive "go" with continuation
468468-- | Determine the minimum element in a stream.
469−minimum :: (Monad m, Ord a) => SerialT m a -> m (Maybe a)
469+minimum :: (Monad m, Ord a) => StreamT m a -> m (Maybe a)
470470minimum m = go Nothing (toStream m)
471471 where
472472 go res m1 =
@@ -481,7 +481,7 @@ minimum m = go Nothing (toStream m)
481481
482482-- XXX replace the recursive "go" with continuation
483483-- | Determine the maximum element in a stream.
484−maximum :: (Monad m, Ord a) => SerialT m a -> m (Maybe a)
484+maximum :: (Monad m, Ord a) => StreamT m a -> m (Maybe a)
485485maximum m = go Nothing (toStream m)
486486 where
487487 go res m1 =
@@ -513,7 +513,7 @@ mapM f m = fromStream $ go (toStream m)
513513
514514-- | Apply a monadic action to each element of the stream and discard the
515515-- output of the action.
516−mapM_ :: Monad m => (a -> m b) -> SerialT m a -> m ()
516+mapM_ :: Monad m => (a -> m b) -> StreamT m a -> m ()
517517mapM_ f m = go (toStream m)
518518 where
519519 go m1 =
src/Streamly/Streams.hs+91−101
@@ -50,34 +50,32 @@ module Streamly.Streams
5050 , async
5151
5252 -- * Merging Streams
53− , serial
54− , coserial
53+ , splice
54+ , cosplice
5555 , coparallel
5656 , parallel
5757 , (<=>) --deprecated
5858 , (<|) --deprecated
5959
6060 -- * Stream Styles
61− , SerialT
62− , StreamT -- deprecated
63− , CoserialT
61+ , StreamT
62+ , CostreamT
6463 , InterleavedT -- deprecated
6564 , CoparallelT
6665 , AsyncT -- deprecated
6766 , ParallelT
68− , ZipSerial
69− , ZipStream -- deprecated
67+ , ZipStream
7068 , ZipParallel
7169 , ZipAsync -- deprecated
7270
7371 -- * Type Adapters
74− , serially
75− , coserially
72+ , streamly
73+ , costreamly
7674 , interleaving -- deprecated
7775 , coparallely
7876 , asyncly -- deprecated
7977 , parallely
80− , zipSerially
78+ , zipStreamly
8179 , zipping -- deprecated
8280 , zipParallely
8381 , zippingAsync -- deprecated
@@ -148,7 +146,7 @@ infixr 5 `cons`
148146--
149147-- @
150148-- > let stream = 1 \`cons` 2 \`cons` 3 \`cons` nil
151−-- > (toList . serially) stream
149+-- > (toList . streamly) stream
152150-- [1,2,3]
153151-- @
154152cons :: IsStream t => a -> t m a -> t m a
@@ -161,7 +159,7 @@ infixr 5 .:
161159--
162160-- @
163161-- > let stream = 1 .: 2 .: 3 .: nil
164−-- > (toList . serially) stream
162+-- > (toList . streamly) stream
165163-- [1,2,3]
166164-- @
167165--
@@ -172,7 +170,7 @@ infixr 5 .:
172170--
173171-- @
174172-- > let stream = pure 1 <> pure 2 <> pure 3
175−-- > (toList . serially) stream
173+-- > (toList . streamly) stream
176174-- [1,2,3]
177175-- @
178176--
@@ -229,9 +227,9 @@ streamFold svr step single blank m =
229227 in (S.runStream (toStream m)) svr blank single yield
230228
231229-- | Run a streaming composition, discard the results. By default it interprets
232−-- the stream as 'SerialT', to run other types of streams use the type adapting
230+-- the stream as 'StreamT', to run other types of streams use the type adapting
233231-- combinators for example @runStream . 'parallely'@.
234−runStream :: Monad m => SerialT m a -> m ()
232+runStream :: Monad m => StreamT m a -> m ()
235233runStream m = go (toStream m)
236234 where
237235 go m1 =
@@ -307,25 +305,25 @@ instance (MonadState s m CONSTRAINT) => MonadState s (STREAM m) where { \
307305 state k = lift (state k) }
308306
309307------------------------------------------------------------------------------
310−-- SerialT
308+-- StreamT
311309------------------------------------------------------------------------------
312310
313−-- | The 'Semigroup' instance of 'SerialT' appends two streams sequentially,
311+-- | The 'Semigroup' instance of 'StreamT' appends two streams sequentially,
314312-- yielding all elements from the first stream, and then all elements from the
315313-- second stream.
316314--
317315-- @
318−-- main = ('toList' . 'serially' $ (fromFoldable [1,2]) \<\> (fromFoldable [3,4])) >>= print
316+-- main = ('toList' . 'streamly' $ (fromFoldable [1,2]) \<\> (fromFoldable [3,4])) >>= print
319317-- @
320318-- @
321319-- [1,2,3,4]
322320-- @
323321--
324322-- The 'Monad' instance runs the /monadic continuation/ for each
325−-- element of the stream, serially.
323+-- element of the stream, streamly.
326324--
327325-- @
328−-- main = 'runStream' . 'serially' $ do
326+-- main = 'runStream' . 'streamly' $ do
329327-- x <- return 1 \<\> return 2
330328-- liftIO $ print x
331329-- @
@@ -334,10 +332,10 @@ instance (MonadState s m CONSTRAINT) => MonadState s (STREAM m) where { \
334332-- 2
335333-- @
336334--
337−-- 'SerialT' nests streams serially in a depth first manner.
335+-- 'StreamT' nests streams streamly in a depth first manner.
338336--
339337-- @
340−-- main = 'runStream' . 'serially' $ do
338+-- main = 'runStream' . 'streamly' $ do
341339-- x <- return 1 \<\> return 2
342340-- y <- return 3 \<\> return 4
343341-- liftIO $ print (x, y)
@@ -349,46 +347,42 @@ instance (MonadState s m CONSTRAINT) => MonadState s (STREAM m) where { \
349347-- (2,4)
350348-- @
351349--
352−-- This behavior of 'SerialT' is exactly like a list transformer. We call the
350+-- This behavior of 'StreamT' is exactly like a list transformer. We call the
353351-- monadic code being run for each element of the stream a monadic
354352-- continuation. In imperative paradigm we can think of this composition as
355353-- nested @for@ loops and the monadic continuation is the body of the loop. The
356354-- loop iterates for all elements of the stream.
357355--
358−-- The 'serially' combinator can be omitted as the default stream type is
359−-- 'SerialT'.
356+-- The 'streamly' combinator can be omitted as the default stream type is
357+-- 'StreamT'.
360358-- Note that serial composition can be used to combine an infinite number of
361359-- streams as it explores only one stream at a time.
362360--
363−newtype SerialT m a = SerialT {getSerialT :: Stream m a}
361+newtype StreamT m a = StreamT {getStreamT :: Stream m a}
364362 deriving (Semigroup, Monoid, Functor, MonadTrans)
365363
366−instance IsStream SerialT where
367− toStream = getSerialT
368− fromStream = SerialT
369−
370−-- | Same as SerialT.
371−{-# Deprecated StreamT "Please use SerialT instead." #-}
372−type StreamT = SerialT
364+instance IsStream StreamT where
365+ toStream = getStreamT
366+ fromStream = StreamT
373367
374368------------------------------------------------------------------------------
375369-- Semigroup
376370------------------------------------------------------------------------------
377371
378−-- | Polymorphic version of the 'Semigroup' operation '<>' of 'SerialT'.
372+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'StreamT'.
379373-- Appends two streams sequentially, yielding all elements from the first
380374-- stream, and then all elements from the second stream.
381−{-# INLINE serial #-}
382−serial :: IsStream t => t m a -> t m a -> t m a
383−serial m1 m2 = fromStream $ S.serial (toStream m1) (toStream m2)
375+{-# INLINE splice #-}
376+splice :: IsStream t => t m a -> t m a -> t m a
377+splice m1 m2 = fromStream $ S.splice (toStream m1) (toStream m2)
384378
385379------------------------------------------------------------------------------
386380-- Monad
387381------------------------------------------------------------------------------
388382
389−instance Monad m => Monad (SerialT m) where
383+instance Monad m => Monad (StreamT m) where
390384 return = pure
391− (SerialT (Stream m)) >>= f = SerialT $ Stream $ \_ stp sng yld ->
385+ (StreamT (Stream m)) >>= f = StreamT $ Stream $ \_ stp sng yld ->
392386 let run x = (S.runStream x) Nothing stp sng yld
393387 single a = run $ toStream (f a)
394388 yield a r = run $ toStream $ f a <> (fromStream r >>= f)
@@ -398,14 +392,14 @@ instance Monad m => Monad (SerialT m) where
398392-- Other instances
399393------------------------------------------------------------------------------
400394
401−MONAD_APPLICATIVE_INSTANCE(SerialT,)
402−MONAD_COMMON_INSTANCES(SerialT,)
395+MONAD_APPLICATIVE_INSTANCE(StreamT,)
396+MONAD_COMMON_INSTANCES(StreamT,)
403397
404398------------------------------------------------------------------------------
405−-- CoserialT
399+-- CostreamT
406400------------------------------------------------------------------------------
407401
408−-- | The 'Semigroup' instance of 'CoserialT' interleaves two streams,
402+-- | The 'Semigroup' instance of 'CostreamT' interleaves two streams,
409403-- yielding one element from each stream alternately.
410404--
411405-- @
@@ -435,42 +429,42 @@ MONAD_COMMON_INSTANCES(SerialT,)
435429-- Note that interleaving composition can only combine a finite number of
436430-- streams as it needs to retain state for each unfinished stream.
437431--
438−newtype CoserialT m a = CoserialT {getCoserialT :: Stream m a}
432+newtype CostreamT m a = CostreamT {getCostreamT :: Stream m a}
439433 deriving (Functor, MonadTrans)
440434
441−{-# DEPRECATED InterleavedT "Please use 'CoserialT' instead." #-}
442−type InterleavedT = CoserialT
435+{-# DEPRECATED InterleavedT "Please use 'CostreamT' instead." #-}
436+type InterleavedT = CostreamT
443437
444−instance IsStream CoserialT where
445− toStream = getCoserialT
446− fromStream = CoserialT
438+instance IsStream CostreamT where
439+ toStream = getCostreamT
440+ fromStream = CostreamT
447441
448442------------------------------------------------------------------------------
449443-- Semigroup
450444------------------------------------------------------------------------------
451445
452−-- | Polymorphic version of the 'Semigroup' operation '<>' of 'CoserialT'.
446+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'CostreamT'.
453447-- Interleaves two streams, yielding one element from each stream alternately.
454−{-# INLINE coserial #-}
455−coserial :: IsStream t => t m a -> t m a -> t m a
456−coserial m1 m2 = fromStream $ S.coserial (toStream m1) (toStream m2)
448+{-# INLINE cosplice #-}
449+cosplice :: IsStream t => t m a -> t m a -> t m a
450+cosplice m1 m2 = fromStream $ S.cosplice (toStream m1) (toStream m2)
457451
458−instance Semigroup (CoserialT m a) where
459− (<>) = coserial
452+instance Semigroup (CostreamT m a) where
453+ (<>) = cosplice
460454
461455infixr 5 <=>
462456
463−-- | Same as 'coserial'.
464−{-# DEPRECATED (<=>) "Please use 'coserial' instead." #-}
457+-- | Same as 'cosplice'.
458+{-# DEPRECATED (<=>) "Please use 'cosplice' instead." #-}
465459{-# INLINE (<=>) #-}
466460(<=>) :: IsStream t => t m a -> t m a -> t m a
467−(<=>) = coserial
461+(<=>) = cosplice
468462
469463------------------------------------------------------------------------------
470464-- Monoid
471465------------------------------------------------------------------------------
472466
473−instance Monoid (CoserialT m a) where
467+instance Monoid (CostreamT m a) where
474468 mempty = nil
475469 mappend = (<>)
476470
@@ -478,9 +472,9 @@ instance Monoid (CoserialT m a) where
478472-- Monad
479473------------------------------------------------------------------------------
480474
481−instance Monad m => Monad (CoserialT m) where
475+instance Monad m => Monad (CostreamT m) where
482476 return = pure
483− (CoserialT (Stream m)) >>= f = CoserialT $ Stream $ \_ stp sng yld ->
477+ (CostreamT (Stream m)) >>= f = CostreamT $ Stream $ \_ stp sng yld ->
484478 let run x = (S.runStream x) Nothing stp sng yld
485479 single a = run $ toStream (f a)
486480 yield a r = run $ toStream $ f a <> (fromStream r >>= f)
@@ -490,8 +484,8 @@ instance Monad m => Monad (CoserialT m) where
490484-- Other instances
491485------------------------------------------------------------------------------
492486
493−MONAD_APPLICATIVE_INSTANCE(CoserialT,)
494−MONAD_COMMON_INSTANCES(CoserialT,)
487+MONAD_APPLICATIVE_INSTANCE(CostreamT,)
488+MONAD_COMMON_INSTANCES(CostreamT,)
495489
496490------------------------------------------------------------------------------
497491-- CoparallelT
@@ -707,12 +701,12 @@ zipWith f m1 m2 = fromStream $ go (toStream m1) (toStream m2)
707701 yield1 a ra = merge a ra
708702 (S.runStream mx) Nothing stp single1 yield1
709703
710−-- | The applicative instance of 'ZipSerial' zips a number of streams serially
704+-- | The applicative instance of 'ZipStream' zips a number of streams serially
711705-- i.e. it produces one element from each stream serially and then zips all
712706-- those elements.
713707--
714708-- @
715−-- main = (toList . 'zipSerially' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
709+-- main = (toList . 'zipStreamly' $ (,,) \<$\> s1 \<*\> s2 \<*\> s3) >>= print
716710-- where s1 = fromFoldable [1, 2]
717711-- s2 = fromFoldable [3, 4]
718712-- s3 = fromFoldable [5, 6]
@@ -722,22 +716,18 @@ zipWith f m1 m2 = fromStream $ go (toStream m1) (toStream m2)
722716-- @
723717--
724718-- The 'Semigroup' instance of this type works the same way as that of
725−-- 'SerialT'.
719+-- 'StreamT'.
726720--
727−newtype ZipSerial m a = ZipSerial {getZipSerial :: Stream m a}
721+newtype ZipStream m a = ZipStream {getZipStream :: Stream m a}
728722 deriving (Functor, Semigroup, Monoid)
729723
730−{-# Deprecated ZipStream "Please use ZipSerial instead." #-}
731−-- | Same as ZipSerial.
732−type ZipStream = ZipSerial
733−
734−instance Monad m => Applicative (ZipSerial m) where
735− pure = ZipSerial . S.repeat
724+instance Monad m => Applicative (ZipStream m) where
725+ pure = ZipStream . S.repeat
736726 (<*>) = zipWith id
737727
738−instance IsStream ZipSerial where
739− toStream = getZipSerial
740− fromStream = ZipSerial
728+instance IsStream ZipStream where
729+ toStream = getZipStream
730+ fromStream = ZipStream
741731
742732------------------------------------------------------------------------------
743733-- Parallely Zipping Streams
@@ -757,7 +747,7 @@ zipAsyncWith :: (IsStream t, MonadParallel m)
757747 => (a -> b -> c) -> t m a -> t m b -> t m c
758748zipAsyncWith = zipParallelWith
759749
760−-- | Like 'ZipSerial' but zips in parallel, it generates all the elements to
750+-- | Like 'ZipStream' but zips in parallel, it generates all the elements to
761751-- be zipped concurrently.
762752--
763753-- @
@@ -771,7 +761,7 @@ zipAsyncWith = zipParallelWith
771761-- @
772762--
773763-- The 'Semigroup' instance of this type works the same way as that of
774−-- 'SerialT'.
764+-- 'StreamT'.
775765--
776766newtype ZipParallel m a = ZipParallel {getZipParallel :: Stream m a}
777767 deriving (Functor, Semigroup, Monoid)
@@ -795,18 +785,18 @@ instance IsStream ZipParallel where
795785adapt :: (IsStream t1, IsStream t2) => t1 m a -> t2 m a
796786adapt = fromStream . toStream
797787
798−-- | Fix the type of a polymorphic stream as 'SerialT'.
799−serially :: IsStream t => SerialT m a -> t m a
800−serially = adapt
788+-- | Fix the type of a polymorphic stream as 'StreamT'.
789+streamly :: IsStream t => StreamT m a -> t m a
790+streamly = adapt
801791
802−-- | Fix the type of a polymorphic stream as 'CoserialT'.
803−coserially :: IsStream t => CoserialT m a -> t m a
804−coserially = adapt
792+-- | Fix the type of a polymorphic stream as 'CostreamT'.
793+costreamly :: IsStream t => CostreamT m a -> t m a
794+costreamly = adapt
805795
806−-- | Same as 'coserially'.
807−{-# DEPRECATED interleaving "Please use coserially instead." #-}
808−interleaving :: IsStream t => CoserialT m a -> t m a
809−interleaving = coserially
796+-- | Same as 'costreamly'.
797+{-# DEPRECATED interleaving "Please use costreamly instead." #-}
798+interleaving :: IsStream t => CostreamT m a -> t m a
799+interleaving = costreamly
810800
811801-- | Fix the type of a polymorphic stream as 'CoparallelT'.
812802coparallely :: IsStream t => CoparallelT m a -> t m a
@@ -821,14 +811,14 @@ asyncly = coparallely
821811parallely :: IsStream t => ParallelT m a -> t m a
822812parallely = adapt
823813
824−-- | Fix the type of a polymorphic stream as 'ZipSerial'.
825−zipSerially :: IsStream t => ZipSerial m a -> t m a
826−zipSerially = adapt
814+-- | Fix the type of a polymorphic stream as 'ZipStream'.
815+zipStreamly :: IsStream t => ZipStream m a -> t m a
816+zipStreamly = adapt
827817
828−-- | Same as 'zipParallely'.
829−{-# DEPRECATED zipping "Please use zipSerially instead." #-}
830−zipping :: IsStream t => ZipSerial m a -> t m a
831−zipping = zipSerially
818+-- | Same as 'zipStreamly'.
819+{-# DEPRECATED zipping "Please use zipStreamly instead." #-}
820+zipping :: IsStream t => ZipStream m a -> t m a
821+zipping = zipStreamly
832822
833823-- | Fix the type of a polymorphic stream as 'ZipParallel'.
834824zipParallely :: IsStream t => ZipParallel m a -> t m a
@@ -845,13 +835,13 @@ zippingAsync = zipParallely
845835
846836-- | Same as @runStream@.
847837{-# DEPRECATED runStreamT "Please use runStream instead." #-}
848−runStreamT :: Monad m => SerialT m a -> m ()
838+runStreamT :: Monad m => StreamT m a -> m ()
849839runStreamT = runStream
850840
851−-- | Same as @runStream . coserially@.
841+-- | Same as @runStream . costreamly@.
852842{-# DEPRECATED runInterleavedT "Please use 'runStream . interleaving' instead." #-}
853843runInterleavedT :: Monad m => InterleavedT m a -> m ()
854−runInterleavedT = runStream . coserially
844+runInterleavedT = runStream . costreamly
855845
856846-- | Same as @runStream . coparallely@.
857847{-# DEPRECATED runAsyncT "Please use 'runStream . coparallely' instead." #-}
@@ -864,9 +854,9 @@ runParallelT :: Monad m => ParallelT m a -> m ()
864854runParallelT = runStream . parallely
865855
866856-- | Same as @runStream . zipping@.
867−{-# DEPRECATED runZipStream "Please use 'runStream . zipSerially instead." #-}
868−runZipStream :: Monad m => ZipSerial m a -> m ()
869−runZipStream = runStream . zipSerially
857+{-# DEPRECATED runZipStream "Please use 'runStream . zipStreamly instead." #-}
858+runZipStream :: Monad m => ZipStream m a -> m ()
859+runZipStream = runStream . zipStreamly
870860
871861-- | Same as @runStream . zippingAsync@.
872862{-# DEPRECATED runZipAsync "Please use 'runStream . zipParallely instead." #-}
src/Streamly/Tutorial.hs+32−32
@@ -72,7 +72,7 @@ module Streamly.Tutorial
7272 -- ** Monad
7373 -- $monad
7474
75− -- *** Serial Composition ('SerialT')
75+ -- *** Serial Composition ('StreamT')
7676 -- $regularSerial
7777
7878 -- *** Async Composition ('AsyncT')
@@ -133,9 +133,9 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
133133-- $streams
134134--
135135-- Streamly provides many different stream types depending on the desired
136−-- composition style. The simplest type is 'SerialT'. 'SerialT' is a monad
137−-- transformer, the type @SerialT m a@ represents a stream of values of type
138−-- 'a' in some underlying monad 'm'. For example, @SerialT IO Int@ is a stream
136+-- composition style. The simplest type is 'StreamT'. 'StreamT' is a monad
137+-- transformer, the type @StreamT m a@ represents a stream of values of type
138+-- 'a' in some underlying monad 'm'. For example, @StreamT IO Int@ is a stream
139139-- of 'Int' in 'IO' monad.
140140
141141-- $generating
@@ -146,16 +146,16 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
146146-- using the 'lift' combinator. Some examples of streams with a single element:
147147--
148148-- @
149−-- return 1 :: 'SerialT' IO Int
149+-- return 1 :: 'StreamT' IO Int
150150-- @
151151-- @
152−-- liftIO $ putStrLn "Hello world!" :: 'SerialT' IO ()
152+-- liftIO $ putStrLn "Hello world!" :: 'StreamT' IO ()
153153-- @
154154--
155155-- We can combine streams using '<>' to create streams of many elements:
156156--
157157-- @
158−-- return 1 <> return 2 <> return 3 :: 'SerialT' IO Int
158+-- return 1 <> return 2 <> return 3 :: 'StreamT' IO Int
159159-- @
160160--
161161-- For more ways to construct or generate a stream see the module
@@ -163,13 +163,13 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
163163
164164-- $eliminating
165165--
166−-- 'runSerialT' runs a composed 'SerialT' computation, lowering the type into
166+-- 'runStreamT' runs a composed 'StreamT' computation, lowering the type into
167167-- the underlying monad and discarding the result stream:
168168--
169169-- @
170170-- import "Streamly"
171171--
172−-- main = 'runSerialT' $ liftIO $ putStrLn "Hello world!"
172+-- main = 'runStreamT' $ liftIO $ putStrLn "Hello world!"
173173-- @
174174--
175175-- 'toList' runs a stream computation and collects the result stream in a list
@@ -178,7 +178,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
178178-- you run a stream you need to tell how you want to interpret the stream by
179179-- using one of the stream type combinators ('serially', 'asyncly', 'parallely'
180180-- etc.). The combinator 'serially' is equivalent to annotating the type as @::
181−-- SerialT@.
181+-- StreamT@.
182182--
183183-- @
184184-- import "Streamly"
@@ -196,7 +196,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
196196-- Streams of the same type can be combined into a composite stream in many
197197-- different ways using one of the semigroup style binary composition operators
198198-- i.e. '<>', '<=>', '<|', '<|>', 'mplus'. These operators work on all stream
199−-- types ('SerialT', 'AsyncT' etc.) uniformly.
199+-- types ('StreamT', 'AsyncT' etc.) uniformly.
200200--
201201-- To illustrate the concurrent aspects, we will use the following @delay@
202202-- function to introduce a delay specified in seconds.
@@ -219,7 +219,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
219219-- total of 6 seconds because everything is serial:
220220--
221221-- @
222−-- main = 'runSerialT' $ delay 3 <> delay 2 <> delay 1
222+-- main = 'runStreamT' $ delay 3 <> delay 2 <> delay 1
223223-- @
224224-- @
225225-- ThreadId 36: Delay 3
@@ -234,7 +234,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
234234-- 3, 2, 4 and takes a total of 10 seconds because everything is serial:
235235--
236236-- @
237−-- main = 'runSerialT' $ (delay 1 <> delay 2) '<=>' (delay 3 <> delay 4)
237+-- main = 'runStreamT' $ (delay 1 <> delay 2) '<=>' (delay 3 <> delay 4)
238238-- @
239239-- @
240240-- ThreadId 36: Delay 1
@@ -254,7 +254,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
254254-- next one in a separate thread and so on:
255255--
256256-- @
257−-- main = 'runSerialT' $ delay 3 '<|' delay 2 '<|' delay 1
257+-- main = 'runStreamT' $ delay 3 '<|' delay 2 '<|' delay 1
258258-- @
259259-- @
260260-- ThreadId 42: Delay 1
@@ -268,7 +268,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
268268-- traversed in DFS style just like '<>'.
269269--
270270-- @
271−-- main = 'runSerialT' $ (p 1 '<|' p 2) '<|' (p 3 '<|' p 4)
271+-- main = 'runStreamT' $ (p 1 '<|' p 2) '<|' (p 3 '<|' p 4)
272272-- where p = liftIO . print
273273-- @
274274-- @
@@ -291,7 +291,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
291291-- of them blocks:
292292--
293293-- @
294−-- main = 'runSerialT' $ traced (sqrt 9) '<|' traced (sqrt 16) '<|' traced (sqrt 25)
294+-- main = 'runStreamT' $ traced (sqrt 9) '<|' traced (sqrt 16) '<|' traced (sqrt 25)
295295-- where traced m = liftIO (myThreadId >>= print) >> m
296296-- @
297297-- @
@@ -333,7 +333,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
333333-- import "Streamly"
334334-- import Network.HTTP.Simple
335335--
336−-- main = 'runSerialT' $ google \<|> bing \<|> duckduckgo
336+-- main = 'runStreamT' $ google \<|> bing \<|> duckduckgo
337337-- where
338338-- google = get "https://www.google.com/search?q=haskell"
339339-- bing = get "https://www.bing.com/search?q=haskell"
@@ -405,14 +405,14 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
405405
406406-- $regularSerial
407407--
408−-- When we interpret the monadic composition as 'SerialT' we get a standard
408+-- When we interpret the monadic composition as 'StreamT' we get a standard
409409-- list transformer like serial composition.
410410--
411411-- @
412412-- import "Streamly"
413413-- import "Streamly.Prelude"
414414--
415−-- main = 'runSerialT' $ do
415+-- main = 'runStreamT' $ do
416416-- x <- 'fromFoldable' [3,2,1]
417417-- delay x
418418-- @
@@ -434,7 +434,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
434434-- import "Streamly"
435435-- import Data.Semigroup (cycle1)
436436--
437−-- main = 'runSerialT' $ cycle1 (liftIO getLine) >>= liftIO . putStrLn
437+-- main = 'runStreamT' $ cycle1 (liftIO getLine) >>= liftIO . putStrLn
438438-- @
439439--
440440-- When multiple streams are composed using this style they nest in a DFS
@@ -446,7 +446,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
446446-- import "Streamly"
447447-- import "Streamly.Prelude"
448448--
449−-- main = 'runSerialT' $ do
449+-- main = 'runStreamT' $ do
450450-- x <- 'fromFoldable' [1,2]
451451-- y <- 'fromFoldable' [3,4]
452452-- liftIO $ putStrLn $ show (x, y)
@@ -468,7 +468,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
468468-- iterations) may be started concurrently. Concurrency is demand driven
469469-- i.e. more concurrent iterations are started only if the previous iterations
470470-- are not able to produce enough output for the consumer of the output stream.
471−-- This is the concurrent version of 'SerialT'.
471+-- This is the concurrent version of 'StreamT'.
472472--
473473-- @
474474-- import "Streamly"
@@ -492,8 +492,8 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
492492--
493493-- Concurrency is demand driven just as in the case of '<|'. When multiple
494494-- streams are composed using this style the iterations are triggered in a DFS
495−-- manner just like 'SerialT' i.e. nested iterations are executed before we
496−-- proceed to the next iteration at higher level. However, unlike 'SerialT'
495+-- manner just like 'StreamT' i.e. nested iterations are executed before we
496+-- proceed to the next iteration at higher level. However, unlike 'StreamT'
497497-- more than one iterations may be started concurrently, and based on the
498498-- demand from the consumer.
499499--
@@ -595,7 +595,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
595595-- Now we can interpret this in whatever way we want:
596596--
597597-- @
598−-- main = 'runSerialT' composed
598+-- main = 'runStreamT' composed
599599-- main = 'runAsyncT' composed
600600-- main = 'runInterleavedT' composed
601601-- main = 'runParallelT' composed
@@ -719,7 +719,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
719719-- +-----+--------------+------------+
720720-- | | Serial | Concurrent |
721721-- +=====+==============+============+
722−-- | DFS | 'SerialT' | 'AsyncT' |
722+-- | DFS | 'StreamT' | 'AsyncT' |
723723-- | +--------------+------------+
724724-- | | '<>' | '<|' |
725725-- +-----+--------------+------------+
@@ -862,7 +862,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
862862--
863863-- data Event = Harm Int | Heal Int | Quit deriving (Show)
864864--
865−-- userAction :: MonadIO m => 'SerialT' m Event
865+-- userAction :: MonadIO m => 'StreamT' m Event
866866-- userAction = cycle1 $ liftIO askUser
867867-- where
868868-- askUser = do
@@ -872,10 +872,10 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
872872-- "quit" -> return Quit
873873-- _ -> putStrLn "What?" >> askUser
874874--
875−-- acidRain :: MonadIO m => 'SerialT' m Event
875+-- acidRain :: MonadIO m => 'StreamT' m Event
876876-- acidRain = cycle1 $ liftIO (threadDelay 1000000) >> return (Harm 1)
877877--
878−-- game :: ('MonadAsync' m, MonadState Int m) => 'SerialT' m ()
878+-- game :: ('MonadAsync' m, MonadState Int m) => 'StreamT' m ()
879879-- game = do
880880-- event \<- userAction \<|> acidRain
881881-- case event of
@@ -890,7 +890,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
890890-- main = do
891891-- putStrLn "Your health is deteriorating due to acid rain,\\
892892-- \\ type \\"potion\\" or \\"quit\\""
893−-- _ <- runStateT ('runSerialT' game) 60
893+-- _ <- runStateT ('runStreamT' game) 60
894894-- return ()
895895-- @
896896--
@@ -942,7 +942,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
942942-- -- pipe to streamly
943943-- -- Adapt P.next to return a Maybe instead of Either
944944-- let nextM p = P.next p >>= either (\\_ -> return Nothing) (return . Just)
945−-- 'runSerialT' $ 'unfoldrM' nextM P.stdinLn >>= lift . putStrLn
945+-- 'runStreamT' $ 'unfoldrM' nextM P.stdinLn >>= lift . putStrLn
946946-- @
947947--
948948-- Interop with @streaming@:
@@ -956,7 +956,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
956956-- S.stdoutLn $ S.unfoldr unconsE stdinLn
957957--
958958-- -- streaming to streamly
959−-- 'runSerialT' $ unfoldrM S.uncons S.stdinLn >>= lift . putStrLn
959+-- 'runStreamT' $ unfoldrM S.uncons S.stdinLn >>= lift . putStrLn
960960--
961961-- @
962962--
test/Main.hs+64−64
@@ -20,11 +20,11 @@ import qualified Streamly.Prelude as A
2020singleton :: IsStream t => a -> t m a
2121singleton a = a .: nil
2222
23−toListSerial :: SerialT IO a -> IO [a]
24−toListSerial = A.toList . serially
23+toListSerial :: StreamT IO a -> IO [a]
24+toListSerial = A.toList . streamly
2525
26−toListInterleaved :: CoserialT IO a -> IO [a]
27−toListInterleaved = A.toList . coserially
26+toListInterleaved :: CostreamT IO a -> IO [a]
27+toListInterleaved = A.toList . costreamly
2828
2929toListAsync :: CoparallelT IO a -> IO [a]
3030toListAsync = A.toList . coparallely
@@ -37,10 +37,10 @@ main = hspec $ do
3737 describe "Runners" $ do
3838 -- XXX move these to property tests
3939 -- XXX use an IORef to store and check the side effects
40− it "simple serially" $
41− (runStream . serially) (return (0 :: Int)) `shouldReturn` ()
42− it "simple serially with IO" $
43− (runStream . serially) (liftIO $ putStrLn "hello") `shouldReturn` ()
40+ it "simple streamly" $
41+ (runStream . streamly) (return (0 :: Int)) `shouldReturn` ()
42+ it "simple streamly with IO" $
43+ (runStream . streamly) (liftIO $ putStrLn "hello") `shouldReturn` ()
4444
4545 describe "Empty" $ do
4646 it "Monoid - mempty" $
@@ -96,8 +96,8 @@ main = hspec $ do
9696 -- for Monoid that is using the right version of semigroup. Instance
9797 -- deriving can cause us to pick wrong instances sometimes.
9898
99− describe "Serial interleaved (<>) ordering check" $ interleaveCheck coserially (<>)
100− describe "Serial interleaved mappend ordering check" $ interleaveCheck coserially mappend
99+ describe "Serial interleaved (<>) ordering check" $ interleaveCheck costreamly (<>)
100+ describe "Serial interleaved mappend ordering check" $ interleaveCheck costreamly mappend
101101
102102 describe "Parallel interleaved (<>) ordering check" $ interleaveCheck parallely (<>)
103103 describe "Parallel interleaved mappend ordering check" $ interleaveCheck parallely mappend
@@ -111,11 +111,11 @@ main = hspec $ do
111111 -- Monoidal Compositions, multiset equality checks
112112 ---------------------------------------------------------------------------
113113
114− describe "Serial Composition" $ compose serially mempty id
115− describe "Interleaved Composition" $ compose coserially mempty sort
114+ describe "Serial Composition" $ compose streamly mempty id
115+ describe "Interleaved Composition" $ compose costreamly mempty sort
116116 describe "Left biased parallel Composition" $ compose coparallely mempty sort
117117 describe "Fair parallel Composition" $ compose parallely mempty sort
118− describe "Semigroup Composition for ZipSerial" $ compose zipSerially mempty id
118+ describe "Semigroup Composition for ZipSerial" $ compose zipStreamly mempty id
119119 describe "Semigroup Composition for ZipAsync" $ compose zipParallely mempty id
120120 -- XXX need to check alternative compositions as well
121121
@@ -124,11 +124,11 @@ main = hspec $ do
124124 ---------------------------------------------------------------------------
125125
126126 -- TBD need more such combinations to be tested.
127− describe "<> and <>" $ composeAndComposeSimple serially serially (cycle [[1 .. 9]])
127+ describe "<> and <>" $ composeAndComposeSimple streamly streamly (cycle [[1 .. 9]])
128128
129129 describe "<> and <=>" $ composeAndComposeSimple
130− serially
131− coserially
130+ streamly
131+ costreamly
132132 ([ [1 .. 9]
133133 , [1 .. 9]
134134 , [1, 3, 2, 4, 6, 5, 7, 9, 8]
@@ -136,8 +136,8 @@ main = hspec $ do
136136 ])
137137
138138 describe "<=> and <=>" $ composeAndComposeSimple
139− coserially
140− coserially
139+ costreamly
140+ costreamly
141141 ([ [1, 4, 2, 7, 3, 5, 8, 6, 9]
142142 , [1, 7, 4, 8, 2, 9, 5, 3, 6]
143143 , [1, 4, 3, 7, 2, 6, 9, 5, 8]
@@ -145,8 +145,8 @@ main = hspec $ do
145145 ])
146146
147147 describe "<=> and <>" $ composeAndComposeSimple
148− coserially
149− serially
148+ costreamly
149+ streamly
150150 ([ [1, 4, 2, 7, 3, 5, 8, 6, 9]
151151 , [1, 7, 4, 8, 2, 9, 5, 3, 6]
152152 , [1, 4, 2, 7, 3, 5, 8, 6, 9]
@@ -156,7 +156,7 @@ main = hspec $ do
156156 describe "Nested parallel and serial compositions" $ do
157157 let t = timed
158158 p = parallely
159− s = serially
159+ s = streamly
160160 {-
161161 -- This is not correct, the result can also be [4,4,8,0,8,0,2,2]
162162 -- because of parallelism of [8,0] and [8,0].
@@ -198,7 +198,7 @@ main = hspec $ do
198198 -- Monoidal composition recursion loops
199199 ---------------------------------------------------------------------------
200200
201− describe "Serial loops (<>)" $ loops serially id reverse
201+ describe "Serial loops (<>)" $ loops streamly id reverse
202202 describe "Left biased parallel loops (<|)" $ loops coparallely sort sort
203203 describe "Fair parallel loops (<|>)" $ loops parallely sort sort
204204
@@ -206,23 +206,23 @@ main = hspec $ do
206206 -- Bind and monoidal composition combinations
207207 ---------------------------------------------------------------------------
208208
209− describe "Bind and compose1" $ bindAndComposeSimple serially serially
210− describe "Bind and compose2" $ bindAndComposeSimple serially coserially
211− describe "Bind and compose3" $ bindAndComposeSimple serially coparallely
212− describe "Bind and compose4" $ bindAndComposeSimple serially parallely
209+ describe "Bind and compose1" $ bindAndComposeSimple streamly streamly
210+ describe "Bind and compose2" $ bindAndComposeSimple streamly costreamly
211+ describe "Bind and compose3" $ bindAndComposeSimple streamly coparallely
212+ describe "Bind and compose4" $ bindAndComposeSimple streamly parallely
213213
214− describe "Bind and compose1" $ bindAndComposeSimple coserially serially
215− describe "Bind and compose2" $ bindAndComposeSimple coserially coserially
216− describe "Bind and compose3" $ bindAndComposeSimple coserially coparallely
217− describe "Bind and compose4" $ bindAndComposeSimple coserially parallely
214+ describe "Bind and compose1" $ bindAndComposeSimple costreamly streamly
215+ describe "Bind and compose2" $ bindAndComposeSimple costreamly costreamly
216+ describe "Bind and compose3" $ bindAndComposeSimple costreamly coparallely
217+ describe "Bind and compose4" $ bindAndComposeSimple costreamly parallely
218218
219− describe "Bind and compose1" $ bindAndComposeSimple coparallely serially
220− describe "Bind and compose2" $ bindAndComposeSimple coparallely coserially
219+ describe "Bind and compose1" $ bindAndComposeSimple coparallely streamly
220+ describe "Bind and compose2" $ bindAndComposeSimple coparallely costreamly
221221 describe "Bind and compose3" $ bindAndComposeSimple coparallely coparallely
222222 describe "Bind and compose4" $ bindAndComposeSimple coparallely parallely
223223
224− describe "Bind and compose1" $ bindAndComposeSimple parallely serially
225− describe "Bind and compose2" $ bindAndComposeSimple parallely coserially
224+ describe "Bind and compose1" $ bindAndComposeSimple parallely streamly
225+ describe "Bind and compose2" $ bindAndComposeSimple parallely costreamly
226226 describe "Bind and compose3" $ bindAndComposeSimple parallely coparallely
227227 describe "Bind and compose4" $ bindAndComposeSimple parallely parallely
228228
@@ -231,36 +231,36 @@ main = hspec $ do
231231 fldl = foldl (<>) nil
232232
233233 forM_ [fldr, fldl] $ \k ->
234− describe "Bind and compose" $ bindAndComposeHierarchy serially serially k
234+ describe "Bind and compose" $ bindAndComposeHierarchy streamly streamly k
235235 forM_ [fldr, fldl] $ \k ->
236− describe "Bind and compose" $ bindAndComposeHierarchy serially coserially k
236+ describe "Bind and compose" $ bindAndComposeHierarchy streamly costreamly k
237237 forM_ [fldr, fldl] $ \k ->
238− describe "Bind and compose" $ bindAndComposeHierarchy serially coparallely k
238+ describe "Bind and compose" $ bindAndComposeHierarchy streamly coparallely k
239239 forM_ [fldr, fldl] $ \k ->
240− describe "Bind and compose" $ bindAndComposeHierarchy serially parallely k
240+ describe "Bind and compose" $ bindAndComposeHierarchy streamly parallely k
241241
242242 forM_ [fldr, fldl] $ \k ->
243− describe "Bind and compose" $ bindAndComposeHierarchy coserially serially k
243+ describe "Bind and compose" $ bindAndComposeHierarchy costreamly streamly k
244244 forM_ [fldr, fldl] $ \k ->
245− describe "Bind and compose" $ bindAndComposeHierarchy coserially coserially k
245+ describe "Bind and compose" $ bindAndComposeHierarchy costreamly costreamly k
246246 forM_ [fldr, fldl] $ \k ->
247− describe "Bind and compose" $ bindAndComposeHierarchy coserially coparallely k
247+ describe "Bind and compose" $ bindAndComposeHierarchy costreamly coparallely k
248248 forM_ [fldr, fldl] $ \k ->
249− describe "Bind and compose" $ bindAndComposeHierarchy coserially parallely k
249+ describe "Bind and compose" $ bindAndComposeHierarchy costreamly parallely k
250250
251251 forM_ [fldr, fldl] $ \k ->
252− describe "Bind and compose" $ bindAndComposeHierarchy coparallely serially k
252+ describe "Bind and compose" $ bindAndComposeHierarchy coparallely streamly k
253253 forM_ [fldr, fldl] $ \k ->
254− describe "Bind and compose" $ bindAndComposeHierarchy coparallely coserially k
254+ describe "Bind and compose" $ bindAndComposeHierarchy coparallely costreamly k
255255 forM_ [fldr, fldl] $ \k ->
256256 describe "Bind and compose" $ bindAndComposeHierarchy coparallely coparallely k
257257 forM_ [fldr, fldl] $ \k ->
258258 describe "Bind and compose" $ bindAndComposeHierarchy coparallely parallely k
259259
260260 forM_ [fldr, fldl] $ \k ->
261− describe "Bind and compose" $ bindAndComposeHierarchy parallely serially k
261+ describe "Bind and compose" $ bindAndComposeHierarchy parallely streamly k
262262 forM_ [fldr, fldl] $ \k ->
263− describe "Bind and compose" $ bindAndComposeHierarchy parallely coserially k
263+ describe "Bind and compose" $ bindAndComposeHierarchy parallely costreamly k
264264 forM_ [fldr, fldl] $ \k ->
265265 describe "Bind and compose" $ bindAndComposeHierarchy parallely coparallely k
266266 forM_ [fldr, fldl] $ \k ->
@@ -286,14 +286,14 @@ main = hspec $ do
286286 describe "Simple MonadError and MonadThrow" simpleMonadError
287287
288288 {-
289− describe "Composed MonadError serially" $ composeWithMonadError serially
290− describe "Composed MonadError coserially" $ composeWithMonadError coserially
289+ describe "Composed MonadError streamly" $ composeWithMonadError streamly
290+ describe "Composed MonadError costreamly" $ composeWithMonadError costreamly
291291 describe "Composed MonadError coparallely" $ composeWithMonadError coparallely
292292 describe "Composed MonadError parallely" $ composeWithMonadError parallely
293293 -}
294294
295− describe "Composed MonadThrow serially" $ composeWithMonadThrow serially
296− describe "Composed MonadThrow coserially" $ composeWithMonadThrow coserially
295+ describe "Composed MonadThrow streamly" $ composeWithMonadThrow streamly
296+ describe "Composed MonadThrow costreamly" $ composeWithMonadThrow costreamly
297297 describe "Composed MonadThrow coparallely" $ composeWithMonadThrow coparallely
298298 describe "Composed MonadThrow parallely" $ composeWithMonadThrow parallely
299299
@@ -326,7 +326,7 @@ composeWithMonadThrow
326326 , Semigroup (t IO Int)
327327 , MonadThrow (t IO)
328328 )
329− => (t IO Int -> SerialT IO Int) -> Spec
329+ => (t IO Int -> StreamT IO Int) -> Spec
330330composeWithMonadThrow t = do
331331 it "Compose throwM, nil" $
332332 (try $ tl (throwM (ExampleException "E") <> A.nil))
@@ -334,14 +334,14 @@ composeWithMonadThrow t = do
334334 it "Compose nil, throwM" $
335335 (try $ tl (A.nil <> throwM (ExampleException "E")))
336336 `shouldReturn` (Left (ExampleException "E") :: Either ExampleException [Int])
337− oneLevelNestedSum "serially" serially
338− oneLevelNestedSum "coserially" coserially
337+ oneLevelNestedSum "streamly" streamly
338+ oneLevelNestedSum "costreamly" costreamly
339339 oneLevelNestedSum "coparallely" coparallely
340340 oneLevelNestedSum "parallely" parallely
341341 -- XXX add two level nesting
342342
343− oneLevelNestedProduct "serially" serially
344− oneLevelNestedProduct "coserially" coserially
343+ oneLevelNestedProduct "streamly" streamly
344+ oneLevelNestedProduct "costreamly" costreamly
345345 oneLevelNestedProduct "coparallely" coparallely
346346 oneLevelNestedProduct "parallely" parallely
347347
@@ -372,7 +372,7 @@ _composeWithMonadError
372372 , Semigroup (t (ExceptT String IO) Int)
373373 , MonadError String (t (ExceptT String IO))
374374 )
375− => (t (ExceptT String IO) Int -> SerialT (ExceptT String IO) Int) -> Spec
375+ => (t (ExceptT String IO) Int -> StreamT (ExceptT String IO) Int) -> Spec
376376_composeWithMonadError t = do
377377 let tl = A.toList . t
378378 it "Compose throwError, nil" $
@@ -454,7 +454,7 @@ timed :: MonadIO (t IO) => Int -> t IO Int
454454timed x = liftIO (threadDelay (x * 100000)) >> return x
455455
456456interleaveCheck :: IsStream t
457− => (t IO Int -> SerialT IO Int)
457+ => (t IO Int -> StreamT IO Int)
458458 -> (t IO Int -> t IO Int -> t IO Int)
459459 -> Spec
460460interleaveCheck t f =
@@ -463,7 +463,7 @@ interleaveCheck t f =
463463 `shouldReturn` ([0, 100, 1, 101])
464464
465465parallelCheck :: MonadIO (t IO)
466− => (t IO Int -> SerialT IO Int)
466+ => (t IO Int -> StreamT IO Int)
467467 -> (t IO Int -> t IO Int -> t IO Int)
468468 -> Spec
469469parallelCheck t f = do
@@ -478,7 +478,7 @@ parallelCheck t f = do
478478 where event n = (liftIO $ threadDelay (n * 100000)) >> (return n)
479479
480480compose :: (IsStream t, Semigroup (t IO Int))
481− => (t IO Int -> SerialT IO Int) -> t IO Int -> ([Int] -> [Int]) -> Spec
481+ => (t IO Int -> StreamT IO Int) -> t IO Int -> ([Int] -> [Int]) -> Spec
482482compose t z srt = do
483483 -- XXX these should get covered by the property tests
484484 it "Compose mempty, mempty" $
@@ -517,7 +517,7 @@ composeAndComposeSimple
517517 , Semigroup (t2 IO Int)
518518#endif
519519 )
520− => (t1 IO Int -> SerialT IO Int)
520+ => (t1 IO Int -> StreamT IO Int)
521521 -> (t2 IO Int -> t2 IO Int)
522522 -> [[Int]] -> Spec
523523composeAndComposeSimple t1 t2 answer = do
@@ -565,7 +565,7 @@ loops t tsrt hsrt = do
565565
566566bindAndComposeSimple
567567 :: ( IsStream t1, IsStream t2, Semigroup (t2 IO Int), Monad (t2 IO))
568− => (t1 IO Int -> SerialT IO Int)
568+ => (t1 IO Int -> StreamT IO Int)
569569 -> (t2 IO Int -> t2 IO Int)
570570 -> Spec
571571bindAndComposeSimple t1 t2 = do
@@ -582,7 +582,7 @@ bindAndComposeSimple t1 t2 = do
582582bindAndComposeHierarchy
583583 :: ( IsStream t1, Monad (t1 IO)
584584 , IsStream t2, Monad (t2 IO))
585− => (t1 IO Int -> SerialT IO Int)
585+ => (t1 IO Int -> StreamT IO Int)
586586 -> (t2 IO Int -> t2 IO Int)
587587 -> ([t2 IO Int] -> t2 IO Int)
588588 -> Spec
@@ -626,7 +626,7 @@ mixedOps = do
626626 ] :: [Int])
627627 where
628628
629− composeMixed :: SerialT IO Int
629+ composeMixed :: StreamT IO Int
630630 composeMixed = do
631631 liftIO $ return ()
632632 liftIO $ putStr ""
@@ -640,7 +640,7 @@ mixedOps = do
640640 z1 <- do
641641 x11 <- return 1 <> return 2
642642 y11 <- coparallely $ return 1 <> return 2
643− z11 <- coserially $ return 1 <> return 2
643+ z11 <- costreamly $ return 1 <> return 2
644644 liftIO $ return ()
645645 liftIO $ putStr ""
646646 return (x11 + y11 + z11)
test/Prop.hs+68−68
@@ -36,7 +36,7 @@ equals eq stream list = do
3636
3737constructWithReplicateM
3838 :: IsStream t
39− => (t IO Int -> SerialT IO Int)
39+ => (t IO Int -> StreamT IO Int)
4040 -> Word8
4141 -> Property
4242constructWithReplicateM op len =
@@ -50,7 +50,7 @@ transformFromList
5050 :: ([Int] -> t IO Int)
5151 -> ([Int] -> [Int] -> Bool)
5252 -> ([Int] -> [Int])
53− -> (t IO Int -> SerialT IO Int)
53+ -> (t IO Int -> StreamT IO Int)
5454 -> [Int]
5555 -> Property
5656transformFromList constr eq listOp op a =
@@ -61,7 +61,7 @@ transformFromList constr eq listOp op a =
6161
6262foldFromList
6363 :: ([Int] -> t IO Int)
64− -> (t IO Int -> SerialT IO Int)
64+ -> (t IO Int -> StreamT IO Int)
6565 -> ([Int] -> [Int] -> Bool)
6666 -> [Int]
6767 -> Property
@@ -82,8 +82,8 @@ eliminateOp constr listOp op a =
8282
8383elemOp
8484 :: ([Word8] -> t IO Word8)
85− -> (t IO Word8 -> SerialT IO Word8)
86− -> (Word8 -> SerialT IO Word8 -> IO Bool)
85+ -> (t IO Word8 -> StreamT IO Word8)
86+ -> (Word8 -> StreamT IO Word8 -> IO Bool)
8787 -> (Word8 -> [Word8] -> Bool)
8888 -> (Word8, [Word8])
8989 -> Property
@@ -97,7 +97,7 @@ functorOps
9797 :: Functor (t IO)
9898 => ([Int] -> t IO Int)
9999 -> String
100− -> (t IO Int -> SerialT IO Int)
100+ -> (t IO Int -> StreamT IO Int)
101101 -> ([Int] -> [Int] -> Bool)
102102 -> Spec
103103functorOps constr desc t eq = do
@@ -108,7 +108,7 @@ transformOps
108108 :: IsStream t
109109 => ([Int] -> t IO Int)
110110 -> String
111− -> (t IO Int -> SerialT IO Int)
111+ -> (t IO Int -> StreamT IO Int)
112112 -> ([Int] -> [Int] -> Bool)
113113 -> Spec
114114transformOps constr desc t eq = do
@@ -159,7 +159,7 @@ wrapMaybe f =
159159eliminationOps
160160 :: ([Int] -> t IO Int)
161161 -> String
162− -> (t IO Int -> SerialT IO Int)
162+ -> (t IO Int -> StreamT IO Int)
163163 -> Spec
164164eliminationOps constr desc t = do
165165 -- Elimination
@@ -180,7 +180,7 @@ eliminationOps constr desc t = do
180180serialEliminationOps
181181 :: ([Int] -> t IO Int)
182182 -> String
183− -> (t IO Int -> SerialT IO Int)
183+ -> (t IO Int -> StreamT IO Int)
184184 -> Spec
185185serialEliminationOps constr desc t = do
186186 prop (desc ++ " head") $ eliminateOp constr (wrapMaybe head) $ A.head . t
@@ -194,7 +194,7 @@ serialEliminationOps constr desc t = do
194194transformOpsWord8
195195 :: ([Word8] -> t IO Word8)
196196 -> String
197− -> (t IO Word8 -> SerialT IO Word8)
197+ -> (t IO Word8 -> StreamT IO Word8)
198198 -> Spec
199199transformOpsWord8 constr desc t = do
200200 prop (desc ++ " elem") $ elemOp constr t A.elem elem
@@ -209,7 +209,7 @@ semigroupOps
209209#endif
210210 , Monoid (t IO Int))
211211 => String
212− -> (t IO Int -> SerialT IO Int)
212+ -> (t IO Int -> StreamT IO Int)
213213 -> ([Int] -> [Int] -> Bool)
214214 -> Spec
215215semigroupOps desc t eq = do
@@ -219,7 +219,7 @@ semigroupOps desc t eq = do
219219applicativeOps
220220 :: Applicative (t IO)
221221 => ([Int] -> t IO Int)
222− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
222+ -> (t IO (Int, Int) -> StreamT IO (Int, Int))
223223 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
224224 -> ([Int], [Int])
225225 -> Property
@@ -231,7 +231,7 @@ applicativeOps constr t eq (a, b) = monadicIO $ do
231231zipApplicative
232232 :: (IsStream t, Applicative (t IO))
233233 => ([Int] -> t IO Int)
234− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
234+ -> (t IO (Int, Int) -> StreamT IO (Int, Int))
235235 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
236236 -> ([Int], [Int])
237237 -> Property
@@ -247,7 +247,7 @@ zipApplicative constr t eq (a, b) = monadicIO $ do
247247zipMonadic
248248 :: (IsStream t, Monad (t IO))
249249 => ([Int] -> t IO Int)
250− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
250+ -> (t IO (Int, Int) -> StreamT IO (Int, Int))
251251 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
252252 -> ([Int], [Int])
253253 -> Property
@@ -268,7 +268,7 @@ zipMonadic constr t eq (a, b) =
268268monadThen
269269 :: Monad (t IO)
270270 => ([Int] -> t IO Int)
271− -> (t IO Int -> SerialT IO Int)
271+ -> (t IO Int -> StreamT IO Int)
272272 -> ([Int] -> [Int] -> Bool)
273273 -> ([Int], [Int])
274274 -> Property
@@ -280,7 +280,7 @@ monadThen constr t eq (a, b) = monadicIO $ do
280280monadBind
281281 :: Monad (t IO)
282282 => ([Int] -> t IO Int)
283− -> (t IO Int -> SerialT IO Int)
283+ -> (t IO Int -> StreamT IO Int)
284284 -> ([Int] -> [Int] -> Bool)
285285 -> ([Int], [Int])
286286 -> Property
@@ -297,136 +297,136 @@ main :: IO ()
297297main = hspec $ do
298298 describe "Construction" $ do
299299 -- XXX test for all types of streams
300− prop "serially replicateM" $ constructWithReplicateM serially
300+ prop "streamly replicateM" $ constructWithReplicateM streamly
301301 it "iterate" $
302− (A.toList . serially . (A.take 100) $ (A.iterate (+ 1) (0 :: Int)))
302+ (A.toList . streamly . (A.take 100) $ (A.iterate (+ 1) (0 :: Int)))
303303 `shouldReturn` (take 100 $ iterate (+ 1) 0)
304304
305305 it "iterateM" $ do
306306 let addM = (\ y -> return (y + 1))
307− A.toList . serially . (A.take 100) $ A.iterateM addM (0 :: Int)
307+ A.toList . streamly . (A.take 100) $ A.iterateM addM (0 :: Int)
308308 `shouldReturn` (take 100 $ iterate (+ 1) 0)
309309
310310 let folded :: IsStream t => [a] -> t IO a
311− folded = serially . (\xs ->
311+ folded = streamly . (\xs ->
312312 case xs of
313313 [x] -> return x -- singleton stream case
314314 _ -> foldMapWith (<>) return xs
315315 )
316316 describe "Functor operations" $ do
317− functorOps A.fromFoldable "serially" serially (==)
318− functorOps folded "serially folded" serially (==)
319− functorOps A.fromFoldable "coserially" coserially (==)
320− functorOps folded "coserially folded" coserially (==)
317+ functorOps A.fromFoldable "streamly" streamly (==)
318+ functorOps folded "streamly folded" streamly (==)
319+ functorOps A.fromFoldable "costreamly" costreamly (==)
320+ functorOps folded "costreamly folded" costreamly (==)
321321 functorOps A.fromFoldable "coparallely" coparallely sortEq
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 "zipSerially" zipSerially (==)
326− functorOps folded "zipSerially folded" zipSerially (==)
325+ functorOps A.fromFoldable "zipStreamly" zipStreamly (==)
326+ functorOps folded "zipStreamly folded" zipStreamly (==)
327327 functorOps A.fromFoldable "zipParallely" zipParallely (==)
328328 functorOps folded "zipParallely folded" zipParallely (==)
329329
330330 describe "Semigroup operations" $ do
331− semigroupOps "serially" serially (==)
332− semigroupOps "coserially" coserially (==)
331+ semigroupOps "streamly" streamly (==)
332+ semigroupOps "costreamly" costreamly (==)
333333 semigroupOps "coparallely" coparallely sortEq
334334 semigroupOps "parallely" parallely sortEq
335− semigroupOps "zipSerially" zipSerially (==)
335+ semigroupOps "zipStreamly" zipStreamly (==)
336336 semigroupOps "zipParallely" zipParallely (==)
337337
338338 describe "Applicative operations" $ do
339339 -- The tests using sorted equality are weaker tests
340340 -- We need to have stronger unit tests for all those
341341 -- XXX applicative with three arguments
342− prop "serially applicative" $ applicativeOps A.fromFoldable serially (==)
343− prop "serially applicative folded" $ applicativeOps folded serially (==)
344− prop "coserially applicative" $ applicativeOps A.fromFoldable coserially sortEq
345− prop "coserially applicative folded" $ applicativeOps folded coserially sortEq
342+ prop "streamly applicative" $ applicativeOps A.fromFoldable streamly (==)
343+ prop "streamly applicative folded" $ applicativeOps folded streamly (==)
344+ prop "costreamly applicative" $ applicativeOps A.fromFoldable costreamly sortEq
345+ prop "costreamly applicative folded" $ applicativeOps folded costreamly sortEq
346346 prop "coparallely applicative" $ applicativeOps A.fromFoldable coparallely sortEq
347347 prop "coparallely applicative folded" $ applicativeOps folded coparallely sortEq
348348 prop "parallely applicative folded" $ applicativeOps folded parallely sortEq
349349
350350 describe "Zip operations" $ do
351− prop "zipSerially applicative" $ zipApplicative A.fromFoldable zipSerially (==)
351+ prop "zipStreamly applicative" $ zipApplicative A.fromFoldable zipStreamly (==)
352352 -- XXX this hangs
353353 -- prop "zipParallely applicative" $ zipApplicative zipParallely (==)
354− prop "zip monadic serially" $ zipMonadic A.fromFoldable serially (==)
355− prop "zip monadic serially folded" $ zipMonadic folded serially (==)
356− prop "zip monadic coserially" $ zipMonadic A.fromFoldable coserially (==)
357− prop "zip monadic coserially folded" $ zipMonadic folded coserially (==)
354+ prop "zip monadic streamly" $ zipMonadic A.fromFoldable streamly (==)
355+ prop "zip monadic streamly folded" $ zipMonadic folded streamly (==)
356+ prop "zip monadic costreamly" $ zipMonadic A.fromFoldable costreamly (==)
357+ prop "zip monadic costreamly folded" $ zipMonadic folded costreamly (==)
358358 prop "zip monadic coparallely" $ zipMonadic A.fromFoldable coparallely (==)
359359 prop "zip monadic coparallely folded" $ zipMonadic folded coparallely (==)
360360 prop "zip monadic parallely" $ zipMonadic A.fromFoldable parallely (==)
361361 prop "zip monadic parallely folded" $ zipMonadic folded parallely (==)
362362
363363 describe "Monad operations" $ do
364− prop "serially monad then" $ monadThen A.fromFoldable serially (==)
365− prop "coserially monad then" $ monadThen A.fromFoldable coserially sortEq
364+ prop "streamly monad then" $ monadThen A.fromFoldable streamly (==)
365+ prop "costreamly monad then" $ monadThen A.fromFoldable costreamly sortEq
366366 prop "coparallely monad then" $ monadThen A.fromFoldable coparallely sortEq
367367 prop "parallely monad then" $ monadThen A.fromFoldable parallely sortEq
368368
369− prop "serially monad then folded" $ monadThen folded serially (==)
370− prop "coserially monad then folded" $ monadThen folded coserially sortEq
369+ prop "streamly monad then folded" $ monadThen folded streamly (==)
370+ prop "costreamly monad then folded" $ monadThen folded costreamly sortEq
371371 prop "coparallely monad then folded" $ monadThen folded coparallely sortEq
372372 prop "parallely monad then folded" $ monadThen folded parallely sortEq
373373
374− prop "serially monad bind" $ monadBind A.fromFoldable serially (==)
375− prop "coserially monad bind" $ monadBind A.fromFoldable coserially sortEq
374+ prop "streamly monad bind" $ monadBind A.fromFoldable streamly (==)
375+ prop "costreamly monad bind" $ monadBind A.fromFoldable costreamly sortEq
376376 prop "coparallely monad bind" $ monadBind A.fromFoldable coparallely sortEq
377377 prop "parallely monad bind" $ monadBind A.fromFoldable parallely sortEq
378378
379379 describe "Stream transform operations" $ do
380− transformOps A.fromFoldable "serially" serially (==)
381− transformOps A.fromFoldable "coserially" coserially (==)
382− transformOps A.fromFoldable "zipSerially" zipSerially (==)
380+ transformOps A.fromFoldable "streamly" streamly (==)
381+ transformOps A.fromFoldable "costreamly" costreamly (==)
382+ transformOps A.fromFoldable "zipStreamly" zipStreamly (==)
383383 transformOps A.fromFoldable "zipParallely" zipParallely (==)
384384 transformOps A.fromFoldable "coparallely" coparallely sortEq
385385 transformOps A.fromFoldable "parallely" parallely sortEq
386386
387− transformOps folded "serially folded" serially (==)
388− transformOps folded "coserially folded" coserially (==)
389− transformOps folded "zipSerially folded" zipSerially (==)
387+ transformOps folded "streamly folded" streamly (==)
388+ transformOps folded "costreamly folded" costreamly (==)
389+ transformOps folded "zipStreamly folded" zipStreamly (==)
390390 transformOps folded "zipParallely folded" zipParallely (==)
391391 transformOps folded "coparallely folded" coparallely sortEq
392392 transformOps folded "parallely folded" parallely sortEq
393393
394− transformOpsWord8 A.fromFoldable "serially" serially
395− transformOpsWord8 A.fromFoldable "coserially" coserially
396− transformOpsWord8 A.fromFoldable "zipSerially" zipSerially
394+ transformOpsWord8 A.fromFoldable "streamly" streamly
395+ transformOpsWord8 A.fromFoldable "costreamly" costreamly
396+ transformOpsWord8 A.fromFoldable "zipStreamly" zipStreamly
397397 transformOpsWord8 A.fromFoldable "zipParallely" zipParallely
398398 transformOpsWord8 A.fromFoldable "coparallely" coparallely
399399 transformOpsWord8 A.fromFoldable "parallely" parallely
400400
401− transformOpsWord8 folded "serially folded" serially
402− transformOpsWord8 folded "coserially folded" coserially
403− transformOpsWord8 folded "zipSerially folded" zipSerially
401+ transformOpsWord8 folded "streamly folded" streamly
402+ transformOpsWord8 folded "costreamly folded" costreamly
403+ transformOpsWord8 folded "zipStreamly folded" zipStreamly
404404 transformOpsWord8 folded "zipParallely folded" zipParallely
405405 transformOpsWord8 folded "coparallely folded" coparallely
406406 transformOpsWord8 folded "parallely folded" parallely
407407
408408 describe "Stream elimination operations" $ do
409− eliminationOps A.fromFoldable "serially" serially
410− eliminationOps A.fromFoldable "coserially" coserially
411− eliminationOps A.fromFoldable "zipSerially" zipSerially
409+ eliminationOps A.fromFoldable "streamly" streamly
410+ eliminationOps A.fromFoldable "costreamly" costreamly
411+ eliminationOps A.fromFoldable "zipStreamly" zipStreamly
412412 eliminationOps A.fromFoldable "zipParallely" zipParallely
413413 eliminationOps A.fromFoldable "coparallely" coparallely
414414 eliminationOps A.fromFoldable "parallely" parallely
415415
416− eliminationOps folded "serially folded" serially
417− eliminationOps folded "coserially folded" coserially
418− eliminationOps folded "zipSerially folded" zipSerially
416+ eliminationOps folded "streamly folded" streamly
417+ eliminationOps folded "costreamly folded" costreamly
418+ eliminationOps folded "zipStreamly folded" zipStreamly
419419 eliminationOps folded "zipParallely folded" zipParallely
420420 eliminationOps folded "coparallely folded" coparallely
421421 eliminationOps folded "parallely folded" parallely
422422
423423 describe "Stream elimination operations" $ do
424− serialEliminationOps A.fromFoldable "serially" serially
425− serialEliminationOps A.fromFoldable "coserially" coserially
426− serialEliminationOps A.fromFoldable "zipSerially" zipSerially
424+ serialEliminationOps A.fromFoldable "streamly" streamly
425+ serialEliminationOps A.fromFoldable "costreamly" costreamly
426+ serialEliminationOps A.fromFoldable "zipStreamly" zipStreamly
427427 serialEliminationOps A.fromFoldable "zipParallely" zipParallely
428428
429− serialEliminationOps folded "serially folded" serially
430− serialEliminationOps folded "coserially folded" coserially
431− serialEliminationOps folded "zipSerially folded" zipSerially
429+ serialEliminationOps folded "streamly folded" streamly
430+ serialEliminationOps folded "costreamly folded" costreamly
431+ serialEliminationOps folded "zipStreamly folded" zipStreamly
432432 serialEliminationOps folded "zipParallely folded" zipParallely