zip

inline fun <B, C, D, E> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, transform: (B, C, D) -> E): List<E>
inline fun <B, C, D, E, F> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, transform: (B, C, D, E) -> F): List<F>
inline fun <B, C, D, E, F, G> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, transform: (B, C, D, E, F) -> G): List<G>
inline fun <B, C, D, E, F, G, H> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, g: Iterable<G>, transform: (B, C, D, E, F, G) -> H): List<H>
inline fun <B, C, D, E, F, G, H, I> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, g: Iterable<G>, h: Iterable<H>, transform: (B, C, D, E, F, G, H) -> I): List<I>
inline fun <B, C, D, E, F, G, H, I, J> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, g: Iterable<G>, h: Iterable<H>, i: Iterable<I>, transform: (B, C, D, E, F, G, H, I) -> J): List<J>
inline fun <B, C, D, E, F, G, H, I, J, K> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, g: Iterable<G>, h: Iterable<H>, i: Iterable<I>, j: Iterable<J>, transform: (B, C, D, E, F, G, H, I, J) -> K): List<K>
inline fun <B, C, D, E, F, G, H, I, J, K, L> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, e: Iterable<E>, f: Iterable<F>, g: Iterable<G>, h: Iterable<H>, i: Iterable<I>, j: Iterable<J>, k: Iterable<K>, transform: (B, C, D, E, F, G, H, I, J, K) -> L): List<L>
inline fun <Key, B, C, D, E> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, map: (Key, B, C, D) -> E): Map<Key, E>
inline fun <Key, B, C, D, E, F> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, map: (Key, B, C, D, E) -> F): Map<Key, F>
inline fun <Key, B, C, D, E, F, G> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, map: (Key, B, C, D, E, F) -> G): Map<Key, G>
inline fun <Key, B, C, D, E, F, G, H> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, g: Map<Key, G>, map: (Key, B, C, D, E, F, G) -> H): Map<Key, H>
inline fun <Key, B, C, D, E, F, G, H, I> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, g: Map<Key, G>, h: Map<Key, H>, map: (Key, B, C, D, E, F, G, H) -> I): Map<Key, I>
inline fun <Key, B, C, D, E, F, G, H, I, J> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, g: Map<Key, G>, h: Map<Key, H>, i: Map<Key, I>, map: (Key, B, C, D, E, F, G, H, I) -> J): Map<Key, J>
inline fun <Key, B, C, D, E, F, G, H, I, J, K> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, g: Map<Key, G>, h: Map<Key, H>, i: Map<Key, I>, j: Map<Key, J>, map: (Key, B, C, D, E, F, G, H, I, J) -> K): Map<Key, K>
inline fun <Key, B, C, D, E, F, G, H, I, J, K, L> Map<Key, B>.zip(c: Map<Key, C>, d: Map<Key, D>, e: Map<Key, E>, f: Map<Key, F>, g: Map<Key, G>, h: Map<Key, H>, i: Map<Key, I>, j: Map<Key, J>, k: Map<Key, K>, map: (Key, B, C, D, E, F, G, H, I, J, K) -> L): Map<Key, L>


fun <B, C, D, E> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, map: (B, C, D) -> E): Sequence<E>

Adds kotlin.sequences.zip support for 3 parameters


fun <B, C, D, E, F> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, map: (B, C, D, E) -> F): Sequence<F>

Adds kotlin.sequences.zip support for 4 parameters


fun <B, C, D, E, F, G> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, map: (B, C, D, E, F) -> G): Sequence<G>

Adds kotlin.sequences.zip support for 5 parameters


fun <B, C, D, E, F, G, H> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, g: Sequence<G>, map: (B, C, D, E, F, G) -> H): Sequence<H>

Adds kotlin.sequences.zip support for 6 parameters


fun <B, C, D, E, F, G, H, I> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, g: Sequence<G>, h: Sequence<H>, map: (B, C, D, E, F, G, H) -> I): Sequence<I>

Adds kotlin.sequences.zip support for 7 parameters


fun <B, C, D, E, F, G, H, I, J> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, g: Sequence<G>, h: Sequence<H>, i: Sequence<I>, map: (B, C, D, E, F, G, H, I) -> J): Sequence<J>

Adds kotlin.sequences.zip support for 8 parameters


fun <B, C, D, E, F, G, H, I, J, K> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, g: Sequence<G>, h: Sequence<H>, i: Sequence<I>, j: Sequence<J>, map: (B, C, D, E, F, G, H, I, J) -> K): Sequence<K>

Adds kotlin.sequences.zip support for 9 parameters


fun <B, C, D, E, F, G, H, I, J, K, L> Sequence<B>.zip(c: Sequence<C>, d: Sequence<D>, e: Sequence<E>, f: Sequence<F>, g: Sequence<G>, h: Sequence<H>, i: Sequence<I>, j: Sequence<J>, k: Sequence<K>, map: (B, C, D, E, F, G, H, I, J, K) -> L): Sequence<L>

Adds kotlin.sequences.zip support for 10 parameters


fun <K, A, B> Map<K, A>.zip(other: Map<K, B>): Map<K, Pair<A, B>>

Combines to structures by taking the intersection of their shapes and using Pair to hold the elements.

import arrow.core.zip
import io.kotest.matchers.shouldBe

fun test() {
mapOf(1 to "A", 2 to "B")
.zip(mapOf(1 to "1", 2 to "2", 3 to "3")) shouldBe mapOf(1 to Pair("A", "1"), 2 to Pair("B", "2"))
}

inline fun <Key, A, B, C> Map<Key, A>.zip(other: Map<Key, B>, map: (Key, A, B) -> C): Map<Key, C>

Combines to structures by taking the intersection of their shapes and combining the elements with the given function.

import arrow.core.zip
import io.kotest.matchers.shouldBe

fun test() {
mapOf(1 to "A", 2 to "B").zip(mapOf(1 to "1", 2 to "2", 3 to "3")) {
_, a, b -> "$a ~ $b"
} shouldBe mapOf(1 to "A ~ 1", 2 to "B ~ 2")
}