melatonina
04/24/2020, 3:46 PMinline fun <A, B, C> Either<A, B>.flatMapLeft(block : (A) -> Either<C, B>) =
when(this) {
is Either.Left -> block(a)
is Either.Right -> b.right()
}
To me, it's helpful to try and recover from a failure, in a way that possibly yields another type of failure.
Is this a good name for this method?