Excerpts from Ryan Newton's message of Tue Jan 24 10:25:37 -0500 2012: > This is related but somewhat tangential -- > > *Why isn't there a tryReadChan?* It looks like it would be implementable > with the current Chan representation in terms of tryTakeMVar. Especially > since isEmptyChan is deprecated this would be nice to have. > > Because of missing tryReadChan there is no non-blocking way to read data > resident in a Chan (i.e. flush it -- in this case because I was in an > exception handler and wanted to flush out what was left in memory in a > Chan). I found myself rolling my own in the form of the following data > structure to get around this:
Aw, that's a shame, especially since there does exist a tryReadMVar, so it seems like it ought to be possible (though I haven't checked closely.) Edward _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users