I have this piece of code on the Xor
object of cats
Xor.right(data).ensure(List(s"$name cannot be blank"))(_.nonEmpty)
Now since Xor has been removed, I am trying to write something similar using Either object
Either.ensuring(name.nonEmpty, List(s"$name cannot be blank"))
but this does not work because the return type of ensuring is Either.type
I can ofcourse write an if. but I want to do the validation with the cats constructs.