iorNel

inline fun <Error, A> iorNel(noinline combineError: (NonEmptyList<Error>, NonEmptyList<Error>) -> NonEmptyList<Error> = { a, b -> a + b }, block: IorRaise<NonEmptyList<Error>>.() -> A): IorNel<Error, A>

Run a computation block using Raise. and return its outcome as IorNel.

  • 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. This defaults to combining NonEmptyLists by concatenating them.

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