combine

fun <A, B> Either<A, B>.combine(other: Either<A, B>, combineLeft: (A, A) -> A, combineRight: (B, B) -> B): Either<A, B>

Combine two Either values. If both are Right then combine both B values using combineRight or if both are Left then combine both A values using combineLeft, otherwise return the sole Left value (either this or other).