<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Alberto G. Corona</b> <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>&gt;</span><br>
Date: 2009/12/15<br>Subject: Re: [Haskell-cafe] Boxed Mutable Arrays<br>To: Daniel Peebles &lt;<a href="mailto:pumpkingod@gmail.com">pumpkingod@gmail.com</a>&gt;<br><br><br>Ok, so the state content is not accessible. Nice.<br>
<br><div class="gmail_quote">2009/12/15 Daniel Peebles <span dir="ltr">&lt;<a href="mailto:pumpkingod@gmail.com" target="_blank">pumpkingod@gmail.com</a>&gt;</span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

No, they are actually being mutated. ST is basically IO with a<br>
universal state thread (IO uses RealWorld) to prevent you from letting<br>
any of the mutable structures out (or any in) of the block. The whole<br>
point of ST is to have real mutable references/arrays that have a<br>
referentially transparent if you look at them from outside.<br>
<br>
Dan<br>
<div><div></div><div><br>
On Tue, Dec 15, 2009 at 9:23 AM, Alberto G. Corona &lt;<a href="mailto:agocorona@gmail.com" target="_blank">agocorona@gmail.com</a>&gt; wrote:<br>
&gt; AFAIK, ST Arrays are pure data structures. They are not really mutable. They<br>
&gt; are destroyed and recreated on every update. The mutation is just simulated<br>
&gt; thanks to the hidden state in the state monad. Sure, the garbage collector<br>
&gt; must have a hard work in recycling all the &quot;backbones&quot; of the discarded<br>
&gt; arrays (not the elements).<br>
&gt;<br>
&gt; 2009/12/14 Brad Larsen &lt;<a href="mailto:brad.larsen@gmail.com" target="_blank">brad.larsen@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Is anyone working on fixing ticket #650<br>
&gt;&gt; &lt;<a href="http://hackage.haskell.org/trac/ghc/ticket/650" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/650</a>&gt;?  In short, STArray<br>
&gt;&gt; and the garbage collector don&#39;t play well together, resulting in array<br>
&gt;&gt; updates being non-constant time operations.  This bug makes it very<br>
&gt;&gt; difficult/impossible to write efficient array algorithms that depend<br>
&gt;&gt; upon mutation in Haskell.<br>
&gt;&gt;<br>
&gt;&gt; On another note, does this (or perhaps better phrased, will this) bug<br>
&gt;&gt; also affect Data Parallel Haskell?<br>
&gt;&gt;<br>
&gt;&gt; I would really like to see highly efficient, mutable, boxed arrays in<br>
&gt;&gt; Haskell!  Unfortunately, I don&#39;t have the know-how to fix Ticket 650.<br>
&gt;&gt;<br>
&gt;&gt; Sincerely,<br>
&gt;&gt; Brad<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Haskell-Cafe mailing list<br>
&gt;&gt; <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div></div></div><br>
</div><br>