Abort

eff AbortSource

An effect used to abort computation with an error message.

Operations

def abort(m: String): Void Source

Immediately aborts the current computation with the given error message m.

The computation cannot be resumed.

Definitions

def run(f: Unit -> a \ Abort): Result[String, a] Source

Runs the Abort effect of the given function f.

Returns Ok(f()) if the computation completes successfully without aborting. Returns Err(m) if the computation aborts with error message m.