@@ -25,7 +25,7 @@ prodCount = 1000
25-- Stream generation and elimination
25-- Stream generation and elimination
26-------------------------------------------------------------------------------
26-------------------------------------------------------------------------------
28−type Stream m a = S.StreamT m a
28+type Stream m a = S.SerialT m a
30{-# INLINE source #-}
30{-# INLINE source #-}
31source :: S.IsStream t => Int -> Int -> t m Int
31source :: S.IsStream t => Int -> Int -> t m Int
@@ -54,13 +54,13 @@ toListLinear start = runToList $ source start sumCount
54{-# INLINE append #-}
54{-# INLINE append #-}
56 :: (Monoid (t m Int), Monad m, Monad (t m))
56 :: (Monoid (t m Int), Monad m, Monad (t m))
57− => (t m Int -> S.StreamT m Int) -> Int -> m ()
57+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
58append t start = runStream $ t $ foldMap return [start..start+sumCount]
58append t start = runStream $ t $ foldMap return [start..start+sumCount]
60{-# INLINE toNull0 #-}
60{-# INLINE toNull0 #-}
62 :: (S.IsStream t, Monad m, Monad (t m))
62 :: (S.IsStream t, Monad m, Monad (t m))
63− => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m ()
63+ => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m ()
64toNull0 t start = runStream . t $ do
64toNull0 t start = runStream . t $ do
65 x <- source start prodCount
65 x <- source start prodCount
66 y <- source start prodCount
66 y <- source start prodCount
@@ -69,7 +69,7 @@ toNull0 t start = runStream . t $ do
69{-# INLINE toList0 #-}
69{-# INLINE toList0 #-}
71 :: (S.IsStream t, Monad m, Monad (t m))
71 :: (S.IsStream t, Monad m, Monad (t m))
72− => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m [(Int, Int)]
72+ => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m [(Int, Int)]
73toList0 t start = runToList . t $ do
73toList0 t start = runToList . t $ do
74 x <- source start prodCount
74 x <- source start prodCount
75 y <- source start prodCount
75 y <- source start prodCount
@@ -78,7 +78,7 @@ toList0 t start = runToList . t $ do
78{-# INLINE toNull #-}
78{-# INLINE toNull #-}
80 :: (S.IsStream t, Monad m, Monad (t m))
80 :: (S.IsStream t, Monad m, Monad (t m))
81− => (t m Int -> S.StreamT m Int) -> Int -> m ()
81+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
82toNull t start = runStream . t $ do
82toNull t start = runStream . t $ do
83 x <- source start prodCount
83 x <- source start prodCount
84 y <- source start prodCount
84 y <- source start prodCount
@@ -87,7 +87,7 @@ toNull t start = runStream . t $ do
87{-# INLINE toList #-}
87{-# INLINE toList #-}
89 :: (S.IsStream t, Monad m, Monad (t m))
89 :: (S.IsStream t, Monad m, Monad (t m))
90− => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
90+ => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
91toList t start = runToList . t $ do
91toList t start = runToList . t $ do
92 x <- source start prodCount
92 x <- source start prodCount
93 y <- source start prodCount
93 y <- source start prodCount
@@ -96,7 +96,7 @@ toList t start = runToList . t $ do
96{-# INLINE toListSome #-}
96{-# INLINE toListSome #-}
98 :: (S.IsStream t, Monad m, Monad (t m))
98 :: (S.IsStream t, Monad m, Monad (t m))
99− => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
99+ => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
100toListSome t start =
100toListSome t start =
101 runToList . t $ S.take 1000 $ do
101 runToList . t $ S.take 1000 $ do
102 x <- source start prodCount
102 x <- source start prodCount
@@ -106,7 +106,7 @@ toListSome t start =
106{-# INLINE filterAllOut #-}
106{-# INLINE filterAllOut #-}
107filterAllOut
107filterAllOut
108 :: (S.IsStream t, Monad m, Monad (t m))
108 :: (S.IsStream t, Monad m, Monad (t m))
109− => (t m Int -> S.StreamT m Int) -> Int -> m ()
109+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
110filterAllOut t start = runStream . t $ do
110filterAllOut t start = runStream . t $ do
111 x <- source start prodCount
111 x <- source start prodCount
112 y <- source start prodCount
112 y <- source start prodCount
@@ -118,7 +118,7 @@ filterAllOut t start = runStream . t $ do
118{-# INLINE filterAllIn #-}
118{-# INLINE filterAllIn #-}
119filterAllIn
119filterAllIn
120 :: (S.IsStream t, Monad m, Monad (t m))
120 :: (S.IsStream t, Monad m, Monad (t m))
121− => (t m Int -> S.StreamT m Int) -> Int -> m ()
121+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
122filterAllIn t start = runStream . t $ do
122filterAllIn t start = runStream . t $ do
123 x <- source start prodCount
123 x <- source start prodCount
124 y <- source start prodCount
124 y <- source start prodCount
@@ -130,7 +130,7 @@ filterAllIn t start = runStream . t $ do
130{-# INLINE filterSome #-}
130{-# INLINE filterSome #-}
131filterSome
131filterSome
132 :: (S.IsStream t, Monad m, Monad (t m))
132 :: (S.IsStream t, Monad m, Monad (t m))
133− => (t m Int -> S.StreamT m Int) -> Int -> m ()
133+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
134filterSome t start = runStream . t $ do
134filterSome t start = runStream . t $ do
135 x <- source start prodCount
135 x <- source start prodCount
136 y <- source start prodCount
136 y <- source start prodCount
@@ -142,7 +142,7 @@ filterSome t start = runStream . t $ do
142{-# INLINE breakAfterSome #-}
142{-# INLINE breakAfterSome #-}
143breakAfterSome
143breakAfterSome
144 :: (S.IsStream t, Monad (t IO))
144 :: (S.IsStream t, Monad (t IO))
145− => (t IO Int -> S.StreamT IO Int) -> Int -> IO ()
145+ => (t IO Int -> S.SerialT IO Int) -> Int -> IO ()
146breakAfterSome t start = do
146breakAfterSome t start = do
147 (_ :: Either ErrorCall ()) <- try $ runStream . t $ do
147 (_ :: Either ErrorCall ()) <- try $ runStream . t $ do
148 x <- source start prodCount
148 x <- source start prodCount