Eff.RandomCoin

eff RandomCoinSource

An effect used to throw a random coin.

Operations

def flip(): Bool Source

Returns true or false with equal chance.

Definitions

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

Handles the RandomCoin effect of the given function f.

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

def runWithIO(f: Unit -> a \ ef): a \ (ef & (~RandomCoin)) + IO Source

Runs the RandomCoin effect of the given function f.

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