combine

fun <A, T> Const<A, T>.combine(SG: Semigroup<A>, that: Const<A, T>): Const<A, T>(source)
fun <A, B> Ior<A, B>.combine(other: Ior<A, B>, combineA: (A, A) -> A, combineB: (B, B) -> B): Ior<A, B>(source)
fun <A> Option<A>.combine(other: Option<A>, combine: (A, A) -> A): Option<A>(source)


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

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 it returns the this or fallbacks to other in case this is Left.


fun <K, A> Map<K, A>.combine(other: Map<K, A>, combine: (A, A) -> A): Map<K, A>(source)

Combines two maps using combine to combine values for the same key.