@@ -36,7 +36,7 @@ equals eq stream list = do
37constructWithReplicateM
37constructWithReplicateM
38 :: IsStream t
38 :: IsStream t
39− => (t IO Int -> t IO Int)
39+ => (t IO Int -> SerialT IO Int)
41 -> Property
41 -> Property
42constructWithReplicateM op len =
42constructWithReplicateM op len =
@@ -47,11 +47,10 @@ constructWithReplicateM op len =
47 equals (==) stream list
47 equals (==) stream list
49transformFromList
49transformFromList
51− => ([Int] -> t IO Int)
50+ :: ([Int] -> t IO Int)
52 -> ([Int] -> [Int] -> Bool)
51 -> ([Int] -> [Int] -> Bool)
53 -> ([Int] -> [Int])
52 -> ([Int] -> [Int])
54− -> (t IO Int -> t IO Int)
53+ -> (t IO Int -> SerialT IO Int)
56 -> Property
55 -> Property
57transformFromList constr eq listOp op a =
56transformFromList constr eq listOp op a =
@@ -61,9 +60,8 @@ transformFromList constr eq listOp op a =
61 equals eq stream list
60 equals eq stream list
63foldFromList
62foldFromList
65− => ([Int] -> t IO Int)
63+ :: ([Int] -> t IO Int)
66− -> (t IO Int -> t IO Int)
64+ -> (t IO Int -> SerialT IO Int)
67 -> ([Int] -> [Int] -> Bool)
65 -> ([Int] -> [Int] -> Bool)
69 -> Property
67 -> Property
@@ -96,10 +94,10 @@ elemOp constr op streamOp listOp (x, xs) =
96 equals (==) stream list
94 equals (==) stream list
99− :: (IsStream t, Functor (t IO))
97+ :: Functor (t IO)
100 => ([Int] -> t IO Int)
98 => ([Int] -> t IO Int)
101 -> String
99 -> String
102− -> (t IO Int -> t IO Int)
100+ -> (t IO Int -> SerialT IO Int)
103 -> ([Int] -> [Int] -> Bool)
101 -> ([Int] -> [Int] -> Bool)
105functorOps constr desc t eq = do
103functorOps constr desc t eq = do
@@ -110,7 +108,7 @@ transformOps
110 :: IsStream t
108 :: IsStream t
111 => ([Int] -> t IO Int)
109 => ([Int] -> t IO Int)
112 -> String
110 -> String
113− -> (t IO Int -> t IO Int)
111+ -> (t IO Int -> SerialT IO Int)
114 -> ([Int] -> [Int] -> Bool)
112 -> ([Int] -> [Int] -> Bool)
116transformOps constr desc t eq = do
114transformOps constr desc t eq = do
@@ -181,10 +179,9 @@ eliminationOps constr desc t = do
181-- head/tail/last may depend on the order in case of parallel streams
179-- head/tail/last may depend on the order in case of parallel streams
182-- so we test these only for serial streams.
180-- so we test these only for serial streams.
183serialEliminationOps
181serialEliminationOps
185− => ([Int] -> t IO Int)
182+ :: ([Int] -> t IO Int)
186 -> String
183 -> String
187− -> (t IO Int -> t IO Int)
184+ -> (t IO Int -> SerialT IO Int)
189serialEliminationOps constr desc t = do
186serialEliminationOps constr desc t = do
190 prop (desc ++ " head") $ eliminateOp constr (wrapMaybe head) $ A.head . t
187 prop (desc ++ " head") $ eliminateOp constr (wrapMaybe head) $ A.head . t
@@ -214,7 +211,7 @@ semigroupOps
215 , Monoid (t IO Int))
212 , Monoid (t IO Int))
216 => String
213 => String
217− -> (t IO Int -> t IO Int)
214+ -> (t IO Int -> SerialT IO Int)
218 -> ([Int] -> [Int] -> Bool)
215 -> ([Int] -> [Int] -> Bool)
220semigroupOps desc t eq = do
217semigroupOps desc t eq = do
@@ -222,9 +219,9 @@ semigroupOps desc t eq = do
222 prop (desc ++ " mappend") $ foldFromList (foldMapWith mappend singleton) t eq
219 prop (desc ++ " mappend") $ foldFromList (foldMapWith mappend singleton) t eq
224applicativeOps
221applicativeOps
225− :: (IsStream t, Applicative (t IO))
222+ :: Applicative (t IO)
226 => ([Int] -> t IO Int)
223 => ([Int] -> t IO Int)
227− -> (t IO (Int, Int) -> t IO (Int, Int))
224+ -> (t IO (Int, Int) -> SerialT IO (Int, Int))
228 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
225 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
229 -> ([Int], [Int])
226 -> ([Int], [Int])
230 -> Property
227 -> Property
@@ -236,7 +233,7 @@ applicativeOps constr t eq (a, b) = monadicIO $ do
236zipApplicative
233zipApplicative
237 :: (IsStream t, Applicative (t IO))
234 :: (IsStream t, Applicative (t IO))
238 => ([Int] -> t IO Int)
235 => ([Int] -> t IO Int)
239− -> (t IO (Int, Int) -> t IO (Int, Int))
236+ -> (t IO (Int, Int) -> SerialT IO (Int, Int))
240 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
237 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
241 -> ([Int], [Int])
238 -> ([Int], [Int])
242 -> Property
239 -> Property
@@ -252,7 +249,7 @@ zipApplicative constr t eq (a, b) = monadicIO $ do
252zipMonadic
249zipMonadic
253 :: (IsStream t, Monad (t IO))
250 :: (IsStream t, Monad (t IO))
254 => ([Int] -> t IO Int)
251 => ([Int] -> t IO Int)
255− -> (t IO (Int, Int) -> t IO (Int, Int))
252+ -> (t IO (Int, Int) -> SerialT IO (Int, Int))
256 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
253 -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
257 -> ([Int], [Int])
254 -> ([Int], [Int])
258 -> Property
255 -> Property
@@ -271,9 +268,9 @@ zipMonadic constr t eq (a, b) =
271 equals eq stream2 list
268 equals eq stream2 list
274− :: (IsStream t, Monad (t IO))
271+ :: Monad (t IO)
275 => ([Int] -> t IO Int)
272 => ([Int] -> t IO Int)
276− -> (t IO Int -> t IO Int)
273+ -> (t IO Int -> SerialT IO Int)
277 -> ([Int] -> [Int] -> Bool)
274 -> ([Int] -> [Int] -> Bool)
278 -> ([Int], [Int])
275 -> ([Int], [Int])
279 -> Property
276 -> Property
@@ -283,9 +280,9 @@ monadThen constr t eq (a, b) = monadicIO $ do
283 equals eq stream list
280 equals eq stream list
286− :: (IsStream t, Monad (t IO))
283+ :: Monad (t IO)
287 => ([Int] -> t IO Int)
284 => ([Int] -> t IO Int)
288− -> (t IO Int -> t IO Int)
285+ -> (t IO Int -> SerialT IO Int)
289 -> ([Int] -> [Int] -> Bool)
286 -> ([Int] -> [Int] -> Bool)
290 -> ([Int], [Int])
287 -> ([Int], [Int])
291 -> Property
288 -> Property
@@ -313,7 +310,7 @@ main = hspec $ do
313 `shouldReturn` (take 100 $ iterate (+ 1) 0)
310 `shouldReturn` (take 100 $ iterate (+ 1) 0)
315 let folded :: IsStream t => [a] -> t IO a
312 let folded :: IsStream t => [a] -> t IO a
316− folded = adapt . serially . (\xs ->
313+ folded = serially . (\xs ->
317 case xs of
314 case xs of
318 [x] -> return x -- singleton stream case
315 [x] -> return x -- singleton stream case
319 _ -> foldMapWith (<>) return xs
316 _ -> foldMapWith (<>) return xs