flix

0.73.0

OutOfBounds

eff OutOfBoundsSource

Indicates that an index was out of bounds. Useful for instances of Index or IndexMut.

Operations

def outOfBounds(msg: String): Void \ OutOfBounds Source

Stops execution with an error message.

Definitions

@Experimental
def handleWithResult(f: a -> b \ ef): a -> Result[String, b] \ ef - OutOfBounds Source

Handles the OutOfBounds effect of the given function f by converting out-of-bounds errors to Result values.

Returns Ok(f(x)) if the computation completes successfully. Returns Err(msg) if the computation raises outOfBounds(msg).

@Experimental
def runWithResult(f: Unit -> a \ ef): Result[String, a] \ ef - OutOfBounds Source

Runs the OutOfBounds effect of the given function f.

Returns Ok(f()) if the computation completes successfully. Returns Err(msg) if the computation raises outOfBounds(msg).