flix

0.55.0

Eff.BiasedCoin

eff BiasedCoinSource

An effect used to throw a biased coin.

Operations

def flip(p: Float64): Bool Source

Returns true with probability p.

Definitions

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

Handles the BiasedCoin effect of the given function f.

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

def runWithIO(f: Unit -> a \ ef): a \ (ef - BiasedCoin) + IO Source

Runs the BiasedCoin effect of the given function f.

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