
7 Mar
2009
7 Mar
'09
5:12 p.m.
Derek Elkins wrote:
Both are poorish style.
reader <- forkIO $ forever $ do (nr', line) <- readChan; when (nr /= nr') $ putStrLn hdl line
This is fine assuming you always want to re-enter the loop. If you want to loop conditionally (which is most often the case), forever isn't going to work, unless you use exceptions. Martijn.