arrow-core-data / arrow.core

Package arrow.core

Types

AndThen AndThen wraps a function of shape (A) -> B and can be used to do function composition. It’s similar to arrow.core.andThen and arrow.core.compose and can be used to build stack safe data structures that make use of lambdas. Usage is typically used for signature such as A -> Kind<F, A> where F has a arrow.typeclasses.Monad instance i.e. StateT.flatMap.sealed class AndThen<A, B> : (A) -> B
Const data class Const<A, out T>
Either sealed class Either<out A, out B>
Endo The monoid of endomorphisms under composition.data class Endo<A>
Eval Eval is a monad which controls evaluation of a value or a computation that produces a value.sealed class Eval<out A>
Failure typealias Failure = Failure
Function0 data class Function0<out A>
Function1 class Function1<I, out O>
FunctionK interface FunctionK<F, G>
Id The identity monad can be seen as the ambient monad that encodes the effect of having no effect. It is ambient in the sense that plain pure values are values of Id.data class Id<out A>
Invalid typealias Invalid<E> = Invalid<E>
Ior Port of https://github.com/typelevel/cats/blob/v0.9.0/core/src/main/scala/cats/data/Ior.scalasealed class Ior<out A, out B>
IorNel typealias IorNel<A, B> = Ior<Nel<A>, B>
ListExtensions object ListExtensions
ListK data class ListK<out A> : List<A>
MapInstances object MapInstances
MapK data class MapK<K, out A> : Map<K, A>
Nel typealias Nel<A> = NonEmptyList<A>
None object None : Option<Nothing>
NonEmptyList class NonEmptyList<out A>
Option sealed class Option<out A>
Predicate typealias Predicate<T> = (T) -> Boolean
SequenceK data class SequenceK<out A> : Sequence<A>
SetExtensions object SetExtensions
SetK data class SetK<out A> : Set<A>
Some data class Some<out T> : Option<T>
SortedMap typealias SortedMap<K, V> = SortedMap<K, V>
SortedMapInstances object SortedMapInstances
SortedMapK data class SortedMapK<A : Comparable<A>, B> : SortedMap<A, B>
SortedSetInstances object SortedSetInstances
Success typealias Success<A> = Success<A>
Try sealed class ~~Try~~<out A>
Tuple10 data class Tuple10<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J>
Tuple11 data class Tuple11<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K>
Tuple12 data class Tuple12<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L>
Tuple13 data class Tuple13<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M>
Tuple14 data class Tuple14<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N>
Tuple15 data class Tuple15<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O>
Tuple16 data class Tuple16<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P>
Tuple17 data class Tuple17<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q>
Tuple18 data class Tuple18<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q, out R>
Tuple19 data class Tuple19<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q, out R, out S>
Tuple2 data class Tuple2<out A, out B>
Tuple20 data class Tuple20<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q, out R, out S, out T>
Tuple21 data class Tuple21<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q, out R, out S, out T, out U>
Tuple22 data class Tuple22<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J, out K, out L, out M, out N, out O, out P, out Q, out R, out S, out T, out U, out V>
Tuple3 data class Tuple3<out A, out B, out C>
Tuple4 data class Tuple4<out A, out B, out C, out D>
Tuple5 data class Tuple5<out A, out B, out C, out D, out E>
Tuple6 data class Tuple6<out A, out B, out C, out D, out E, out F>
Tuple7 data class Tuple7<out A, out B, out C, out D, out E, out F, out G>
Tuple8 data class Tuple8<out A, out B, out C, out D, out E, out F, out G, out H>
Tuple9 data class Tuple9<out A, out B, out C, out D, out E, out F, out G, out H, out I>
Valid typealias Valid<A> = Valid<A>
Validated sealed class Validated<out E, out A>
ValidatedNel typealias ValidatedNel<E, A> = Validated<Nel<E>, A>

Exceptions

TryException sealed class TryException : Exception

Extensions for External Classes

java.util.SortedMap  
kotlin.Any  
kotlin.Array  
kotlin.Boolean  
kotlin.collections.Iterable  
kotlin.collections.Iterator  
kotlin.collections.List  
kotlin.collections.Map  
kotlin.collections.Map.Entry  
kotlin.collections.Set  
kotlin.Function0  
kotlin.Function1  
kotlin.Function2  
kotlin.Pair  
kotlin.sequences.Sequence  
kotlin.Throwable  
kotlin.Triple  

Properties

DeprecatedAmbiguity const val DeprecatedAmbiguity: String
DeprecatedUnsafeAccess const val DeprecatedUnsafeAccess: String

Functions

ap fun <A, T, U> <ERROR CLASS><A, T>.ap(SG: Semigroup<A>, ff: <ERROR CLASS><A, (T) -> U>): Const<A, U>
fun <A, B, C> <ERROR CLASS><A, B>.ap(ff: <ERROR CLASS><A, (B) -> C>): Either<A, C>
fun <A, B, D> Ior<A, B>.ap(SG: Semigroup<A>, ff: <ERROR CLASS><A, (B) -> D>): Ior<A, D>
From Apply: if both the function and this value are Valid, apply the functionfun <E, A, B> <ERROR CLASS><E, A>.ap(SE: Semigroup<E>, f: Validated<E, (A) -> B>): Validated<E, B>
bothIor fun <A, B> Tuple2<A, B>.bothIor(): Ior<A, B>
combine fun <A, T> <ERROR CLASS><A, T>.combine(SG: Semigroup<A>, that: <ERROR CLASS><A, T>): Const<A, T>
fun <E, A> <ERROR CLASS><E, A>.combine(SE: Semigroup<E>, SA: Semigroup<A>, y: <ERROR CLASS><E, A>): Validated<E, A>
combineK fun <A, B> <ERROR CLASS><A, B>.combineK(y: <ERROR CLASS><A, B>): Either<A, B>
fun <A> <ERROR CLASS><A>.combineK(y: <ERROR CLASS><A>): ListK<A>
fun <E, A> <ERROR CLASS><E, A>.combineK(SE: Semigroup<E>, y: <ERROR CLASS><E, A>): Validated<E, A>
const fun <A> A.const(): Const<A, Nothing>
constant fun <P1, T> constant(t: T): (P1) -> T
contains Returns true if this is a Either.Right and its value is equal to elem (as determined by ==), returns false otherwise.fun <A, B> <ERROR CLASS><A, B>.contains(elem: B): Boolean
filterOrElse Returns Either.Right with the existing value of Either.Right if this is a Either.Right and the given predicate holds for the right value.fun <A, B> <ERROR CLASS><A, B>.filterOrElse(predicate: (B) -> Boolean, default: () -> A): Either<A, B>
filterOrOther Returns Either.Right with the existing value of Either.Right if this is a Either.Right and the given predicate holds for the right value.fun <A, B> <ERROR CLASS><A, B>.filterOrOther(predicate: (B) -> Boolean, default: (B) -> A): Either<A, B>
findValid If this is valid return this, otherwise if that is valid return that, otherwise combine the failures. This is similar to orElse except that here failures are accumulated.fun <E, A> <ERROR CLASS><E, A>.findValid(SE: Semigroup<E>, that: () -> Validated<E, A>): Validated<E, A>
flatMap Binds the given function across Either.Right.fun <A, B, C> <ERROR CLASS><A, B>.flatMap(f: (B) -> Either<A, C>): Either<A, C>
Binds the given function across Ior.Right.fun <A, B, D> Ior<A, B>.flatMap(SG: Semigroup<A>, f: (B) -> Ior<A, D>): Ior<A, D>
flatten fun <T> <ERROR CLASS><<ERROR CLASS><T>>.flatten(): Try<T>
getOrDefault fun <B> <ERROR CLASS><B>.~~getOrDefault~~(default: () -> B): B
getOrElse Returns the value from this Either.Right or the given argument if this is a Either.Left.fun <B> <ERROR CLASS><out <ERROR CLASS>, B>.getOrElse(default: () -> B): Bfun <A, B> Ior<A, B>.getOrElse(default: () -> B): B
fun <B> <ERROR CLASS><B>.~~getOrElse~~(default: (Throwable) -> B): B
Returns the option’s value if the option is nonempty, otherwise return the result of evaluating default.fun <T> Option<T>.getOrElse(default: () -> T): T
Return the Valid value, or the default if Invalidfun <E, B> <ERROR CLASS><E, B>.getOrElse(default: () -> B): B
getOrHandle Returns the value from this Either.Right or allows clients to transform Either.Left to Either.Right while providing access to the value of Either.Left.fun <A, B> <ERROR CLASS><A, B>.getOrHandle(default: (A) -> B): B
handleError fun <B> <ERROR CLASS><B>.~~handleError~~(f: (Throwable) -> B): Try<B>
handleErrorWith Applies the given function f if this is a Left, otherwise returns this if this is a Right. This is like flatMap for the exception.fun <A, B> <ERROR CLASS><A, B>.handleErrorWith(f: (A) -> <ERROR CLASS><A, B>): Either<A, B>fun <B> <ERROR CLASS><B>.~~handleErrorWith~~(f: (Throwable) -> <ERROR CLASS><B>): Try<B>
handleLeftWith fun <E, A> <ERROR CLASS><E, A>.handleLeftWith(f: (E) -> <ERROR CLASS><E, A>): Validated<E, A>
identity fun <A> identity(a: A): A
invalid fun <E> E.invalid(): Validated<E, Nothing>
invalidNel fun <E> E.invalidNel(): ValidatedNel<E, Nothing>
invoke operator fun <A, B> <ERROR CLASS><A, B>.invoke(a: A): B
operator fun <A> <ERROR CLASS><A>.invoke(): A
operator fun <I, O> <ERROR CLASS><I, O>.invoke(i: I): O
k fun <K, A> Option<Tuple2<K, A>>.k(): MapK<K, A>
fun <A : Comparable<A>, B> Option<Tuple2<A, B>>.k(): SortedMapK<A, B>
Left fun <L> Left(left: L): Either<L, Nothing>
left fun <A> A.left(): Either<A, Nothing>
leftIfNull Returns Either.Right with the existing value of Either.Right if this is an Either.Right with a non-null value. The returned Either.Right type is not nullable.fun <A, B> <ERROR CLASS><A, B?>.leftIfNull(default: () -> A): Either<A, B>
leftIor fun <A> A.leftIor(): Ior<A, Nothing>
mapOf fun <K, V> mapOf(vararg tuple: Tuple2<K, V>): MapK<K, V>
fun <K, V> mapOf(pair: Tuple2<K, V>): Map<K, V>
nel fun <A> A.nel(): NonEmptyList<A>
none fun <A> none(): Option<A>
NonFatal Extractor of non-fatal Throwables. Will not match fatal errors like VirtualMachineError (for example, OutOfMemoryError and StackOverflowError, subclasses of VirtualMachineError), ThreadDeath, LinkageError, InterruptedException.fun NonFatal(t: Throwable): Boolean
or infix fun <T> <ERROR CLASS><T>.or(value: Option<T>): Option<T>
orElse Returns this option’s if the option is nonempty, otherwise returns another option provided lazily by default.fun <A> <ERROR CLASS><A>.orElse(alternative: () -> Option<A>): Option<A>fun <B, A : B> <ERROR CLASS><A>.~~orElse~~(f: () -> <ERROR CLASS><B>): Try<B>
Return this if it is Valid, or else fall back to the given default. The functionality is similar to that of findValid except for failure accumulation, where here only the error on the right is preserved and the error on the left is ignored.fun <E, A> <ERROR CLASS><E, A>.orElse(default: () -> Validated<E, A>): Validated<E, A>
orNull Returns the value from this Either.Right or null if this is a Either.Left.fun <B> <ERROR CLASS><out <ERROR CLASS>, B>.orNull(): B?fun <B> <ERROR CLASS><B>.~~orNull~~(): B?
Return the Valid value, or null if Invalidfun <E, B> <ERROR CLASS><E, B>.orNull(): B?
Right fun <R> Right(right: R): Either<Nothing, R>
right fun <A> A.right(): Either<Nothing, A>
rightIfNotNull Returns Either.Right if the value of type B is not null, otherwise the specified A value wrapped into an Either.Left.fun <A, B> B?.rightIfNotNull(default: () -> A): Either<A, B>
rightIor fun <A> A.rightIor(): Ior<Nothing, A>
select fun <A, B> (() -> Either<A, B>).select(f: <ERROR CLASS><(A) -> B>): () -> B
fun <A, B> Id<Either<A, B>>.select(f: <ERROR CLASS><(A) -> B>): Id<B>
fun <A, B> Option<Either<A, B>>.select(f: <ERROR CLASS><(A) -> B>): Option<B>
sequence fun <T, A, G> <ERROR CLASS><A, Kind<G, T>>.sequence(GA: Applicative<G>): Kind<G, Const<A, T>>
fun <A, B, G> <ERROR CLASS><A, Kind<G, B>>.sequence(GA: Applicative<G>): Kind<G, Ior<A, B>>
fun <K, V, G> <ERROR CLASS><K, Kind<G, V>>.sequence(GA: Applicative<G>): Kind<G, MapK<K, V>>
fun <A, G> <ERROR CLASS><Kind<G, A>>.sequence(GA: Applicative<G>): Kind<G, NonEmptyList<A>>
fun <G, E, A> <ERROR CLASS><E, Kind<G, A>>.sequence(GA: Applicative<G>): Kind<G, Validated<E, A>>
some fun <A> A.some(): Option<A>
success fun <A> A.~~success~~(): Try<A>
toIor Converts the value to an Ior<E, A>fun <E, A> <ERROR CLASS><E, A>.toIor(): Ior<E, A>
toOption fun <T> T?.toOption(): Option<T>
toPair fun <A, B> Tuple2<A, B>.toPair(): Pair<A, B>
toT infix fun <A, B> A.toT(b: B): Tuple2<A, B>
toTriple fun <A, B, C> Tuple3<A, B, C>.toTriple(): Triple<A, B, C>
traverse fun <G, E, A, B> <ERROR CLASS><E, A>.traverse(GA: Applicative<G>, f: (A) -> Kind<G, B>): Kind<G, Validated<E, B>>
updated fun <K, A> MapK<K, A>.updated(k: K, value: A): MapK<K, A>
fun <A : Comparable<A>, B> SortedMapK<A, B>.updated(k: A, value: B): SortedMapK<A, B>
valid fun <A> A.valid(): Validated<Nothing, A>
validNel fun <A> A.validNel(): ValidatedNel<Nothing, A>
value fun <A, T> <ERROR CLASS><A, T>.value(): A
fun <A> <ERROR CLASS><A>.value(): A
valueOr Return the Valid value, or the result of f if Invalidfun <E, B> <ERROR CLASS><E, B>.valueOr(f: (E) -> B): B

Type Class Hierarchy