@@ -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)