The Either
data type represents logical disjunction — this or
that.[14]
Have you ever wanted to return one type or another, depending on the input?
Typically, you'd write a class to represent the disjunctive nature of this requirement — perhaps using the visitor pattern again and dispatching polymorphically.
Either
is a better recoverable exception model than Java exceptions.