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?