joinLeft
is defined as:
abstract class Either[+A, +B]
def joinLeft[A1 >: A, B1 >: B, C](implicit ev: A1 <:< Either[C, B1]):
Either[C, B1] = this match {
case Left(a) => a
case Right(b) => Right(b)
}
- With the known
A
andB
, we need animplicit ev: A1 <:< Either[C, B1]
that- satisfies constraint
A1 >: A, B1 >: B
. - reifies
A1 <: Either[C, B1]
- satisfies constraint
- For that we'll need implicit
conforms[A1]
andconforms[Either[C, B1]]
If I'm still right until now, there seem to me many choices for A1
and B1
as long as they are beyond lower bounds A
and B
. So I would like to know how scala gives us A1
and Either[C, B1]
(and what they are) so that we get implicit conforms
to facilitate <:<
to do its job of asserting A1 <: Either[C, B1]
.
P.S.
I think this question is somewhat related to my another one "joinLeft [A1 >: A, B1 >: B, C]… why are type constraint A1 >: A and B1>: B necessary?". I would appreciate if anyone can also take a look at it.