<div class="gmail_quote">On Mon, Oct 12, 2009 at 12:25 AM, Michael Mossey <span dir="ltr">&lt;<a href="mailto:mpm@alumni.caltech.edu">mpm@alumni.caltech.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m trying to learn how to use randomness in Haskell and it seems very non-straightforward and complex. I could do a lot of things using &#39;split&#39; from System.Random, but apparently it&#39;s broken. There is the statistics package here:<br>

<br>
<a href="http://hackage.haskell.org/package/statistics" target="_blank">http://hackage.haskell.org/package/statistics</a><br>
<br>
Is this a better solution?<br></blockquote><div><br>Yes, as it&#39;s much faster, more robust, and (depending on your perspective) easier to use, provided you understand the ST monad.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


It uses the ST monad in the RandomVariate module. Can someone point me to a tutorial explaining ST, and/or a tutorial in the RandomVariate module?<br></blockquote><div><br>For a tutorial on grokking ST, I&#39;d suggest chapter 26 of Real World Haskell, but I&#39;m biased, since I wrote it:<br>
<br><a href="http://book.realworldhaskell.org/read/advanced-library-design-building-a-bloom-filter.html">http://book.realworldhaskell.org/read/advanced-library-design-building-a-bloom-filter.html</a><br><br>Note that this already assumes that you understand monads pretty well.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Pseudorandomness seems like one case where it would just be a hell of a lot simpler to have a global generator--never split the state. Is the ST monad some way to accomplish this?</blockquote><div><br>Having  <br></div></div>