<br><br><div class="gmail_quote">On Wed, Oct 7, 2009 at 2:28 PM, Michael Mossey <span dir="ltr"><<a href="mailto:mpm@alumni.caltech.edu">mpm@alumni.caltech.edu</a>></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 don't quite follow your response. I want a program that initializes the generator from the global generator because I want different behavior every time I run it. So it will need IO. That's what I was trying to demonstrate. And I was wondering if one can get around the difficulty of passing the generator from call to call by using newStdGen in this way.<br>
</blockquote><div><br>You should only have to call newStdGen once:<br><br></div></div>main = do<br> g <- newStdGen<br> let (g1,g2) = split g<br> let xs = [1..10]<br> print $ shuffle g1 xs<br> print $ shuffle g2 xs<br>
<br>