I generate list of
Either[A,B] and use
partition to obtain 2 collections of
val (bad, good) = l.partition(_.isLeft) val b = bad.map(_.left.getOrElse(Error("Error.check failed getting error"))) val g = good.map(_.right.get)
get are deprecated as shown in the ScalaDocs below:
right: RightProjection[A, B] Projects this Either as a Right. Because Either is right-biased, this method is not normally needed.
So how am I supposed to extract the types within?