ZIO<R, E, A>.fromOptionOrFail constructor
ZIO<R, E, A>.fromOptionOrFail (
- Option<
A> oa, - E onNone()
Create a EIO from the given Option, succeeding when it is a Some,
and failing with the result of onNone
when it is a None.
Implementation
factory ZIO.fromOptionOrFail(
Option<A> oa,
E Function() onNone,
) =>
ZIO.syncEither(() => oa.toEither(() => onNone()));