doEither<L, R> function
Implementation
Either<L, R> doEither<L, R>(
R Function(
A Function<A>(Either<L, A>),
) f,
) {
try {
return Right(
f(
<A>(either) => switch (either) {
Right(value: final value) => value,
Left(value: final value) => throw _EvalException(value)
},
),
);
} on _EvalException<L> catch (e) {
return Left(e.value);
}
}