We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b525f3 commit 8c95805Copy full SHA for 8c95805
core/src/main/java/fj/data/Option.java
@@ -479,6 +479,10 @@ public final <X> Either<X, A> toEither(final X x) {
479
return isSome() ? Either.<X, A>right(some()) : Either.<X, A>left(x);
480
}
481
482
+ public final <X> Validation<X, A> toValidation(final X x) {
483
+ return Validation.validation(toEither(x));
484
+ }
485
+
486
/**
487
* A first-class version of the toEither method.
488
*
0 commit comments