RosettaCodeData/Task/Synchronous-concurrency/Haskell/synchronous-concurrency-3.hs

7 lines
239 B
Haskell
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
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