@@ -11,20 +11,20 @@ default (Int)
1111
1212main :: IO ()
1313main = hspec $ do
14− it "simple wait_" $
15− wait_ (return 0) `shouldReturn` ()
16− it "simple wait_ with IO" $
17− wait_ (liftIO $ putStrLn "hello") `shouldReturn` ()
18− it "Captures a return value using wait" $
19− wait (return 0) `shouldReturn` ([0] :: [Int])
20− it "simple wait_ and 'then' with IO" $
21− wait_ (liftIO (putStrLn "hello") >> liftIO (putStrLn "world")) `shouldReturn` ()
22− it "Then and wait" $
23− wait (return 1 >> return 2) `shouldReturn` ([2] :: [Int])
24− it "Bind and wait" $
25− wait (do x <- return 1; y <- return 2; return (x + y)) `shouldReturn` ([3] :: [Int])
14+ it "simple runAsyncly" $
15+ runAsyncly (return 0) `shouldReturn` ()
16+ it "simple runAsyncly with IO" $
17+ runAsyncly (liftIO $ putStrLn "hello") `shouldReturn` ()
18+ it "Captures a return value using toList" $
19+ toList (return 0) `shouldReturn` ([0] :: [Int])
20+ it "simple runAsyncly and 'then' with IO" $
21+ runAsyncly (liftIO (putStrLn "hello") >> liftIO (putStrLn "world")) `shouldReturn` ()
22+ it "Then and toList" $
23+ toList (return 1 >> return 2) `shouldReturn` ([2] :: [Int])
24+ it "Bind and toList" $
25+ toList (do x <- return 1; y <- return 2; return (x + y)) `shouldReturn` ([3] :: [Int])
2626 it "Alternative composition of sync tasks" $
27− ((wait $ threads 0 $ (return 0 <|> return 1)) >>= return . sort) `shouldReturn` ([0, 1] :: [Int])
27+ ((toList $ threads 0 $ (return 0 <|> return 1)) >>= return . sort) `shouldReturn` ([0, 1] :: [Int])
2828 {-
2929 it "Alternative composition of async and sync tasks" $
3030 ((wait (threads 0 ((async (return 0) <|> return 1)))) >>= return . sort)