toOption

suspend fun <E, A> Effect<E, A>.toOption(orElse: suspend (E) -> Option<A>): Option<A>

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


fun <E, A> EagerEffect<E, A>.toOption(orElse: (E) -> Option<A>): Option<A>


suspend fun <A> Effect<None, A>.toOption(): Option<A>

Run the Effect by returning Option of A, or None if raised with None.