Generate a random Boolean.
8.9.Β Random Numbers
def
randNat.{u} {gen : Type u} [RandomGen gen] (g : gen) (lo hi : Nat) : Nat Γ gen
Generate a random natural number in the interval [lo, hi].
8.9.1.Β Random Generators
type class
RandomGen.{u} (g : Type u) : Type u
Interface for random number generators.
Instance Constructor
RandomGen.mk.{u} |
Methods
range | : | g β Nat Γ Nat |
| ||
next | : | g β Nat Γ g |
| ||
split | : | g β g Γ g |
The 'split' operation allows one to obtain two distinct random number generators. This is very useful in functional programs (for example, when passing a random number generator down to recursive calls). |
structure
StdGen : Type