rhine-0.6.0: Functional Reactive Programming with type-level clocks

Safe HaskellNone
LanguageHaskell2010

FRP.Rhine.ClSF.Random

Description

Create ClSFs with randomness without IO. Uses the MonadRandom package. This module copies the API from dunai's Random.

Synopsis

Documentation

runRandS Source #

Arguments

:: (RandomGen g, Monad m) 
=> ClSF (RandT g m) cl a b 
-> g

The initial random seed

-> ClSF m cl a (g, b) 

Generates random values, updating the generator on every step.

evalRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a b Source #

Updates the generator every step but discards the generator.

execRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a g Source #

Updates the generator every step but discards the value, only outputting the generator.

evalRandIOS :: Monad m => ClSF (RandT StdGen m) cl a b -> IO (ClSF m cl a b) Source #

Evaluates the random computation by using the global random generator.

evalRandIOS' :: MonadIO m => ClSF (RandT StdGen m) cl a b -> ClSF m cl a b Source #

Evaluates the random computation by using the global random generator on the first tick.

getRandomS :: (MonadRandom m, Random a) => Behaviour m time a Source #

Produce a random value at every tick.

getRandomRS :: (MonadRandom m, Random a) => BehaviourF m time (a, a) a Source #

Produce a random value at every tick, within a range given per tick.

getRandomRS_ :: (MonadRandom m, Random a) => (a, a) -> Behaviour m time a Source #

Produce a random value at every tick, within a range given once.

getRandomsRS_ :: (MonadRandom m, Random b) => MSF m (b, b) [b] #

Create a stream of lists of random values in a given range, where the range is specified on every tick.

getRandomsRS :: (MonadRandom m, Random b) => (b, b) -> MSF m a [b] #

Create a stream of lists of random values in a given fixed range.

getRandomsS :: (MonadRandom m, Random b) => MSF m a [b] #

Create a stream of lists of random values.