arrow-core-data / arrow.core / Ior / toLeftOption

toLeftOption

fun ~~toLeftOption~~(): Option<A> Deprecated: Deprecated, use leftOrNull instead

Returns a Some containing the Left value or A if this is Left or Both and None if this is a Right.

Example:

Right(12).toLeftOption() // Result: None
Left(12).toLeftOption()  // Result: Some(12)
Both(12, "power").toLeftOption()  // Result: Some(12)

Do you like Arrow?

Arrow Org
<