[Haskell] IVars
Simon Peyton-Jones
simonpj at microsoft.com
Tue Dec 4 03:25:28 EST 2007
But since the read may block, it matters *when* you perform it. For example if you print "Hello" and then read the IVar, you'll block after printing; but if you read the IVar and then print, the print won't come out. If the operation was pure (no IO) then you'd have a lot less control over when it happened.
Simon
From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org] On Behalf Of Lennart Augustsson
Sent: 04 December 2007 08:19
To: Conal Elliott
Cc: haskell at haskell.org
Subject: Re: [Haskell] IVars
Good question. That must be a matter of taste, because as you say the read will always produce the same result. But it sill is a bit of a strange operation.
-- Lennart
On Dec 4, 2007 6:25 AM, Conal Elliott < conal at conal.net<mailto:conal at conal.net>> wrote:
Oh. Simple enough. Thanks.
Another question: why the IO in readIVar :: IVar a -> IO a, instead of just readIVar :: IVar a -> a? After all, won't readIVar iv yield the same result (eventually) every time it's called?
On Dec 3, 2007 12:29 AM, Lennart Augustsson <lennart at augustsson.net<mailto:lennart at augustsson.net>> wrote:
You can make them from MVars.
On Dec 2, 2007 8:03 PM, Conal Elliott <conal at conal.net<mailto:conal at conal.net>> wrote:
what became of (assign-once) IVars? afaict, they were in concurrent haskell and now aren't.
_______________________________________________
Haskell mailing list
Haskell at haskell.org<mailto:Haskell at haskell.org>
http://www.haskell.org/mailman/listinfo/haskell
_______________________________________________
Haskell mailing list
Haskell at haskell.org<mailto:Haskell at haskell.org>
http://www.haskell.org/mailman/listinfo/haskell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20071204/e71d2125/attachment-0001.htm
More information about the Haskell
mailing list