toOption

suspend fun <Error, A> Effect<Error, A>.toOption(recover: suspend (error: Error) -> Option<A>): Option<A>(source)

Run the Effect by returning Option of A, recover run the fallback lambda and returning its result of Option of A.


inline fun <Error, A> EagerEffect<Error, A>.toOption(recover: (error: Error) -> Option<A>): Option<A>(source)

Run the EagerEffect by returning Option of A, recover run the fallback lambda and returning its result of Option of A.