
Hi, Am Freitag, den 29.06.2018, 12:54 -0400 schrieb David Feuer:
On Friday, June 29, 2018 11:51:07 AM EDT Joachim Breitner wrote:
when reading the subject I was expecting something like this:
-- | pure! but blocks until the IVar is written readIVar :: IVar a -> a
-- | tries to write to an IVar. -- Succeeds if it is empty (returning True) -- Does nothing if it has been written to (returning False) writeIVar :: IVar a -> a -> IO Bool
It really depends. Are there useful (compile-time or run-time) optimization for IVars (write-once) that don't apply to QVars (fill- once)? If so, we might indeed want to offer writeIVar as you suggest, and
I don’t know! Maybe the GC can treat a filled IVar differently (because it is no longer mutable?) But really, I don't know :-) Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/