lighthouse-client-0.2.0.0: Project Lighthouse client SDK
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lighthouse.Utils.Random

Synopsis

Documentation

newtype RandomM g a Source #

Constructors

RandomM 

Fields

Instances

Instances details
Applicative (RandomM g) Source # 
Instance details

Defined in Lighthouse.Utils.Random

Methods

pure :: a -> RandomM g a #

(<*>) :: RandomM g (a -> b) -> RandomM g a -> RandomM g b #

liftA2 :: (a -> b -> c) -> RandomM g a -> RandomM g b -> RandomM g c #

(*>) :: RandomM g a -> RandomM g b -> RandomM g b #

(<*) :: RandomM g a -> RandomM g b -> RandomM g a #

Functor (RandomM g) Source # 
Instance details

Defined in Lighthouse.Utils.Random

Methods

fmap :: (a -> b) -> RandomM g a -> RandomM g b #

(<$) :: a -> RandomM g b -> RandomM g a #

Monad (RandomM g) Source # 
Instance details

Defined in Lighthouse.Utils.Random

Methods

(>>=) :: RandomM g a -> (a -> RandomM g b) -> RandomM g b #

(>>) :: RandomM g a -> RandomM g b -> RandomM g b #

return :: a -> RandomM g a #

runRandomMIO :: RandomM StdGen a -> IO a Source #

Runs a random monad using the global RNG.

getRandomGen :: RandomM g g Source #

Fetches the generator inside the random monad.

randomM :: (RandomGen g, Random a) => RandomM g a Source #

Generates a random value inside the random monad.

randomRM :: (RandomGen g, Random a) => (a, a) -> RandomM g a Source #

Generates a bounded random value inside the random monad.

nRandomsR :: (RandomGen g, Random a) => Int -> ([a], [a]) -> RandomM g [a] Source #

Generates n random values in the given range without consuming the generator.

nRandoms :: (RandomGen g, Random a) => Int -> RandomM g [a] Source #

Generates n random values without consuming the generator.