You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is now a proliferation of right... and ...Right methods in
the class. This makes for a really wide interface. I want to consider
a simplification.
Note on #getRight(): that seems OK and should probably stay.
For everything else, what about a #swap() (or maybe a better name) method like so:
// for any...finalEither<L,R> e = ...;
// let...finalEither<R,L> ep = e.swap();
// then...asserte.isLeft() != ep.isLeft();
asserte.isLeft() || e.getRight().equals(ep.getLeft());
assert !e.isLeft() || e.getLeft().equals(ep.getRight());
Activity
aztecrex commentedon Sep 17, 2014
This has been implemented and release in 0.10.
Still not sure 'swap' is the right method name. Hoping to think of a better one before 1.0.