Re: [Haskell-cafe] Re: [Haskell] IVars

2007-12-09 Thread Conal Elliott
Thanks, Luke. I'd been unconsciously assuming that the IVar would get written to (if ever) by a thread other than the one doing the reading. (Even then, there could be a deadlock.) - Conal On Dec 9, 2007 9:37 AM, Luke Palmer [EMAIL PROTECTED] wrote: On Dec 9, 2007 5:09 PM, Conal Elliott

Re: [Haskell-cafe] Re: [Haskell] IVars

2007-12-09 Thread Lennart Augustsson
I would claim that it's fine to use the type readIVar :: IVar a - a if you're willing to give the right semantics to newIVar :: IO (IVar a) The semantics is that sometimes when you create an IVar you'll get one that always returns _|_ when read, sometimes you'll get a proper one. Now if you

Re: [Haskell-cafe] Re: [Haskell] IVars

2007-12-09 Thread Benja Fallenstein
Hi Conal, On Dec 9, 2007 6:09 PM, Conal Elliott [EMAIL PROTECTED] wrote: readIVar' :: IVar a - a readIVar' = unsafePerformIO . readIVar so, we do not need readIVar'. it could be a nice addition to the libraries, maybe as unsafeReadIVar or unsafeReadMVar. The same argument applies any to

Re: [Haskell-cafe] Re: [Haskell] IVars

2007-12-09 Thread Conal Elliott
Thanks. I don't know for what uses of IVars the difference in expressiveness is helpful, but now I get that the difference is there. Cheers, - Conal On Dec 9, 2007 2:08 PM, Benja Fallenstein [EMAIL PROTECTED] wrote: Hi Conal, On Dec 9, 2007 6:09 PM, Conal Elliott [EMAIL PROTECTED] wrote: