toOption

open suspend fun toOption(orElse: suspend (R) -> Option<A>): Option<A>

fold the Effect into an Option. Where the shifted value R is mapped to Option by the provided function orElse, and result value A is mapped to Some.