flix

0.73.0

KeyNotFound

eff KeyNotFoundSource

Indicates that a key was not found. Useful for instances of Index or IndexMut.

Operations

def keyNotFound(msg: String): Void \ KeyNotFound Source

Stops execution with an error message.

Definitions

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

Handles the KeyNotFound effect of the given function f by converting key-not-found errors to Result values.

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

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

Runs the KeyNotFound effect of the given function f.

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