@@ -308,6 +308,10 @@ dropWhileM =
308308 fS = Prelude.length n - Prelude.length fL
309309 in testUnfoldAD unf 0 fS n fL
310310
311+-------------------------------------------------------------------------------
312+-- Stream combination
313+-------------------------------------------------------------------------------
314+
311315zipWithM :: Property
312316zipWithM =
313317 property
@@ -336,6 +340,22 @@ outerProduct =
336340 lst = [(a, b) :: (Int, Int) | a <- [0 .. 10], b <- [0 .. 20]]
337341 in testUnfold unf ((0, 0) :: (Int, Int)) lst
338342
343+concatMapM :: Bool
344+concatMapM =
345+ let unfInF b =
346+ modify (+ 1)
347+ >> return
348+ (UF.lmap
349+ (\() -> undefined)
350+ (UF.supply
351+ (UF.replicateM 10)
352+ (modify (+ 1) >> return b)))
353+ listInF b = replicate 10 b
354+ unfOut = UF.enumerateFromToIntegral 10
355+ unf = UF.concatMapM unfInF unfOut
356+ list = List.concatMap listInF [1 .. 10]
357+ in testUnfoldAD unf 0 110 1 list
358+
339359-------------------------------------------------------------------------------
340360-- Test groups
341361-------------------------------------------------------------------------------
@@ -399,19 +419,35 @@ testTransformation =
399419 -- prop "dropWhile" dropWhile
400420 prop "dropWhileM" dropWhileM
401421
422+
423+testCombination :: Spec
424+testCombination =
425+ describe "Transformation"
426+ $ do
427+ prop "zipWithM" zipWithM
428+ -- prop "zipWith" zipWith
429+ -- prop "teeZipWith" teeZipWith
430+ prop "concat" concat
431+ prop "concatMapM" concatMapM
432+ prop "outerProduct" outerProduct
433+ -- prop "ap" ap
434+ -- prop "apDiscardFst" apDiscardFst
435+ -- prop "apDiscardSnd" apDiscardSnd
436+
437+
402438-------------------------------------------------------------------------------
403439-- Main
404440-------------------------------------------------------------------------------
405441
406442main :: IO ()
407−main = hspec $ do
408− testInputOps
409− testGeneration
410− testTransformation
411− describe "Unfold tests" $ do
412− prop "zipWithM" zipWithM
413− prop "concat" concat
414− prop "outerProduct" outerProduct
443+main =
444+ hspec
445+ $ describe "Unfold tests"
446+ $ do
447+ testInputOps
448+ testGeneration
449+ testTransformation
450+ testCombination
415451 -- prop "concatMapM" concatMapM
416452 -- prop "gbracket" gbracket
417453 -- prop "gbracketIO" gbracketIO