valenterry valenterry - 1 year ago 71
Scala Question

Is there a shortcut for Disjunction.fold(identity, identity)?

I have a scalaz

with the same types like
Disjunction[String, String]
and I just want to get the value, whatever it is. I therefore used
myDisjunction.fold(indentity, identity)
but I wonder, is there a shortcut like

Lee Lee
Answer Source

You can use merge:

val s: String = myDisjunction.merge()