That argument doesn't totally fly since non-termination isn't considered an effect in Haskell. Bottom doesn't commute with a IO operations normally either.<br>But not having readIVar return 'IO a' does make me a little quesy. :)
<br><br> -- Lennart<br><br><div class="gmail_quote">On Dec 4, 2007 8:25 AM, Simon Peyton-Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">But since the read may block, it matters *<b>when</b>* 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.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Simon</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:haskell-bounces@haskell.org" target="_blank">haskell-bounces@haskell.org</a>
[mailto:<a href="mailto:haskell-bounces@haskell.org" target="_blank">haskell-bounces@haskell.org</a>] <b>On Behalf Of </b>Lennart Augustsson<br>
<b>Sent:</b> 04 December 2007 08:19<br>
<b>To:</b> Conal Elliott<br>
<b>Cc:</b> <a href="mailto:haskell@haskell.org" target="_blank">haskell@haskell.org</a><br>
<b>Subject:</b> Re: [Haskell] IVars</span></p>
</div>
</div><div><div></div><div class="Wj3C7c">
<p> </p>
<p style="margin-bottom: 12pt;">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.<br>
<br>
-- Lennart</p>
<div>
<p>On Dec 4, 2007 6:25 AM, Conal Elliott < <a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>> wrote:</p>
<p>Oh. Simple enough. Thanks. <br>
<br>
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? </p>
<div>
<div>
<p style="margin-bottom: 12pt;"> </p>
<div>
<p>On Dec 3, 2007 12:29 AM, Lennart Augustsson <<a href="mailto:lennart@augustsson.net" target="_blank">lennart@augustsson.net</a>>
wrote:</p>
<p style="margin-bottom: 12pt;">You can make them from MVars.</p>
<div>
<div>
<p>On Dec 2, 2007 8:03 PM, Conal Elliott <<a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>> wrote:</p>
</div>
<blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;">
<div>
<p style="margin-bottom: 12pt;">what became of (assign-once)
IVars? afaict, they were in concurrent haskell and now aren't.</p>
</div>
<p style="margin-bottom: 12pt;">_______________________________________________<br>
Haskell mailing list<br>
<a href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">http://www.haskell.org/mailman/listinfo/haskell
</a></p>
</blockquote>
</div>
<p> </p>
</div>
<p> </p>
</div>
</div>
<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
Haskell mailing list<br>
<a href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">http://www.haskell.org/mailman/listinfo/haskell</a></p>
</div>
<p> </p>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>Haskell mailing list<br><a href="mailto:Haskell@haskell.org">Haskell@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">http://www.haskell.org/mailman/listinfo/haskell
</a><br><br></blockquote></div><br>