on master help sign in
remove redundant liftIO
54419aaHarendra Kumar
examples/ListDir.hs+2−2
@@ -7,12 +7,12 @@ import Streamly (runStream, aheadly)
7--
7--
8-- This example demonstrates that there is little difference between regular
8-- This example demonstrates that there is little difference between regular
9-- IO code and concurrent streamly code. You can just remove
9-- IO code and concurrent streamly code. You can just remove
10−-- 'runStream . asyncly' and this becomes your regular IO code.
10+-- 'runStream . aheadly' and this becomes your regular IO code.
11main :: IO ()
11main :: IO ()
12main = do
12main = do
13 hSetBuffering stdout LineBuffering
13 hSetBuffering stdout LineBuffering
14 runStream . aheadly $ getCurrentDir >>= readdir
14 runStream . aheadly $ getCurrentDir >>= readdir
15 where readdir d = do
15 where readdir d = do
16− (ds, fs) <- liftIO $ listDir d
16+ (ds, fs) <- listDir d
17 liftIO $ mapM_ putStrLn $ map show fs ++ map show ds
17 liftIO $ mapM_ putStrLn $ map show fs ++ map show ds
18 foldMap readdir ds
18 foldMap readdir ds