You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From #69 it seems that the preferred method for using the library is something like
main =do
s <-round<$> getPOSIXTime
g <- newIOGenM $ mkStdGen s
-- whatever thing using randomness
l <- replicateM 10$ uniformRM (1::Int, 100) g
print l
Using POSIXTime seems hacky, when there is a nicer method of getting a random seed:
importControl.MonadimportSystem.RandomimportSystem.Random.StatefulimportSystem.Random.InternalimportqualifiedSystem.Random.SplitMixasSMinitStdGen::IOStdGen
initStdGen =StdGen<$>SM.initSMGen
main =do
g <- initStdGen >>= newIOGenM
-- whatever thing using randomness
l <- replicateM 10$ uniformRM (1::Int, 100) g
print l
But it isn't a good idea to import internal modules, so initStdGen has to be added to the API.
The text was updated successfully, but these errors were encountered:
From #69 it seems that the preferred method for using the library is something like
Using POSIXTime seems hacky, when there is a nicer method of getting a random seed:
But it isn't a good idea to import internal modules, so
initStdGen
has to be added to the API.The text was updated successfully, but these errors were encountered: