nullable

inline fun <A> nullable(block: NullableRaise.() -> A): A?(source)

Runs a computation block using Raise, and return its outcome as nullable type, where null represents logical failure.

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

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

See also

By default, nullable only allows raising null. Calling ignoreErrors inside nullable allows to raise any error, which will be returned to the caller as if null was raised.