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