Basic random number generator support based on the one available on the Haskell library
Interface for random number generators.
range
returns the range of values returned by the generator.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).
Instances
Equations
- instInhabitedStdGen = { default := { s1 := 0, s2 := 0 } }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- IO.rand lo hi = do let gen ← ST.Ref.get IO.stdGenRef match randNat gen lo hi with | (r, gen) => do ST.Ref.set IO.stdGenRef gen pure r