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:
import Control.Monad
import System.Random
import System.Random.Stateful
import System.Random.Internal
import qualified System.Random.SplitMix as SM
initStdGen :: IO StdGen
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.