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)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to