Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
MCSP.System.Random.Monad
Description
A monad that abstract randomized operations.
Synopsis
- data Random a
- evalRandom :: Generator g (ST s) => Random a -> g -> ST s a
- liftRandom :: (forall g m. Generator g m => g -> m a) -> Random a
- lazyRandom :: Random a -> Random a
Documentation
A monad capable of producing random values of a
.
evalRandom :: Generator g (ST s) => Random a -> g -> ST s a Source #
Evaluate a random computation with the given initial generator and return the final value.
liftRandom :: (forall g m. Generator g m => g -> m a) -> Random a Source #
Turn a standard RNG function into a Random
monad.