Random

eff RandomSource

An effect used to generate random numbers.

Operations

def randomBool(): Bool Source

Returns a pseudorandom boolean.

def randomFloat32(): Float32 Source

Returns a pseudorandom 32-bit floating-point number.

def randomFloat64(): Float64 Source

Returns a pseudorandom 64-bit floating-point number.

def randomGaussian(): Float64 Source

Returns a Gaussian distributed 64-bit floating point number.

def randomInt32(): Int32 Source

Returns a pseudorandom 32-bit integer.

def randomInt64(): Int64 Source

Returns a pseudorandom 64-bit integer.

Definitions

def handle(f: a -> b \ ef): a -> b \ (ef & (~Random)) + IO \ IO Source

Handles 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 Source

Runs 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 Source

Runs 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 Source

Runs the Random effect of the given function f from an initial seed.

In other words, re-interprets the Random effect using seeded deterministic randomness.