Random
eff Random
SourceAn effect used to generate random numbers.
Operations
def randomBool(): Bool
SourceReturns a pseudorandom boolean.
def randomFloat32(): Float32
SourceReturns a pseudorandom 32-bit floating-point number.
def randomFloat64(): Float64
SourceReturns a pseudorandom 64-bit floating-point number.
def randomGaussian(): Float64
SourceReturns a Gaussian distributed 64-bit floating point number.
def randomInt32(): Int32
SourceReturns a pseudorandom 32-bit integer.
def randomInt64(): Int64
SourceReturns a pseudorandom 64-bit integer.
Definitions
def handle(f: a -> b \ ef): a -> b \ (ef & (~Random)) + IO \ IO
SourceHandles the Random
effect of the given function f
.
In other words, re-interprets the Random
effect using the IO
effect.
def handleWithSeed(seed: Int64, f: a -> b \ ef): a -> b \ (ef & (~Random)) + IO \ IO
SourceRuns the Random
effect of the given function f
from an initial seed.
In other words, re-interprets the Random
effect using seeded deterministic randomness.
def runWithIO(f: Unit -> a \ ef): a \ (ef & (~Random)) + IO
SourceRuns the Random
effect of the given function f
.
In other words, re-interprets the Random
effect using the IO
effect.
def runWithSeed(seed: Int64, f: Unit -> a \ ef): a \ (ef & (~Random)) + IO
SourceRuns the Random
effect of the given function f
from an initial seed.
In other words, re-interprets the Random
effect using seeded deterministic randomness.