Package-level declarations

Types

Link copied to clipboard
value class AtomicMemoizationCache<K, V>(cache: Atomic<Map<K, V>> = Atomic(emptyMap())) : MemoizationCache<K, V>
Link copied to clipboard
value class ConcurrentMapMemoizationCache<K, V>(cache: ConcurrentMap<K, V> = ConcurrentHashMap()) : MemoizationCache<K, V>
Link copied to clipboard
sealed class Either<out A, out B>
Link copied to clipboard
typealias EitherNel<E, A> = Either<NonEmptyList<E>, A>
Link copied to clipboard
object EmptyValue

This is a work-around for having nested nulls in generic code. This allows for writing faster generic code instead of using Option. This is only used as an optimisation technique in low-level code, always prefer to use Option in actual business code when needed in generic code.

Link copied to clipboard
sealed class Ior<out A, out B>

Port of https://github.com/typelevel/cats/blob/v0.9.0/core/src/main/scala/cats/data/Ior.scala

Link copied to clipboard
typealias IorNel<A, B> = Ior<Nel<A>, B>
Link copied to clipboard
interface MemoizationCache<K, V>
Link copied to clipboard
typealias Nel<A> = NonEmptyList<A>
Link copied to clipboard
object None : Option<Nothing>
Link copied to clipboard
interface NonEmptyCollection<out E> : Collection<E>

Common interface for collections that always have at least one element (available from head).

Link copied to clipboard

NonEmptyList is a data type used in Λrrow to model ordered lists that guarantee to have at least one value.

Link copied to clipboard
value class NonEmptySet<out E> : Set<E> , NonEmptyCollection<E>
Link copied to clipboard
sealed class Option<out A>
Link copied to clipboard
typealias Predicate<T> = (T) -> Boolean
Link copied to clipboard
data class Some<out T>(val value: T) : Option<T>
Link copied to clipboard
data class Tuple4<out A, out B, out C, out D>(val first: A, val second: B, val third: C, val fourth: D)
Link copied to clipboard
data class Tuple5<out A, out B, out C, out D, out E>(val first: A, val second: B, val third: C, val fourth: D, val fifth: E)
Link copied to clipboard
data class Tuple6<out A, out B, out C, out D, out E, out F>(val first: A, val second: B, val third: C, val fourth: D, val fifth: E, val sixth: F)
Link copied to clipboard
data class Tuple7<out A, out B, out C, out D, out E, out F, out G>(val first: A, val second: B, val third: C, val fourth: D, val fifth: E, val sixth: F, val seventh: G)
Link copied to clipboard
data class Tuple8<out A, out B, out C, out D, out E, out F, out G, out H>(val first: A, val second: B, val third: C, val fourth: D, val fifth: E, val sixth: F, val seventh: G, val eighth: H)
Link copied to clipboard
data class Tuple9<out A, out B, out C, out D, out E, out F, out G, out H, out I>(val first: A, val second: B, val third: C, val fourth: D, val fifth: E, val sixth: F, val seventh: G, val eighth: H, val ninth: I)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val NicheAPI: String
Link copied to clipboard
const val RedundantAPI: String

Functions

Link copied to clipboard
fun <A, B> Iterable<A>.align(b: Iterable<B>): List<Ior<A, B>>
fun <K, A, B> Map<K, A>.align(b: Map<K, B>): Map<K, Ior<A, B>>

Combines two structures by taking the union of their shapes and using Ior to hold the elements.

fun <A, B> Sequence<A>.align(seqB: Sequence<B>): Sequence<Ior<A, B>>
fun <A, B, C> Sequence<A>.align(seqB: Sequence<B>, fa: (Ior<A, B>) -> C): Sequence<C>

Combines two Sequence by returning Ior.Both when both Sequence have an item, Ior.Left when only the first Sequence has an item, and Ior.Right when only the second Sequence has an item.

inline fun <A, B, C> Iterable<A>.align(b: Iterable<B>, fa: (Ior<A, B>) -> C): List<C>
fun <K, A, B, C> Map<K, A>.align(b: Map<K, B>, fa: (Map.Entry<K, Ior<A, B>>) -> C): Map<K, C>

Combines two structures by taking the union of their shapes and combining the elements with the given function.

Link copied to clipboard
fun <A, B> Pair<A, B>.bothIor(): Ior<A, B>
Link copied to clipboard
inline fun <E, T : Throwable, A> Either<Throwable, A>.catch(catch: Raise<E>.(T) -> A): Either<E, A>

Variant of Either.catchOrThrow constructor that allows for working with Either<Throwable, A> by transforming or recovering from Throwable as T in the Either.Left side. This API is the same as recover. This is useful when working with results of Either.catch since this API offers a reified variant.

Link copied to clipboard
Link copied to clipboard
inline fun <A> Option<A>.combine(other: Option<A>, combine: (A, A) -> A): Option<A>
inline fun <A, B> Ior<A, B>.combine(other: Ior<A, B>, combineA: (A, A) -> A, combineB: (B, B) -> B): Ior<A, B>

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

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

inline 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).

Link copied to clipboard
operator fun <A : Comparable<A>, B : Comparable<B>> Either<A, B>.compareTo(other: Either<A, B>): Int
operator fun <A : Comparable<A>, B : Comparable<B>> Ior<A, B>.compareTo(other: Ior<A, B>): Int
operator fun <E : Comparable<E>> NonEmptyList<E>.compareTo(other: NonEmptyList<E>): Int
operator fun <A : Comparable<A>> Option<A>.compareTo(other: Option<A>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>> Tuple4<A, B, C, D>.compareTo(other: Tuple4<A, B, C, D>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>, E : Comparable<E>> Tuple5<A, B, C, D, E>.compareTo(other: Tuple5<A, B, C, D, E>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>, E : Comparable<E>, F : Comparable<F>> Tuple6<A, B, C, D, E, F>.compareTo(other: Tuple6<A, B, C, D, E, F>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>, E : Comparable<E>, F : Comparable<F>, G : Comparable<G>> Tuple7<A, B, C, D, E, F, G>.compareTo(other: Tuple7<A, B, C, D, E, F, G>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>, E : Comparable<E>, F : Comparable<F>, G : Comparable<G>, H : Comparable<H>> Tuple8<A, B, C, D, E, F, G, H>.compareTo(other: Tuple8<A, B, C, D, E, F, G, H>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>, D : Comparable<D>, E : Comparable<E>, F : Comparable<F>, G : Comparable<G>, H : Comparable<H>, I : Comparable<I>> Tuple9<A, B, C, D, E, F, G, H, I>.compareTo(other: Tuple9<A, B, C, D, E, F, G, H, I>): Int
operator fun <A : Comparable<A>, B : Comparable<B>> Pair<A, B>.compareTo(other: Pair<A, B>): Int
operator fun <A : Comparable<A>, B : Comparable<B>, C : Comparable<C>> Triple<A, B, C>.compareTo(other: Triple<A, B, C>): Int
operator fun <A : Comparable<A>> Iterable<A>.compareTo(other: Iterable<A>): Int
Link copied to clipboard
fun <P1, T> constant(t: T): (P1) -> T
Link copied to clipboard
fun <A, B> Iterable<A>.crosswalk(f: (A) -> Iterable<B>): List<List<B>>
fun <A, B> Sequence<A>.crosswalk(f: (A) -> Iterable<B>): List<List<B>>
Link copied to clipboard
fun <A, K, V> Iterable<A>.crosswalkMap(f: (A) -> Map<K, V>): Map<K, List<V>>
Link copied to clipboard
fun <A, B> Iterable<A>.crosswalkNull(f: (A) -> B?): List<B>?
fun <A, B> Sequence<A>.crosswalkNull(f: (A) -> B?): List<B>?
Link copied to clipboard

Returns an element as Some at the given index or None if the index is out of bounds of this iterable.

Link copied to clipboard
Link copied to clipboard
inline fun <B> Option<*>.filterIsInstance(): Option<B>

Returns an Option containing all elements that are instances of specified type parameter B.

inline fun <K, R> Map<K, *>.filterIsInstance(): Map<K, R>

Returns a Map containing all elements that are instances of specified type parameter R.

Link copied to clipboard
fun <K, A> Map<K, Option<A>>.filterOption(): Map<K, A>

Filters out all elements that are None, and unwraps the remaining elements Some values.

Link copied to clipboard

Returns the first element as Some, or None if the iterable is empty.

inline fun <T> Iterable<T>.firstOrNone(predicate: (T) -> Boolean): Option<T>

Returns the first element as Some matching the given predicate, or None if element was not found.

Link copied to clipboard
inline fun <A, B, C> Either<A, B>.flatMap(f: (right: B) -> Either<A, C>): Either<A, C>

Binds the given function across Right, that is, Map, or transform, the right value B of this Either into a new Either with a right value of type C. Returns a new Either with either the original left value of type A or the newly transformed right value of type C.

inline fun <A, B> Result<A>.flatMap(transform: (value: A) -> Result<B>): Result<B>

Compose a transform operation on the success value A into B whilst flattening Result.

inline fun <A, B, D> Ior<A, B>.flatMap(combine: (A, A) -> A, f: (B) -> Ior<A, D>): Ior<A, D>

Binds the given function across Ior.Right.

Link copied to clipboard
fun <K, A, B> Map<K, A>.flatMapValues(f: (Map.Entry<K, A>) -> Map<K, B>): Map<K, B>

Transform every Map.Entry of the original Map using f, only keeping the Map.Entry of the transformed map that match the input Map.Entry.

Link copied to clipboard
fun <A, B> Either<A, Either<A, B>>.flatten(): Either<A, B>
inline fun <A, B> Ior<A, Ior<A, B>>.flatten(combine: (A, A) -> A): Ior<A, B>
Link copied to clipboard
Link copied to clipboard

Flatten an Iterable of Either. Alias for mapOrAccumulate over an Iterable of computed Either. Either returns a List containing all Either.Right values, or a NonEmptyList of all Either.Left values.

@JvmName(name = "flattenNelOrAccumulate")
fun <Error, A> Iterable<EitherNel<Error, A>>.flattenOrAccumulate(): Either<NonEmptyList<Error>, List<A>>

Flatten an Iterable of Either. Alias for mapOrAccumulate over an Iterable of computed Either. Either returns a List containing all Either.Right values, or a NonEmptyList of all EitherNel values.

Flatten an Iterable of Either. Alias for mapOrAccumulate over an Iterable of computed Either. Either returns a List containing all Either.Right values, or Either.Left values accumulated using combine.

@JvmName(name = "flattenNelOrAccumulate")
fun <Error, A> Iterable<EitherNel<Error, A>>.flattenOrAccumulate(combine: (Error, Error) -> Error): Either<Error, List<A>>

Flatten an Iterable of Either. Alias for mapOrAccumulate over an Iterable of computed Either. Either returns a List containing all Either.Right values, or EitherNel values accumulated using combine.

Link copied to clipboard
inline fun <K, A, B> Map<K, A>.fold(initial: B, operation: (acc: B, Map.Entry<K, A>) -> B): B
Link copied to clipboard
fun <A, B, C> SortedMap<A, B>.foldLeft(b: SortedMap<A, C>, f: (SortedMap<A, C>, Map.Entry<A, B>) -> SortedMap<A, C>): SortedMap<A, C>
Link copied to clipboard
infix inline fun <A, B> Either<A, B>.getOrElse(default: (A) -> B): B

Get the right value B of this Either, or compute a default value with the left value A.

inline fun <A, B> Ior<A, B>.getOrElse(default: (A) -> B): B

inline fun <T> Option<T>.getOrElse(default: () -> T): T

Returns the option's value if the option is nonempty, otherwise return the result of evaluating default.

Link copied to clipboard
fun <K, V> Map<K, V>.getOrNone(key: K): Option<V>
Link copied to clipboard
fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>): Either<C, B>

Binds the given function across Left, that is, Map, or transform, the left value A of this Either into a new Either with a left value of type C. Returns a new Either with either the original right value of type B or the newly transformed left value of type C.

inline fun <A, B, D> Ior<A, B>.handleErrorWith(combine: (B, B) -> B, f: (A) -> Ior<D, B>): Ior<D, B>

Binds the given function across Ior.Left.

Link copied to clipboard
inline fun <A> identity(a: A): A
Link copied to clipboard
fun <A> Iterable<A>.interleave(other: Iterable<A>): List<A>

Interleaves the elements of this Iterable with those of other. Elements of this and other are taken in turn, and the resulting list is the concatenation of the interleaved elements. If one Iterable is longer than the other, the remaining elements are appended to the end.

Interleaves the elements of this Sequence with those of other. Elements of this and other are taken in turn, and the resulting list is the concatenation of the interleaved elements. If one Sequence is longer than the other, the remaining elements are appended to the end.

Link copied to clipboard

Returns the last element as Some, or None if the iterable is empty.

inline fun <T> Iterable<T>.lastOrNone(predicate: (T) -> Boolean): Option<T>

Returns the last element as Some matching the given predicate, or None if no such element was found.

Link copied to clipboard
fun <A> A.left(): Either<A, Nothing>
Link copied to clipboard
fun <A> A.leftIor(): Ior<A, Nothing>
Link copied to clipboard
Link copied to clipboard
fun <A, B> Iterable<A>.leftPadZip(other: Iterable<B>): List<Pair<A?, B>>

Returns a List containing the zipped values of the two lists with null for padding on the left.

fun <A, B> Sequence<A>.leftPadZip(other: Sequence<B>): Sequence<Pair<A?, B>>

Returns a Sequence> containing the zipped values of the two sequences with null for padding on the left.

inline fun <A, B, C> Iterable<A>.leftPadZip(other: Iterable<B>, fab: (A?, B) -> C): List<C>

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> Sequence<A>.leftPadZip(other: Sequence<B>, fab: (A?, B) -> C): Sequence<C>

Returns a Sequence containing the result of applying some transformation (A?, B) -> C on a zip, excluding all cases where the right value is null.

Link copied to clipboard
Link copied to clipboard
fun <T : Any> Predicate<T>.mapNullable(): (T?) -> Boolean
Link copied to clipboard
inline fun <K, E, A, B> Map<K, A>.mapOrAccumulate(transform: RaiseAccumulate<E>.(Map.Entry<K, A>) -> B): Either<NonEmptyList<E>, Map<K, B>>
inline fun <Error, E, T> NonEmptyList<E>.mapOrAccumulate(combine: (Error, Error) -> Error, transform: RaiseAccumulate<Error>.(E) -> T): Either<Error, NonEmptyList<T>>
inline fun <Error, E, T> NonEmptySet<E>.mapOrAccumulate(combine: (Error, Error) -> Error, transform: RaiseAccumulate<Error>.(E) -> T): Either<Error, NonEmptySet<T>>
inline fun <K, E, A, B> Map<K, A>.mapOrAccumulate(combine: (E, E) -> E, transform: RaiseAccumulate<E>.(Map.Entry<K, A>) -> B): Either<E, Map<K, B>>
fun <Error, A, B> Sequence<A>.mapOrAccumulate(combine: (Error, Error) -> Error, transform: RaiseAccumulate<Error>.(A) -> B): Either<Error, List<B>>

Returns Either a List containing the results of applying the given transform function to each element in the original collection, or accumulate all the logical errors into a NonEmptyList that were raised while applying the transform function.

inline fun <Error, A, B> Iterable<A>.mapOrAccumulate(combine: (Error, Error) -> Error, transform: RaiseAccumulate<Error>.(A) -> B): Either<Error, List<B>>

Returns Either a List containing the results of applying the given transform function to each element in the original collection, or accumulate all the logical errors that were raised while transforming the collection using the combine function is used to accumulate all the logical errors.

Link copied to clipboard
inline fun <K, A, B> Map<K, A>.mapValuesNotNull(transform: (Map.Entry<K, A>) -> B?): Map<K, B>
Link copied to clipboard
inline fun <K, E, A, B> Map<K, A>.mapValuesOrAccumulate(transform: RaiseAccumulate<E>.(Map.Entry<K, A>) -> B): Either<NonEmptyList<E>, Map<K, B>>
inline fun <K, E, A, B> Map<K, A>.mapValuesOrAccumulate(combine: (E, E) -> E, transform: RaiseAccumulate<E>.(Map.Entry<K, A>) -> B): Either<E, Map<K, B>>
Link copied to clipboard
inline fun <E : Comparable<E>> NonEmptyList<E>.max(): E
Link copied to clipboard
inline fun <E, T : Comparable<T>> NonEmptyList<E>.maxBy(selector: (E) -> T): E
Link copied to clipboard
fun <T, R> MemoizedDeepRecursiveFunction(cache: MemoizationCache<T, R> = AtomicMemoizationCache(), block: suspend DeepRecursiveScope<T, R>.(T) -> R): DeepRecursiveFunction<T, R>

Defines a recursive pure function that:

Link copied to clipboard
fun <A> Either<A, A>.merge(): A

Returns the value from this Right or Left.

Link copied to clipboard
inline fun <E : Comparable<E>> NonEmptyList<E>.min(): E
Link copied to clipboard
inline fun <E, T : Comparable<T>> NonEmptyList<E>.minBy(selector: (E) -> T): E
Link copied to clipboard
@JvmName(name = "nel")
inline fun <E> E.nel(): NonEmptyList<E>
Link copied to clipboard
fun <A> none(): Option<A>
Link copied to clipboard
@JvmName(name = "nonEmptyListOf")
fun <E> nonEmptyListOf(head: E, vararg t: E): NonEmptyList<E>
Link copied to clipboard
fun <E> nonEmptySetOf(first: E, vararg rest: E): NonEmptySet<E>
Link copied to clipboard
expect fun NonFatal(t: Throwable): Boolean

Extractor of non-fatal Throwable. Will not match fatal errors like VirtualMachineError (for example, OutOfMemoryError and StackOverflowError, subclasses of VirtualMachineError), ThreadDeath, LinkageError, InterruptedException. This will also not match CancellationException since that's a fatal exception in Kotlin for cancellation purposes.

actual fun NonFatal(t: Throwable): Boolean
actual fun NonFatal(t: Throwable): Boolean
Link copied to clipboard

Returns the Throwable if NonFatal and throws it otherwise.

Link copied to clipboard
fun <A> Sequence<A>.once(): Sequence<A>
Link copied to clipboard
fun <A, B> Iterable<A>.padZip(other: Iterable<B>): List<Pair<A?, B?>>

Returns a List containing the zipped values of the two lists with null for padding.

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

Align two structures as in zip, but filling in blanks with null.

fun <A, B> Sequence<A>.padZip(other: Sequence<B>): Sequence<Pair<A?, B?>>

Returns a Sequence> containing the zipped values of the two sequences with null for padding.

inline fun <A, B, C> Iterable<A>.padZip(other: Iterable<B>, fa: (A?, B?) -> C): List<C>

Returns a List containing the result of applying some transformation (A?, B?) -> C on a zip.

fun <K, A, B, C> Map<K, A>.padZip(other: Map<K, B>, fa: (K, A?, B?) -> C): Map<K, C>
inline fun <A, B, C> Iterable<A>.padZip(other: Iterable<B>, left: (A) -> C, right: (B) -> C, both: (A, B) -> C): List<C>
inline fun <K, A, B, C> Map<K, A>.padZip(other: Map<K, B>, left: (K, A) -> C, right: (K, B) -> C, both: (K, A, B) -> C): Map<K, C>

fun <A, B, C> Sequence<A>.padZip(other: Sequence<B>, fa: (A?, B?) -> C): Sequence<C>

Returns a Sequence containing the result of applying some transformation (A?, B?) -> C on a zip.

Link copied to clipboard
operator fun <A, B, C, D, E> Tuple4<A, B, C, D>.plus(e: E): Tuple5<A, B, C, D, E>
operator fun <A, B, C, D, E, F> Tuple5<A, B, C, D, E>.plus(f: F): Tuple6<A, B, C, D, E, F>
operator fun <A, B, C, D, E, F, G> Tuple6<A, B, C, D, E, F>.plus(g: G): Tuple7<A, B, C, D, E, F, G>
operator fun <A, B, C, D, E, F, G, H> Tuple7<A, B, C, D, E, F, G>.plus(h: H): Tuple8<A, B, C, D, E, F, G, H>
operator fun <A, B, C, D, E, F, G, H, I> Tuple8<A, B, C, D, E, F, G, H>.plus(i: I): Tuple9<A, B, C, D, E, F, G, H, I>
operator fun <A, B, C> Pair<A, B>.plus(c: C): Triple<A, B, C>
operator fun <A, B, C, D> Triple<A, B, C>.plus(d: D): Tuple4<A, B, C, D>
Link copied to clipboard
infix fun <T> T.prependTo(list: Iterable<T>): List<T>
Link copied to clipboard
inline fun <E, EE, A> Either<E, A>.recover(recover: Raise<EE>.(E) -> A): Either<EE, A>

Recover from any Either.Left if encountered.

inline fun <A> Option<A>.recover(recover: SingletonRaise<None>.() -> A): Option<A>

Recover from any None if encountered.

Link copied to clipboard
inline fun <A, B> Iterable<A>.reduceOrNull(initial: (A) -> B, operation: (acc: B, A) -> B): B?
Link copied to clipboard
inline fun <A, B> List<A>.reduceRightNull(initial: (A) -> B, operation: (A, acc: B) -> B): B?
Link copied to clipboard
fun <A> A.right(): Either<Nothing, A>
Link copied to clipboard
fun <A> A.rightIor(): Ior<Nothing, A>
Link copied to clipboard
fun <A, B> Iterable<A>.rightPadZip(other: Iterable<B>): List<Pair<A, B?>>

Returns a List> containing the zipped values of the two lists with null for padding on the right.

fun <A, B> Sequence<A>.rightPadZip(other: Sequence<B>): Sequence<Pair<A, B?>>

Returns a Sequence> containing the zipped values of the two sequences with null for padding on the right.

inline fun <A, B, C> Iterable<A>.rightPadZip(other: Iterable<B>, fa: (A, B?) -> C): List<C>

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> Sequence<A>.rightPadZip(other: Sequence<B>, fa: (A, B?) -> C): Sequence<C>

Returns a Sequence containing the result of applying some transformation (A, B?) -> C on a zip, excluding all cases where the left value is null.

Link copied to clipboard
fun <K, A> Map<K, A>.salign(other: Map<K, A>, combine: (A, A) -> A): Map<K, A>

fun <A> Sequence<A>.salign(other: Sequence<A>, combine: (A, A) -> A): Sequence<A>

aligns two structures and combine them with the given combine

Link copied to clipboard

Separate the inner Either values into the Either.Left and Either.Right.

inline fun <T, A, B> Iterable<T>.separateEither(f: (T) -> Either<A, B>): Pair<List<A>, List<B>>

Applies a function f to each element and returns a pair of arrays: the first one made of those values returned by f that were wrapped in Either.Left, and the second one made of those wrapped in Either.Right.

Link copied to clipboard
fun <A, B> Iterable<Ior<A, B>>.separateIor(): Pair<List<A>, List<B>>

splits a union into its component parts.

Link copied to clipboard

Returns single element as Some, or None if the iterable is empty or has more than one element.

inline fun <T> Iterable<T>.singleOrNone(predicate: (T) -> Boolean): Option<T>

Returns the single element as Some matching the given predicate, or None if element was not found or more than one element was found.

Link copied to clipboard
fun <A> A.some(): Option<A>
Link copied to clipboard
fun <A : Comparable<A>> sort(a: A, b: A): Pair<A, A>
fun <A : Comparable<A>> sort(a: A, vararg aas: A): List<A>
fun sort(a: Byte, b: Byte): Pair<Byte, Byte>
fun sort(a: Byte, vararg aas: Byte): List<Byte>
fun sort(a: Int, b: Int): Pair<Int, Int>
fun sort(a: Int, vararg aas: Int): List<Int>
fun sort(a: Long, b: Long): Pair<Long, Long>
fun sort(a: Long, vararg aas: Long): List<Long>
fun sort(a: Short, b: Short): Pair<Short, Short>
fun sort(a: Short, vararg aas: Short): List<Short>
fun <A> sort(a: A, b: A, comparator: Comparator<A>): Pair<A, A>
fun <A> sort(a: A, vararg aas: A, comparator: Comparator<A>): List<A>
fun <A : Comparable<A>> sort(a: A, b: A, c: A): Triple<A, A, A>
fun sort(a: Byte, b: Byte, c: Byte): Triple<Byte, Byte, Byte>
fun sort(a: Int, b: Int, c: Int): Triple<Int, Int, Int>
fun sort(a: Long, b: Long, c: Long): Triple<Long, Long, Long>
fun sort(a: Short, b: Short, c: Short): Triple<Short, Short, Short>
fun <A> sort(a: A, b: A, c: A, comparator: Comparator<A>): Triple<A, A, A>
Link copied to clipboard
fun <A> Iterable<A>.split(): Pair<List<A>, A>?

Attempt to split the Iterable into the tail and the first element. Returns null if the Iterable is empty, otherwise returns a Pair of the tail and the first element.

fun <A> Sequence<A>.split(): Pair<Sequence<A>, A>?

attempt to split the computation, giving access to the first result.

Link copied to clipboard
fun <A> Iterable<A>.tail(): List<A>
fun <A> Sequence<A>.tail(): Sequence<A>

Alias for drop(1)

Link copied to clipboard
fun <E, A> Either<E, A>.toEitherNel(): EitherNel<E, A>
Link copied to clipboard
fun <A, B> Ior<A, B>.toIorNel(): IorNel<A, B>

Given an Ior with an error type A, returns an IorNel with the same error type. Wraps the original error in a NonEmptyList so that it can be combined with an IorNel in a Raise DSL which operates on one.

Link copied to clipboard
fun <K, V> Option<Pair<K, V>>.toMap(): Map<K, V>
Link copied to clipboard
@JvmName(name = "toNonEmptyListOrNone")
fun <T> Iterable<T>.toNonEmptyListOrNone(): Option<NonEmptyList<T>>
Link copied to clipboard
@JvmName(name = "toNonEmptyListOrNull")
fun <T> Iterable<T>.toNonEmptyListOrNull(): NonEmptyList<T>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T> T?.toOption(): Option<T>

Run the EagerEffect by returning Option of A, or None if raised with None.

suspend fun <A> Effect<None, A>.toOption(): Option<A>

Run the Effect by returning Option of A, or None if raised with None.

Link copied to clipboard
fun <A, B> Iterable<Ior<A, B>>.unalign(): Pair<List<A?>, List<B?>>

fun <K, A, B> Map<K, Ior<A, B>>.unalign(): Pair<Map<K, A>, Map<K, B>>

Splits a union into its component parts.

splits an union into its component parts.

inline fun <A, B, C> Iterable<C>.unalign(fa: (C) -> Ior<A, B>): Pair<List<A?>, List<B?>>
inline fun <K, A, B, C> Map<K, C>.unalign(fa: (Map.Entry<K, C>) -> Ior<A, B>): Pair<Map<K, A>, Map<K, B>>
fun <A, B, C> Sequence<C>.unalign(fa: (C) -> Ior<A, B>): Pair<Sequence<A>, Sequence<B>>

after applying the given function, splits the resulting union shaped structure into its components parts

Link copied to clipboard
fun <A, B> Iterable<A>.unweave(ffa: (A) -> Iterable<B>): List<B>

interleaves the elements produced by applying ffa to every element of this Iterable.

fun <A, B> Sequence<A>.unweave(ffa: (A) -> Sequence<B>): Sequence<B>

Fair conjunction. Similarly to interleave

Link copied to clipboard
inline fun <A, B, E> NonEmptyList<E>.unzip(f: (E) -> Pair<A, B>): Pair<NonEmptyList<A>, NonEmptyList<B>>

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

Unzips the structure holding the resulting elements in an Pair

unzips the structure holding the resulting elements in an Pair

inline fun <K, A, B, C> Map<K, C>.unzip(fc: (Map.Entry<K, C>) -> Pair<A, B>): Pair<Map<K, A>, Map<K, B>>

After applying the given function unzip the resulting structure into its elements.

fun <A, B, C> Sequence<C>.unzip(fc: (C) -> Pair<A, B>): Pair<Sequence<A>, Sequence<B>>

after applying the given function unzip the resulting structure into its elements.

Link copied to clipboard
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.

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.

inline fun <B, C, D, E> Iterable<B>.zip(c: Iterable<C>, d: Iterable<D>, transform: (B, C, D) -> E): List<E>
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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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, 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