Either<L, R>.fromOption constructor
Either<L, R>.fromOption (
- Option<
R> m, - L onNone()
Return an Either from a Option
:
Implementation
factory Either.fromOption(Option<R> m, L Function() onNone) => m.match(
() => Either.left(onNone()),
(r) => Either.of(r),
);