orNull

fun <E, A> Validated<E, A>.orNull(): A?

Return the Valid value, or null if Invalid


fun <B> Either<*, B>.orNull(): B?

Deprecated

Duplicated API. Please use Either's member function orNull. This will be removed towards Arrow 2.0

Replace with

orNull()

Returns the value from this Right or null if this is a Left.

Example:

import arrow.core.Either.Right
import arrow.core.Either.Left

fun main() {
Right(12).orNull() // Result: 12
Left(12).orNull() // Result: null
}