Shuffle
eff Shuffle
SourceAn effect used to shuffle collections.
Operations
def permutation(len: Int32): Vector[Int32] \ Shuffle
SourceReturns a permutation of integers from 0 to len - 1
.
The permutation is represented as a vector where each position contains a unique integer in the range [0, len).
Definitions
def handle(f: a -> b \ ef): a -> b \ (ef - Shuffle) + NonDet
SourceHandles the Shuffle
effect of the given function f
.
In other words, re-interprets the Shuffle
effect using the NonDet
effect.
def runWithIO(f: Unit -> a \ ef): a \ (ef - Shuffle) + NonDet
SourceRuns the Shuffle
effect of the given function f
.
In other words, re-interprets the Shuffle
effect using the NonDet
effect.