swap method

IOEither<R, L> swap()

Change this IOEither from IOEither<L, R> to IOEither<R, L>.

Implementation

IOEither<R, L> swap() =>
    IOEither(() => run().match((l) => Right(l), (r) => Left(r)));