outcomeOf

inline fun <A> outcomeOf(block: OutcomeOfRaise.() -> A): OutcomeOf<A>(source)

DSL build on top of Arrow's Raise for OutcomeOf.

Uses Raise<Any?> to provide a slightly optimised builder than nesting either { option { } } and not-being able to use @JvmInline value class.

With context receivers this can be eliminated all together, and context(Raise<None>, Raise<Throwable>) or context(Raise<Null>, Raise<Throwable>) can be used instead.

This is a specialised version and allows interoperability with Result as the error side is locked down to Throwable.