arrow-core / arrow.core / kotlin.collections.Iterable

Extensions for kotlin.collections.Iterable

align Combines two structures by taking the union of their shapes and combining the elements with the given function.fun <A, B, C> Iterable<A>.align(b: Iterable<B>, fa: (Ior<A, B>) -> C): List<C>
Combines two structures by taking the union of their shapes and using Ior to hold the elements.fun <A, B> Iterable<A>.align(b: Iterable<B>): List<Ior<A, B>>
combineAll fun <A, B> Iterable<Either<A, B>>.combineAll(MA: Monoid<A>, MB: Monoid<B>): Either<A, B>
fun <A> Iterable<A>.combineAll(MA: Monoid<A>): A
fun <A> Iterable<Option<A>>.combineAll(MA: Monoid<A>): Option<A>
fun <K, A> Iterable<Map<K, A>>.combineAll(SG: Semigroup<A>): Map<K, A>
compareTo operator fun <A : Comparable<A>> Iterable<A>.compareTo(other: Iterable<A>): Int
crosswalk fun <A, B> Iterable<A>.crosswalk(f: (A) -> Iterable<B>): List<List<B>>
crosswalkMap fun <A, K, V> Iterable<A>.crosswalkMap(f: (A) -> Map<K, V>): Map<K, List<V>>
crosswalkNull fun <A, B> Iterable<A>.crosswalkNull(f: (A) -> B?): List<B>?
elementAtOrNone fun <T> Iterable<T>.elementAtOrNone(index: Int): Option<T>
filterOption fun <T> Iterable<Option<T>>.filterOption(): List<T>
firstOrNone fun <T> Iterable<T>.firstOrNone(): Option<T>
fun <T> Iterable<T>.firstOrNone(predicate: (T) -> Boolean): Option<T>
flatten fun <A> Iterable<Iterable<A>>.flatten(): List<A>
fold fun <A> Iterable<A>.fold(MA: Monoid<A>): A
foldMap fun <A, B> Iterable<A>.foldMap(MB: Monoid<B>, f: (A) -> B): B
foldRight fun <A, B> Iterable<A>.foldRight(initial: B, operation: (A, acc: B) -> B): B
ifThen Logical conditional. The equivalent of Prolog’s soft-cut. If its first argument succeeds at all, then the results will be fed into the success branch. Otherwise, the failure branch is taken.fun <A, B> Iterable<A>.ifThen(fb: Iterable<B>, ffa: (A) -> Iterable<B>): Iterable<B>
interleave interleave both computations in a fair way.fun <A> Iterable<A>.interleave(other: Iterable<A>): List<A>
lastOrNone fun <T> Iterable<T>.lastOrNone(): Option<T>
fun <T> Iterable<T>.lastOrNone(predicate: (T) -> Boolean): Option<T>
leftPadZip Returns a List containing the result of applying some transformation (A?, B) -> C on a zip, excluding all cases where the right value is null.fun <A, B, C> Iterable<A>.leftPadZip(other: Iterable<B>, fab: (A?, B) -> C): List<C>
Returns a ListPairA?,B containing the zipped values of the two lists with null for padding on the left.fun <A, B> Iterable<A>.leftPadZip(other: Iterable<B>): List<Pair<A?, B>>
padZip Returns a ListPairA?,B? containing the zipped values of the two lists with null for padding.fun <A, B> Iterable<A>.padZip(other: Iterable<B>): List<Pair<A?, B?>>
Returns a List containing the result of applying some transformation (A?, B?) -> C on a zip.fun <A, B, C> Iterable<A>.padZip(other: Iterable<B>, fa: (A?, B?) -> C): List<C>
reduceOrNull fun <A, B> Iterable<A>.reduceOrNull(initial: (A) -> B, operation: (acc: B, A) -> B): B?
replicate fun <A> Iterable<A>.replicate(n: Int): List<List<A>>
fun <A> Iterable<A>.replicate(n: Int, MA: Monoid<A>): List<A>
rightPadZip Returns a List containing the result of applying some transformation (A, B?) -> C on a zip, excluding all cases where the left value is null.fun <A, B, C> Iterable<A>.rightPadZip(other: Iterable<B>, fa: (A, B?) -> C): List<C>
Returns a ListPairA,B? containing the zipped values of the two lists with null for padding on the right.fun <A, B> Iterable<A>.rightPadZip(other: Iterable<B>): List<Pair<A, B?>>
salign aligns two structures and combine them with the given Semigroup.combinefun <A> Iterable<A>.salign(SG: Semigroup<A>, other: Iterable<A>): Iterable<A>
separateEither Separate the inner Either values into the Either.Left and Either.Right.fun <A, B> Iterable<Either<A, B>>.separateEither(): Pair<List<A>, List<B>>
separateValidated Separate the inner Validated values into the Validated.Invalid and Validated.Valid.fun <A, B> Iterable<Validated<A, B>>.separateValidated(): Pair<List<A>, List<B>>
sequenceEither fun <E, A> Iterable<Either<E, A>>.sequenceEither(): Either<E, List<A>>
sequenceValidated fun <E, A> Iterable<Validated<E, A>>.sequenceValidated(semigroup: Semigroup<E>): Validated<E, List<A>>
fun <E, A> Iterable<ValidatedNel<E, A>>.sequenceValidated(): ValidatedNel<E, List<A>>
singleOrNone fun <T> Iterable<T>.singleOrNone(): Option<T>
fun <T> Iterable<T>.singleOrNone(predicate: (T) -> Boolean): Option<T>
split attempt to split the computation, giving access to the first result.fun <A> Iterable<A>.split(): Pair<List<A>, A>?
tail fun <A> Iterable<A>.tail(): List<A>
traverseEither fun <E, A, B> Iterable<A>.traverseEither(f: (A) -> Either<E, B>): Either<E, List<B>>
traverseValidated fun <E, A, B> Iterable<A>.traverseValidated(semigroup: Semigroup<E>, f: (A) -> Validated<E, B>): Validated<E, List<B>>
fun <E, A, B> Iterable<A>.traverseValidated(f: (A) -> ValidatedNel<E, B>): ValidatedNel<E, List<B>>
unalign splits a union into its component parts.fun <A, B> Iterable<Ior<A, B>>.unalign(): Pair<List<A>, List<B>>
after applying the given function, splits the resulting union shaped structure into its components partsfun <A, B, C> Iterable<C>.unalign(fa: (C) -> Ior<A, B>): Pair<List<A>, List<B>>
uniteEither fun <A, B> Iterable<Either<A, B>>.uniteEither(): List<B>
uniteValidated fun <A, B> Iterable<Validated<A, B>>.uniteValidated(): List<B>
unweave Fair conjunction. Similarly to interleavefun <A, B> Iterable<A>.unweave(ffa: (A) -> Iterable<B>): List<B>
unzip unzips the structure holding the resulting elements in an Pairfun <A, B> Iterable<Pair<A, B>>.unzip(): Pair<List<A>, List<B>>
after applying the given function unzip the resulting structure into its elements.fun <A, B, C> Iterable<C>.unzip(fc: (C) -> Pair<A, B>): Pair<List<A>, List<B>>
void fun <A> Iterable<A>.void(): List<Unit>
widen Given A is a sub type of B, re-type this value from Iterable to Iterablefun <B, A : B> Iterable<A>.widen(): Iterable<B>
zip fun <B, C, D, E> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, transform: (B, C, D) -> E): List<E>
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>
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>
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>
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>
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>
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>
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>

Do you like Arrow?

Arrow Org
<