swap method

Either<R, L> swap()

If this is a Left, then return the left value in Right or vice versa.

Implementation

Either<R, L> swap() => fold((L r) => Right<R, L>((this as Left<L, R>)._value),
    (R r) => Left<R, L>((this as Right<L, R>)._value));