var newRight;
if(either.isRight()) {
newRight = either.getOrElse(() => throw UnimplementedError());
} else {
return Left(either.fold((f) => f, (r) => throw UnimplementedError()))
}
How can I get left side of either and return it as in the example above? Any other, maybe cleaner solutions?