24 Jan
2012
24 Jan
'12
4:31 a.m.
Quoting Heka Treep <zena.treep@gmail.com>:
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