flix

0.56.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) + NonDet + IO \ NonDet + IO Source

Handles the BiasedCoin effect of the given function f.

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

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

Runs the BiasedCoin effect of the given function f.

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