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