Package-level declarations
Types
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.
Common interface for collections that always have at least one element (available from head).
NonEmptyList
is a data type used in Λrrow to model ordered lists that guarantee to have at least one value.
Functions
Combines two structures by taking the union of their shapes and using Ior to hold the elements.
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.
Combines two structures by taking the union of their shapes and combining the elements with the given function.
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.
Combines two maps using combine to combine values for the same key.
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).
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.
Binds the given function across Ior.Right.
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.
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.
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.
Returns the option's value if the option is nonempty, otherwise return the result of evaluating default
.
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.
Binds the given function across Ior.Left.
Returns a List containing the zipped values of the two lists with null for padding on the left.
Returns a Sequence
Returns a List(A?, B) -> C
on a zip, excluding all cases where the right value is null.
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.
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.
Defines a recursive pure function that:
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.
Returns the Throwable if NonFatal and throws it otherwise.
Returns a List containing the zipped values of the two lists with null for padding.
Align two structures as in zip, but filling in blanks with null.
Returns a List containing the result of applying some transformation (A?, B?) -> C
on a zip.
Returns a Sequence containing the result of applying some transformation (A?, B?) -> C
on a zip.
Returns a Sequence
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.
Returns a Sequence(A, B?) -> C
on a zip, excluding all cases where the left value is null.
Separate the inner Either values into the Either.Left and Either.Right.
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.
Unzips the structure holding the resulting elements in an Pair
unzips the structure holding the resulting elements in an Pair
After applying the given function unzip the resulting structure into its elements.
after applying the given function unzip the resulting structure into its elements.
Combines to structures by taking the intersection of their shapes and using Pair
to hold the elements.
Combines to structures by taking the intersection of their shapes and combining the elements with the given function.
Adds kotlin.sequences.zip support for 3 parameters
Adds kotlin.sequences.zip support for 4 parameters
Adds kotlin.sequences.zip support for 5 parameters
Adds kotlin.sequences.zip support for 6 parameters
Adds kotlin.sequences.zip support for 7 parameters
Adds kotlin.sequences.zip support for 8 parameters
Adds kotlin.sequences.zip support for 9 parameters
Adds kotlin.sequences.zip support for 10 parameters