Random
Definitions
def choose(r: Random, a: Array[a, r]): Option[a] \ IO
SourceReturns a pseudorandom element from the given array a
using the random number generator r
.
Returns None
if the given array a
is empty.
def newWithSeed(s: Int64): Random \ IO
SourceReturns a fresh random number generator initialized with the given seed s
.
def nextBool(r: Random): Bool \ IO
SourceReturns the next pseudorandom boolean from the given random number generator r
.
def nextFloat32(r: Random): Float32 \ IO
SourceReturns the next pseudorandom 32-bit floating point number from the given random number generator r
.
def nextFloat64(r: Random): Float64 \ IO
SourceReturns the next pseudorandom 64-bit floating point number from the given random number generator r
.
def nextGaussian(r: Random): Float64 \ IO
SourceReturns the next pseudorandom Gaussian distributed 64-bit floating point number.
def nextInt32(r: Random): Int32 \ IO
SourceReturns the next pseudorandom 32-bit integer value from the given random number generator r
.
def nextInt64(r: Random): Int64 \ IO
SourceReturns the next pseudorandom 64-bit integer value from the given random number generator r
.
def nextNatWithMax(r: Random, m: Int32): Int32 \ IO
SourceReturns the next pseudorandom 32-bit integer value between 0
and m
(exclusive) using the given random number generator r
.