RosettaCodeData/Task/Synchronous-concurrency/Haskell/synchronous-concurrency-3.hs
2023-07-01 13:44:08 -04:00

6 lines
239 B
Haskell

writer takeLine putCount = loop 0
where loop n = do l <- takeLine
case l of
Just x -> do putStrLn x
loop (n+1)
Nothing -> putCount n