
23 Jan
2012
23 Jan
'12
3:31 p.m.
Quoting Heka Treep
actor mbox = do empty <- atomically $ isEmptyTChan mbox if empty then actor mbox else do val <- atomically $ readTChan mbox putStrLn val actor mbox
This looks a bit silly. Why not just this? actor mbox = forever $ atomically (readTChan mbox) >>= putStrLn ~d