lundi 19 janvier 2015

How to obtain the seed used by Haskell's RNG?

I am using the following Haskell code to write a file of one million pseudorandom bits:



import System.Random
rbits= do
g <- getStdGen
writeFile "haskellbits.txt" (take 1000000 (randomRs ('0', '1') g))


However, I am also interested in writing the seed used to get the sequence. How can I output it?





Aucun commentaire:

Enregistrer un commentaire