flix

0.65.0

Shuffle

eff ShuffleSource

An effect used to shuffle collections.

Operations

def permutation(len: Int32): Vector[Int32] \ Shuffle Source

Returns 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 Source

Handles 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 Source

Runs the Shuffle effect of the given function f.

In other words, re-interprets the Shuffle effect using the NonDet effect.