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