swap method

Either<R, L> swap()

Swaps Left and Right

Implementation

Either<R, L> swap() {
  return switch (this) {
    Left(:final value) => Right(value),
    Right(:final value) => Left(value),
  };
}