- type RVar = RVarT Identity
- runRVar :: RandomSource m s => RVar a -> s -> m a
- data RVarT n a
- runRVarT :: (Lift n m, RandomSource m s) => RVarT n a -> s -> m a
- nByteInteger :: Int -> RVarT m Integer
- nBitInteger :: Int -> RVarT m Integer

# Documentation

type RVar = RVarT IdentitySource

An opaque type containing a "random variable" - a value which depends on the outcome of some random process.

runRVar :: RandomSource m s => RVar a -> s -> m aSource

A random variable with access to operations in an underlying monad. Useful examples include any form of state for implementing random processes with hysteresis, or writer monads for implementing tracing of complicated algorithms.

MonadTrans RVarT | |

Monad (RVarT n) | |

Functor (RVarT n) | |

Applicative (RVarT n) | |

MonadIO m => MonadIO (RVarT m) | |

MonadRandom (RVarT n) | |

Lift m n => Sampleable (RVarT m) n t | |

Lift (RVarT Identity) (RVarT m) |

runRVarT :: (Lift n m, RandomSource m s) => RVarT n a -> s -> m aSource

"Runs" the monad.

nByteInteger :: Int -> RVarT m IntegerSource

A random variable evenly distributed over all unsigned integers from 0 to 2^(8*n)-1, inclusive.

nBitInteger :: Int -> RVarT m IntegerSource

A random variable evenly distributed over all unsigned integers from 0 to 2^n-1, inclusive.