Eff.RandomCoin
eff RandomCoin
SourceAn effect used to throw a random coin.
Operations
def flip(): Bool
SourceReturns true
or false
with equal chance.
Definitions
def handle(f: a -> b \ ef): a -> b \ (ef - RandomCoin) + IO \ IO
SourceHandles 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
SourceRuns the RandomCoin
effect of the given function f
.
In other words, re-interprets the RandomCoin
effect using the IO
effect.