Skip to content

Instantly share code, notes, and snippets.

@fragamus
Created April 25, 2017 17:50
Show Gist options
  • Save fragamus/56e570e2df276de569c68d018d54aaae to your computer and use it in GitHub Desktop.
Save fragamus/56e570e2df276de569c68d018d54aaae to your computer and use it in GitHub Desktop.
For some reason i is always 0
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