ior

inline fun <Error, A> ior(noinline combineError: (Error, Error) -> Error, block: IorRaise<Error>.() -> A): Ior<Error, A>(source)

Runs a computation block using Raise, and return its outcome as Ior.

  • Ior.Right represents success,

  • Ior.Left represents logical failure which made it impossible to continue,

  • Ior.Both represents that some logical failures were raised, but it was possible to continue until producing a final value.

This function re-throws any exceptions thrown within the Raise block.

In both Ior.Left and Ior.Both cases, if more than one logical failure has been raised, they are combined using combineError.

Read more about running a Raise computation in the Arrow docs.