Hello. Does this method already exist, maybe under...
# arrow
m
Hello. Does this method already exist, maybe under another name, in Arrow?
Copy code
inline 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?