Abort
eff Abort
SourceAn effect used to abort computation with an error message.
Operations
def abort(m: String): Void
SourceImmediately aborts the current computation with the given error message m
.
The computation cannot be resumed.
Definitions
def handle(f: a -> b \ ef): a -> Result[String, b] \ ef & (~Abort)
SourceHandle the Abort
effect of the given function f
.
Returns a function that
- returns Ok(f())
if the computation completes successfully without aborting.
- returns Err(m)
if the computation aborts with error message m
.
def runWithResult(f: Unit -> a \ ef): Result[String, a] \ ef & (~Abort)
SourceRuns 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
.