-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | RNG within an IORef for convenient concurrent use
--   
--   rng-utils aims to make it easy to generate an RNG and safely use it
--   concurrently.
@package rng-utils
@version 0.3.0


-- | Convenience thread-safe wrapper around mwc-random library for
--   practical supply of random numbers in a concurrent environment.
module Data.RNG

-- | Mutable random number generator state
data RNG

-- | Create a new RNG in the IO monad using <a>newStdGen</a>. Splits the
--   global random number generator, so 2 calls to <a>mkRNG</a> will
--   produce different RNGs.
mkRNG :: IO RNG

-- | Create a new RNG with a user-specified seed.
seedRNG :: Int -> IO RNG

-- | Pack your own rng into the <a>RNG</a> type.
packRNG :: StdGen -> IO RNG

-- | Perform given action, mutating the RNG state underneath.
withRNG :: RNG -> (StdGen -> (a, StdGen)) -> IO a

-- | Generates a random salt of given length
randomToken :: Int -> RNG -> IO ByteString

-- | Generate a random value from a range.
rngRIO :: (Random a) => RNG -> (a, a) -> IO a

-- | Generate a random value.
rngIO :: (Random a) => RNG -> IO a
