Thank you! I took me a bit of trying which libs, t...
# arrow
s
Thank you! I took me a bit of trying which libs, that would contain this, in my gradle file, but I finally found the
applicative
extension in the
arrow-instances-core
library.
Copy code
// This ext function can be used in a `Flowable.zip` or `Single.combineLatest`, etc...
fun <L, A, B, C, R> Either.Companion.combine3(zipper: (A, B, C) -> R) =
    Function3<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, R>> { ea, eb, ec ->
        Either.applicative<L>().map(ea, eb, ec) { (a, b, c) ->
            zipper(a, b, c)
        }.fix()
    }