dunai-0.13.2: Generalised reactive framework supporting classic, arrowized and monadic FRP.
Copyright(c) Ivan Perez and Manuel Baerenz 2016
LicenseBSD3
Maintainerivan.perez@keera.co.uk
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Trans.MSF.Random

Description

In this module, MSFs in a monad supporting random number generation (i.e. having the RandT layer in its stack) can be run. Running means supplying an initial random number generator, where the update of the generator at every random number generation is already taken care of.

Under the hood, RandT is basically just StateT, with the current random number generator as mutable state.

Synopsis

Documentation

runRandS Source #

Arguments

:: (RandomGen g, Functor m, Monad m) 
=> MSF (RandT g m) a b 
-> g

The initial random number generator.

-> MSF m a (g, b) 

Run an MSF in the RandT random number monad transformer by supplying an initial random generator. Updates the generator every step.

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

Evaluate an MSF in the RandT transformer, i.e. extract possibly random values by supplying an initial random generator. Updates the generator every step but discharges the generator.

getRandomS :: (MonadRandom m, Random b) => MSF m a b Source #

Create a stream of random values.

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

Create a stream of lists of random values.

getRandomRS :: (MonadRandom m, Random b) => (b, b) -> MSF m a b Source #

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

getRandomRS_ :: (MonadRandom m, Random b) => MSF m (b, b) b Source #

Create a stream 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] Source #

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

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

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