@@ -1,17 +1,17 @@
11import Control.Monad.IO.Class (liftIO)
22import Path.IO (listDir, getCurrentDir)
33import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
4−import Streamly (runStream, asParAhead)
4+import Streamly (runStream, asyncly)
55
66-- | List the current directory recursively using concurrent processing
77--
88-- This example demonstrates that there is little difference between regular
99-- IO code and concurrent streamly code. You can just remove
10−-- 'runStream . asParAhead' and this becomes your regular IO code.
10+-- 'runStream . asyncly' and this becomes your regular IO code.
1111main :: IO ()
1212main = do
1313 hSetBuffering stdout LineBuffering
14− runStream . asParAhead $ getCurrentDir >>= readdir
14+ runStream . asyncly $ getCurrentDir >>= readdir
1515 where readdir d = do
1616 (ds, fs) <- liftIO $ listDir d
1717 liftIO $ mapM_ putStrLn $ map show fs ++ map show ds