<p dir="ltr">Changes to the instance Random for Int and other basic types have recently occurred without modifying anything about StdGen. I successfully submitted a patch a while back that had that effect. </p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 31, 2016 4:49 PM, "Paolo Giarrusso" <<a href="mailto:p.giarrusso@gmail.com">p.giarrusso@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Saturday, August 27, 2016 at 7:13:28 AM UTC+2, Christopher Howard wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">I know that, ff you feed mkStdGen a particular seed, and pull a list of<br>random numbers from that StdGen, that that the list will always be the<br>same if your run your compiled program over and over again on that same<br>system. But which of the following will cause you to get different output?:<p>2) Changes in "random" library version<br></p></blockquote><div><br>Here's my semi-informed two cents:<br><br></div><div>In principle yes if they change random-generation algorithm.</div><div><br></div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p>1) Changes in GHC version<br></p></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p>3) Compiling / Running on a different host computer (but compiling with<br>the same GHC & random versions.</p></blockquote><div> </div><div><div>IIUC no: the actual random number generator is not only a fully deterministic algorithm, but is written using simple integer arithmetic (not even bitwise operations) which should always have the same semantics (my only doubt is about the size of `Int`).<br>OTOH generating random floating-point numbers does more hackery which would require a closer inspection.</div></div><div><br>Reference: <span style="color:rgb(0,0,0)">stdNext and stdSplit in </span><a href="http://hackage.haskell.org/package/random-1.1/docs/src/System-Random.html#StdGen" target="_blank">http://hackage.haskell.org/<wbr>package/random-1.1/docs/src/<wbr>System-Random.html#StdGen</a><br><br>For further details and better reassurances, you might have better luck asking the authors (on GitHub). Maybe this could be documented?</div></div><br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div></div>