MR K P SCHUPKE wrote:
tryReadMVar mv = do mc <- tryTakeMVar mv



The normal reason people want tryRead is to do something like unix's 'select' function, where you want to wait on
one of several signals...

Combining the channels into one is certainly a bit nicer, but there might be a reason to want to prefer one event over another.


But wouldn't it be better to write this using just tryTakeMVar, rather than tryRead followed by blocking take? This would guarantee that the events matched, and that the code would continue to work as expected in the multiple-reader case.

-Jan-Willem Maessen

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to