
6 Feb
2012
6 Feb
'12
1:14 p.m.
On 6 February 2012 18:58, John Meacham
64 bits of entropy doesn't seem like much at all for a RNG. I thought the idea was StdGen could be fully abstract.
Well it's still sort of abstract since its constructor is not exported. My idea was that since StdGen already has a Read and Show instance we can just as well provide a more efficient serialization method. But I agree that the API should accommodate for changing the amount of bits. What about the following API: getStdGenState :: StdGen -> [Int32] getStdGenState (StdGen s1 s2) = [s1, s2] stdGenFromState :: [Int32] -> Maybe StdGen stdGenFromState [s1, s2] = Just (StdGen s1 s2) stdGenFromState _ = Nothing Bas