@@ -2,7 +2,6 @@
22
33module Main (main) where
44
5−import Control.Applicative (ZipList(..))
65import Control.Concurrent (MVar, takeMVar, putMVar, newEmptyMVar)
76import Control.Exception
87 (BlockedIndefinitelyOnMVar(..), catches,
@@ -212,31 +211,6 @@ concurrentFoldrApplication n =
212211 (return [])
213212 listEquals (==) stream list
214213
215−-------------------------------------------------------------------------------
216−-- Zip operations
217−-------------------------------------------------------------------------------
218−
219−zipAsyncMonadic
220− :: IsStream t
221− => ([Int] -> t IO Int)
222− -> ([(Int, Int)] -> [(Int, Int)] -> Bool)
223− -> (t IO (Int, Int) -> SerialT IO (Int, Int))
224− -> ([Int], [Int])
225− -> Property
226−zipAsyncMonadic constr eq t (a, b) = withMaxSuccess maxTestCount $
227− monadicIO $ do
228− stream1 <-
229− run
230− ((S.toList . t)
231− (S.zipWithM (curry return) (constr a) (constr b)))
232− stream2 <-
233− run
234− ((S.toList . t)
235− (S.zipAsyncWithM (curry return) (constr a) (constr b)))
236− let list = getZipList $ (,) <$> ZipList a <*> ZipList b
237− listEquals eq stream1 list
238− listEquals eq stream2 list
239−
240214main :: IO ()
241215main = hspec
242216 $ H.parallel
@@ -264,11 +238,6 @@ main = hspec
264238 wAsyncOps spec = mapOps spec $ makeOps wAsyncly
265239#ifndef COVERAGE_BUILD
266240 <> [("maxBuffer (-1)", wAsyncly . maxBuffer (-1))]
267−#endif
268− let aheadOps :: IsStream t => ((AheadT IO a -> t IO a) -> Spec) -> Spec
269− aheadOps spec = mapOps spec $ makeOps aheadly
270−#ifndef COVERAGE_BUILD
271− <> [("maxBuffer (-1)", aheadly . maxBuffer (-1))]
272241#endif
273242 let parallelCommonOps :: IsStream t => [(String, ParallelT m a -> t m a)]
274243 parallelCommonOps = []
@@ -286,7 +255,6 @@ main = hspec
286255 mapOps spec $ makeConcurrentAppOps parallely <> parallelCommonOps
287256
288257 describe "Construction" $ do
289− aheadOps $ prop "aheadly replicateM" . constructWithReplicateM
290258 asyncOps $ prop "asyncly replicateM" . constructWithReplicateM
291259 wAsyncOps $ prop "wAsyncly replicateM" . constructWithReplicateM
292260 parallelOps $ prop "parallely replicateM" . constructWithReplicateM
@@ -301,8 +269,6 @@ main = hspec
301269 -- XXX add tests for fromIndices
302270
303271 describe "Functor operations" $ do
304− aheadOps $ functorOps S.fromFoldable "aheadly" (==)
305− aheadOps $ functorOps folded "aheadly folded" (==)
306272 asyncOps $ functorOps S.fromFoldable "asyncly" sortEq
307273 asyncOps $ functorOps folded "asyncly folded" sortEq
308274 wAsyncOps $ functorOps S.fromFoldable "wAsyncly" sortEq
@@ -311,14 +277,11 @@ main = hspec
311277 parallelOps $ functorOps folded "parallely folded" sortEq
312278
313279 describe "Semigroup operations" $ do
314− aheadOps $ semigroupOps "aheadly" (==)
315280 asyncOps $ semigroupOps "asyncly" sortEq
316281 wAsyncOps $ semigroupOps "wAsyncly" sortEq
317282 parallelOps $ semigroupOps "parallely" sortEq
318283
319284 describe "Applicative operations" $ do
320− aheadOps $ prop "aheadly applicative" . applicativeOps S.fromFoldable (==)
321− aheadOps $ prop "aheadly applicative folded" . applicativeOps folded (==)
322285 asyncOps $ prop "asyncly applicative" . applicativeOps S.fromFoldable sortEq
323286 asyncOps $ prop "asyncly applicative folded" . applicativeOps folded sortEq
324287 wAsyncOps $ prop "wAsyncly applicative" . applicativeOps S.fromFoldable sortEq
@@ -330,8 +293,6 @@ main = hspec
330293 -- We test only the serial zip with serial streams and the parallel
331294 -- stream, because the rate setting in these streams can slow down
332295 -- zipAsync.
333− aheadOps $ prop "zip monadic aheadly" . zipAsyncMonadic S.fromFoldable (==)
334− aheadOps $ prop "zip monadic aheadly folded" . zipAsyncMonadic folded (==)
335296 asyncOps $ prop "zip monadic asyncly" . zipAsyncMonadic S.fromFoldable (==)
336297 asyncOps $ prop "zip monadic asyncly folded" . zipAsyncMonadic folded (==)
337298 wAsyncOps $ prop "zip monadic wAsyncly" . zipAsyncMonadic S.fromFoldable (==)
@@ -345,22 +306,18 @@ main = hspec
345306 -- describe "Merge operations" $ do
346307
347308 describe "Monad operations" $ do
348− aheadOps $ prop "aheadly monad then" . monadThen S.fromFoldable (==)
349309 asyncOps $ prop "asyncly monad then" . monadThen S.fromFoldable sortEq
350310 wAsyncOps $ prop "wAsyncly monad then" . monadThen S.fromFoldable sortEq
351311 parallelOps $ prop "parallely monad then" . monadThen S.fromFoldable sortEq
352312
353− aheadOps $ prop "aheadly monad then folded" . monadThen folded (==)
354313 asyncOps $ prop "asyncly monad then folded" . monadThen folded sortEq
355314 wAsyncOps $ prop "wAsyncly monad then folded" . monadThen folded sortEq
356315 parallelOps $ prop "parallely monad then folded" . monadThen folded sortEq
357316
358− aheadOps $ prop "aheadly monad bind" . monadBind S.fromFoldable (==)
359317 asyncOps $ prop "asyncly monad bind" . monadBind S.fromFoldable sortEq
360318 wAsyncOps $ prop "wAsyncly monad bind" . monadBind S.fromFoldable sortEq
361319 parallelOps $ prop "parallely monad bind" . monadBind S.fromFoldable sortEq
362320
363− aheadOps $ prop "aheadly monad bind folded" . monadBind folded (==)
364321 asyncOps $ prop "asyncly monad bind folded" . monadBind folded sortEq
365322 wAsyncOps $ prop "wAsyncly monad bind folded" . monadBind folded sortEq
366323 parallelOps $ prop "parallely monad bind folded" . monadBind folded sortEq
@@ -393,7 +350,7 @@ main = hspec
393350 describe "Concurrent application" $ do
394351-- serialOps $ prop "serial" . concurrentApplication (==)
395352 asyncOps $ prop "async" . concurrentApplication sortEq
396− aheadOps $ prop "ahead" . concurrentApplication (==)
353+-- aheadOps $ prop "ahead" . concurrentApplication (==)
397354 parallelConcurrentAppOps $
398355 prop "parallel" . concurrentApplication sortEq
399356
@@ -403,43 +360,27 @@ main = hspec
403360 concurrentFoldlApplication
404361
405362 describe "Stream transform and combine operations" $ do
406− aheadOps $ transformCombineOpsCommon S.fromFoldable "aheadly" (==)
407363 asyncOps $ transformCombineOpsCommon S.fromFoldable "asyncly" sortEq
408364 wAsyncOps $ transformCombineOpsCommon S.fromFoldable "wAsyncly" sortEq
409365 parallelOps $ transformCombineOpsCommon S.fromFoldable "parallely" sortEq
410366
411− aheadOps $ transformCombineOpsCommon folded "aheadly" (==)
412367 asyncOps $ transformCombineOpsCommon folded "asyncly" sortEq
413368 wAsyncOps $ transformCombineOpsCommon folded "wAsyncly" sortEq
414369 parallelOps $ transformCombineOpsCommon folded "parallely" sortEq
415370
416− aheadOps $ transformCombineOpsOrdered S.fromFoldable "aheadly" (==)
417−
418− aheadOps $ transformCombineOpsOrdered folded "aheadly" (==)
419−
420371 describe "Stream elimination operations" $ do
421− aheadOps $ eliminationOps S.fromFoldable "aheadly"
422372 asyncOps $ eliminationOps S.fromFoldable "asyncly"
423373 wAsyncOps $ eliminationOps S.fromFoldable "wAsyncly"
424374 parallelOps $ eliminationOps S.fromFoldable "parallely"
425375
426− aheadOps $ eliminationOps folded "aheadly folded"
427376 asyncOps $ eliminationOps folded "asyncly folded"
428377 wAsyncOps $ eliminationOps folded "wAsyncly folded"
429378 parallelOps $ eliminationOps folded "parallely folded"
430379
431− aheadOps $ eliminationOpsWord8 S.fromFoldable "aheadly"
432380 asyncOps $ eliminationOpsWord8 S.fromFoldable "asyncly"
433381 wAsyncOps $ eliminationOpsWord8 S.fromFoldable "wAsyncly"
434382 parallelOps $ eliminationOpsWord8 S.fromFoldable "parallely"
435383
436− aheadOps $ eliminationOpsWord8 folded "aheadly folded"
437384 asyncOps $ eliminationOpsWord8 folded "asyncly folded"
438385 wAsyncOps $ eliminationOpsWord8 folded "wAsyncly folded"
439386 parallelOps $ eliminationOpsWord8 folded "parallely folded"
440−
441− -- XXX Add a test where we chain all transformation APIs and make sure that
442− -- the state is being passed through all of them.
443− describe "Stream serial elimination operations" $ do
444− aheadOps $ eliminationOpsOrdered S.fromFoldable "aheadly"
445− aheadOps $ eliminationOpsOrdered folded "aheadly folded"