
4 Sep
2009
4 Sep
'09
11:58 a.m.
In System.Random StdGen is defined as data StdGen = StdGen Int32 Int32 but its constructor StdGen is not exported. How to make StdGen to be an instance of Binary? The following won't work: instance Data.Binary.Binary StdGen where put (StdGen aa ab) = do Data.Binary.put aa Data.Binary.put ab get = do aa <- get ab <- get return (StdGen aa ab)