Package-level declarations
Extensions of built-in types (e.g. Either
, Option
, etc)
Types
Functions
The Validated type doesn't natively support flatMap because of the monad laws that it breaks. But this is what flatMap would do if it were allowed. We've called it concatMap because the Kotlin compiler will want to wire in the Monad flatMap extension instead and confusion reigns.
Performs an effect over the right side of the value but maps the original value back into the Either. This is useful for mixing with validation functions.
Performs an effect over successes but maps the original value back into the Result. This is useful for mixing with validation functions.
Constructs a flattened list without Nones
Applies a function that produces an Option to a NonEmptyList. The result is None if the resulting list would be empty, otherwise Some(NonEmptyList).
Returns a list containing only the non-None results of applying the given transform function to each element in the original collection.
Returns the first successful either, otherwise the last failure
Returns this
if it's a Some, otherwise returns the other
instance
Map a function that returns an Either across the NonEmptyList.
Map a function that returns an Option across the NonEmptyList.
Map a function that returns an Either across the Option.
Map a function that returns an Iterable across the Option.
Returns an Either of a list of B results of applying the given transform function to each element(A) in the original collection.
Returns an Option of a list of B results of applying the given transform function to each element(A) in the original collection.
Map a function that returns an Either over all the values in the Map. If the function returns a Right, the value is added to the resulting Map. If the function returns a Left, the result is the Left.
Map a function that returns an Option over all the values in the Map. If the function returns a Some, the value is added to the resulting Map. If the function returns a None, the result is None.
Map a function that returns an Either across the Sequence.
Map a function that returns an Option across the Sequence.
Synonym for traverse((A)-> Either
Synonym for traverse((T)-> Either
Synonym for traverse((A)-> Either
Synonym for traverse((A)-> Either
Synonym for traverse((A)-> Option): Option
Synonym for traverse((A)-> Option): Option
Synonym for traverse((A)-> Option): Option>
Synonym for traverse((A)-> Option): Option
Map right to Unit. This restores .void()
which was deprecated by Arrow.
Map some to Unit. This restores .void()
which was deprecated by Arrow.
Map success to Unit, included for consistency with Either.
Given a mapping function and an error message, return either the result of the function in a ValidNel if the function completes successfully, or the error message in an InvalidNel.
Retry a suspended supplier of an ErrorOr until a maximum number of times or a predicate has been fulfilled.
Retry a suspended supplier until a maximum number of times or a predicate has been fulfilled.