@@ -40,7 +40,7 @@ main = hspec $ do
4040 it "simple streamly" $
4141 (runStream . streamly) (return (0 :: Int)) `shouldReturn` ()
4242 it "simple streamly with IO" $
43− (runStream . streamly) (liftIO $ putStrLn "hello") `shouldReturn` ()
43+ (runStream . streamly) (A.once $ putStrLn "hello") `shouldReturn` ()
4444
4545 describe "Empty" $ do
4646 it "Monoid - mempty" $
@@ -450,8 +450,8 @@ nestTwoParallelApp =
450450 in (toListParallel ((+) <$> s1 <*> s2) >>= return . sort)
451451 `shouldReturn` sort ([6,7,7,8,8,8,9,9,9,9,10,10,10,11,11,12] :: [Int])
452452
453−timed :: MonadIO (t IO) => Int -> t IO Int
454−timed x = liftIO (threadDelay (x * 100000)) >> return x
453+timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int
454+timed x = A.once (threadDelay (x * 100000)) >> return x
455455
456456interleaveCheck :: IsStream t
457457 => (t IO Int -> StreamT IO Int)
@@ -462,7 +462,7 @@ interleaveCheck t f =
462462 (A.toList . t) ((singleton 0 `f` singleton 1) `f` (singleton 100 `f` singleton 101))
463463 `shouldReturn` ([0, 100, 1, 101])
464464
465−parallelCheck :: MonadIO (t IO)
465+parallelCheck :: (IsStream t, Monad (t IO))
466466 => (t IO Int -> StreamT IO Int)
467467 -> (t IO Int -> t IO Int -> t IO Int)
468468 -> Spec
@@ -475,7 +475,7 @@ parallelCheck t f = do
475475 (A.toList . t) (event 4 `f` (event 3 `f` (event 2 `f` event 1)))
476476 `shouldReturn` ([1..4])
477477
478− where event n = (liftIO $ threadDelay (n * 100000)) >> (return n)
478+ where event n = (A.once $ threadDelay (n * 100000)) >> (return n)
479479
480480compose :: (IsStream t, Semigroup (t IO Int))
481481 => (t IO Int -> StreamT IO Int) -> t IO Int -> ([Int] -> [Int]) -> Spec
@@ -540,7 +540,7 @@ composeAndComposeSimple t1 t2 answer = do
540540 `shouldReturn` (answer !! 3)
541541
542542loops
543− :: (IsStream t, Semigroup (t IO Int), MonadIO (t IO))
543+ :: (IsStream t, Semigroup (t IO Int), Monad (t IO))
544544 => (t IO Int -> t IO Int)
545545 -> ([Int] -> [Int])
546546 -> ([Int] -> [Int])
@@ -555,12 +555,12 @@ loops t tsrt hsrt = do
555555 where
556556 loopHead x = do
557557 -- this print line is important for the test (causes a bind)
558− liftIO $ putStrLn "LoopHead..."
558+ A.once $ putStrLn "LoopHead..."
559559 t $ (if x < 3 then loopHead (x + 1) else nil) <> return x
560560
561561 loopTail x = do
562562 -- this print line is important for the test (causes a bind)
563− liftIO $ putStrLn "LoopTail..."
563+ A.once $ putStrLn "LoopTail..."
564564 t $ return x <> (if x < 3 then loopTail (x + 1) else nil)
565565
566566bindAndComposeSimple
@@ -628,21 +628,21 @@ mixedOps = do
628628
629629 composeMixed :: StreamT IO Int
630630 composeMixed = do
631− liftIO $ return ()
632− liftIO $ putStr ""
631+ A.once $ return ()
632+ A.once $ putStr ""
633633 x <- return 1
634634 y <- return 2
635635 z <- do
636636 x1 <- parallely $ return 1 <> return 2
637− liftIO $ return ()
638− liftIO $ putStr ""
637+ A.once $ return ()
638+ A.once $ putStr ""
639639 y1 <- coparallely $ return 1 <> return 2
640640 z1 <- do
641641 x11 <- return 1 <> return 2
642642 y11 <- coparallely $ return 1 <> return 2
643643 z11 <- costreamly $ return 1 <> return 2
644− liftIO $ return ()
645− liftIO $ putStr ""
644+ A.once $ return ()
645+ A.once $ putStr ""
646646 return (x11 + y11 + z11)
647647 return (x1 + y1 + z1)
648648 return (x + y + z)