-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
Up until random-1.1
a barebone (and potentially brittle) way to serialise and deserialise a StdGen
would have been to use show
and read
, however random-1.2.0
removed Read
(for good reasons) which means this is not possible anymore. As a consequence, writing things like a Serialize
instance for StdGen
is not possible at the moment.
Technically speaking one can work around this by using the .Internal
module and simply use seedSMGen'
and unseedSMGen
on the underlying SMGen
, but it feels wrong to use the Internal
module and to rely on the concrete implementation of StdGen
.
In a nutshell, it would be nice to have two functions as part of the API similar to the following:
toSeedGamma :: StdGen -> (Word64, Word64)
fromSeedGamma :: (Word64, Word64) -> StdGen
Thanks!
and-pete
Metadata
Metadata
Assignees
Labels
No labels