Hoogle Search
Within LTS Haskell 23.21 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
randomIO :: (Random a, MonadIO m) => m arandom System.Random A variant of randomM that uses the global pseudo-random number generator globalStdGen.
>>> import Data.Int >>> randomIO :: IO Int32 -1580093805
This function is equivalent to getStdRandom random and is included in this interface for historical reasons and backwards compatibility. It is recommended to use uniformM instead, possibly with the globalStdGen if relying on the global state is acceptable.>>> import System.Random.Stateful >>> uniformM globalStdGen :: IO Int32 -1649127057
randomIO :: MTRandom a => IO amersenne-random System.Random.Mersenne A variant of random that uses the global random number generator (see System.Random#globalrng). Essentially a convenience function if you're already in IO. Note that there are performance penalties calling randomIO in an inner loop, rather than random applied to a global generator. The cost comes in retrieving the random gen from an IORef, which is non-trivial. Expect a 3x slow down in speed of random generation.
gRandomIO :: (ADTRecord a, Constraints a Random) => IO aone-liner-instances System.Random.OneLiner gRandomIOSum :: (ADT a, Constraints a Random) => IO aone-liner-instances System.Random.OneLiner
Page 1 of 1