That is a good example to ensure type consistency with minimal effort, you don't need |: and &: at the same time and achieve the same result (Option[Either[T, F]]).
One of my main point here is do not over obsess with data type generalization and construct unnecessary structures.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Fair enough! So what you're saying is you'd have the
ifTrue
andifFalse
themselves returnEither
s, if necessary, likeIs that right?
I wonder if there's an implicit conversion that would let us do away with the
Left()
andRight()
...That is a good example to ensure type consistency with minimal effort, you don't need
|:
and&:
at the same time and achieve the same result (Option[Either[T, F]]
).One of my main point here is do not over obsess with data type generalization and construct unnecessary structures.