p
ye
c
i'll reply here to keep noise down
mapLeft allows me to do some conditional mapping on error, i need a flatMapLeft
hmm
i'd have a mapLeft, then it.flip().flatMap { callEitherMethod(it) }.flip() ?
k
I think what Pakoito suggest is that you can write your own flatMapLeft by
Copy code
fun Either<L, R>.flatMapLeft(...) =
this.flip().flatMap(…).flip()
c
hmm
i thik it would have to exist within a mapLeft so that it is only invoked when it should be
k
in case of
Right
value the flatMapLeft only does 2x flipping
c
hmm
of course
that is clever
thanks
🤘 1