itemWiseEquals

fun <T> itemWiseEquals(iterable1: Iterable<T>, iterable2: Iterable<T>, comparator: (T, T) -> Boolean): Boolean

Compares iterable1 and iterable2 element-by-element, in iteration order, via comparator, returning true if and only if both have the same number of elements and every corresponding pair of elements satisfies comparator. Useful to compare two iterables for equality without materializing them into Lists first, or using a notion of "equality" other than Any.equals (e.g. structural equality of terms that ignores variable naming).


fun <T> itemWiseEquals(iterable1: Iterable<T>, iterable2: Iterable<T>): Boolean

Same as itemWiseEquals, using Any.equals (==) as the element comparator.


fun <T> itemWiseEquals(sequence1: Sequence<T>, sequence2: Sequence<T>, comparator: (T, T) -> Boolean): Boolean

Same as itemWiseEquals, for two Sequences rather than Iterables.


fun <T> itemWiseEquals(sequence1: Sequence<T>, sequence2: Sequence<T>): Boolean

Same as itemWiseEquals, for two Sequences rather than Iterables, using Any.equals (==) as the element comparator.