Replies: 1 comment 3 replies
-
Hey @gusega, Thank you for raising this issue.. I was not aware that I think it's going to be rather hard to fix, I think adding Cool thing is you can pretty nicely use the import arrow.core.Either;
import static arrow.core.raise.RaiseKt.either;
public class EitherExample {
public Either<String, Integer> multiline(Either<String, Integer> other ) {
return either(raise -> {
int x = 2;
var z = raise.bind(other);
return x + z;
});
}
public Either<String, Integer> singleline(Either<String, Integer> other ) {
return either(raise -> 2 + raise.bind(other));
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a method
I get a warning when returning
Either.Right
andEither.Left
:Unchecked assignment: 'arrow.core.Either.Right<MyType>' to 'arrow.core.Either<java.lang.String, MyType>
Unchecked assignment: 'arrow.core.Either.Left<java.lang.String>' to 'arrow.core.Either<java.lang.String, MyType>
How do I create them?
I think the problem is that
Left
andRight
do not declare a type parameter for the "missing" part. Instead they haveNothing
.Beta Was this translation helpful? Give feedback.
All reactions