| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Automaton.Trans.Random
Description
An Automatons 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
- runRandS :: (RandomGen g, Functor m, Monad m) => Automaton (RandT g m) a b -> g -> Automaton m a (g, b)
- evalRandS :: (RandomGen g, Functor m, Monad m) => Automaton (RandT g m) a b -> g -> Automaton m a b
- getRandomS :: (MonadRandom m, Random b) => Automaton m a b
- getRandomsS :: (MonadRandom m, Random b) => Automaton m a [b]
- getRandomRS :: (MonadRandom m, Random b) => (b, b) -> Automaton m a b
- getRandomRS_ :: (MonadRandom m, Random b) => Automaton m (b, b) b
- getRandomsRS :: (MonadRandom m, Random b) => (b, b) -> Automaton m a [b]
- getRandomsRS_ :: (MonadRandom m, Random b) => Automaton m (b, b) [b]
Documentation
evalRandS :: (RandomGen g, Functor m, Monad m) => Automaton (RandT g m) a b -> g -> Automaton m a b Source #
getRandomS :: (MonadRandom m, Random b) => Automaton m a b Source #
Create a stream of random values.
getRandomsS :: (MonadRandom m, Random b) => Automaton m a [b] Source #
Create a stream of lists of random values.
getRandomRS :: (MonadRandom m, Random b) => (b, b) -> Automaton m a b Source #
Create a stream of random values in a given fixed range.
getRandomRS_ :: (MonadRandom m, Random b) => Automaton 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) -> Automaton m a [b] Source #
Create a stream of lists of random values in a given fixed range.
getRandomsRS_ :: (MonadRandom m, Random b) => Automaton 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.