Scala Either type: How to get the value out of an Either
Scala Either
FAQ: How do I get the value out of a Scala Either
?
Solution
In this recipe I show many different ways to get the value out of a Scala Either
, while accounting for the fact that an Either
value may be a success value (a Right
) or a failure value (a Left
).