toMaybe

inline fun <Ok> Ok.toMaybe(isSuccess: Ok.() -> Boolean): Maybe<Ok>

Wraps this value as a Maybe based on isSuccess.

Parameters

Ok

The type of the value to wrap.

isSuccess

Determines whether the value represents success.


val <T> T.toMaybe: Maybe<T & Any>

Smart-wraps any T as a Maybe.

Parameters

T

The type of the value to wrap.