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