```fun <F, A, B, C> lift2(FA: Applicative&lt...
# arrow-contributors
j
Copy code
fun <F, A, B, C> lift2(FA: Applicative<F>, f: (A) -> (B) -> C, a: Kind<F, A>, b: Kind<F, B>): Kind<F, C> {
  return FA.run { a.map { f(it) }.let { b.ap(it) } }
}

fun <L, R>rightCombine(SG: Semigroup<R>, a: Either<L, R>, b: Either<L, R>): Either<L, R> {
  val f = { xa: R -> { xb: R ->  SG.run { xa.combine(xb) } } }

  return lift2(Either.applicative(), f, a, b).fix()
}
looks correct