Created
April 25, 2017 17:50
-
-
Save fragamus/56e570e2df276de569c68d018d54aaae to your computer and use it in GitHub Desktop.
For some reason i is always 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filePathPipe :: MonadIO m => Pipe a a m () | |
filePathPipe = filePathPipe2 0 where | |
filePathPipe2 i = do | |
x <- await | |
yield x | |
liftIO $ putStrLn $ show i | |
if (i `mod` 10 == 0) | |
then do | |
liftIO $ putStrLn "TEN" | |
filePathPipe2 (i+1) | |
else filePathPipe2 (i+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment