Hoogle Search

Within LTS Haskell 22.18 (ghc-9.6.4)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. randomIO :: (Random a, MonadIO m) => m a

    random 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
    

  2. randomIO :: MTRandom a => IO a

    mersenne-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.

  3. gRandomIO :: forall a . (ADTRecord a, Constraints a Random) => IO a

    one-liner-instances System.Random.OneLiner

    randomIO implemented by calling gRandom on the global seed.

  4. gRandomIOSum :: forall a . (ADT a, Constraints a Random) => IO a

    one-liner-instances System.Random.OneLiner

    randomIO implemented by calling gRandom on the global seed.

Page 1 of 1