@@ -3,6 +3,7 @@ module Main (main) where
33import Asyncly
44import Control.Applicative ((<|>))
55import Control.Concurrent (myThreadId, threadDelay)
6+import Data.Monoid ((<>))
67import Control.Monad.IO.Class (liftIO)
78import Data.List (nub, sort)
89import Test.Hspec
@@ -23,6 +24,8 @@ main = hspec $ do
2324 toList (return 1 >> return 2) `shouldReturn` ([2] :: [Int])
2425 it "Bind and toList" $
2526 toList (do x <- return 1; y <- return 2; return (x + y)) `shouldReturn` ([3] :: [Int])
27+ it "Monoid composition" $
28+ toList (return 0 <> return 1) `shouldReturn` ([0, 1] :: [Int])
2629 it "Alternative composition" $
2730 ((toList $ (return 0 <|> return 1)) >>= return . sort) `shouldReturn` ([0, 1] :: [Int])
2831 {-