<br><br><div class="gmail_quote">On Tue, Nov 3, 2009 at 2:16 PM, Tracy Wadleigh <span dir="ltr">&lt;<a href="mailto:tracy.wadleigh@gmail.com">tracy.wadleigh@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br><div class="gmail_quote"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div class="gmail_quote">

<div>I had to implement a ring buffer, and I wanted the code using it to be written in Haskell.  I ended up implementing the buffer in C, and wrapping it in FFI from Haskell because implementing a destructive array in Haskell is kind of unwieldy to someone of my experience level.  In Clean, it looks like the uniqueness typing allows for destructive updates in a very controlled manner.</div>


</div></blockquote></div><div><br>The ST monad provides this functionality. The never-instantiated-in-a-visible-way state parameter of the ST monad provides the &quot;uniqueness&quot; required for doing destructive updates in a pure way.<br>
</div></div></div></div></div></blockquote><div><br></div><div>Someone suggested that to me on IRC once I&#39;d already cranked out a C implementation with FFI bindings.  It&#39;s just too easy to use the FFI in Haskell :-)</div>
<div><br></div><div>If we raise the barrier of FFI, more people will use ST!</div><div><br></div><div>Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5"><div class="gmail_quote"><div class="gmail_quote"><div>

</div></div>
</div><br>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>