flix

0.69.2

Math.Random

eff RandomSource

An effect used to generate random numbers.

Operations

def randomFloat64(): Float64 \ Random Source

Returns a pseudorandom 64-bit floating-point number in the range [0.0, 1.0].

def randomInt64(): Int64 \ Random Source

Returns a pseudorandom 64-bit integer.

Definitions

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

Handles the Random effect of the given function f.

In other words, re-interprets the Random effect using the IO effects.

def handleWithSeed(seed: Int64, f: a -> b \ ef): a -> b \ ef - Random 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.

@DefaultHandler
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 effects.

def runWithSeed(seed: Int64, f: Unit -> a \ ef): a \ ef - Random 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.