arrow-core-data / arrow.core / Function0

Function0

@higherkind data class Function0<out A> : Function0Of<A>

Constructors

<init> Function0(f: () -> A)

Functions

ap fun <B> ap(ff: Function0Of<(A) -> B>): () -> B
coflatMap fun <B> coflatMap(f: (Function0Of<A>) -> B): () -> B
extract fun extract(): A
flatMap fun <B> flatMap(ff: (A) -> Function0Of<B>): () -> B
map fun <B> map(f: (A) -> B): () -> B

Companion Object Functions

just fun <A> just(a: A): () -> A
loop tailrec fun <A, B> loop(a: A, f: (A) -> Kind<ForFunction0, Either<A, B>>): B
tailRecM fun <A, B> tailRecM(a: A, f: (A) -> Kind<ForFunction0, Either<A, B>>): () -> B

Extension Functions

altFold fun <T, F, A> Kind<T, A>.altFold(AF: Alternative<F>, FT: Foldable<T>): Kind<F, A>
altSum fun <T, F, A> Kind<T, Kind<F, A>>.altSum(AF: Alternative<F>, FT: Foldable<T>): Kind<F, A>
invoke operator fun <A> Function0Of<A>.invoke(): A
select fun <A, B> (() -> Either<A, B>).select(f: Function0Of<(A) -> B>): () -> B

Do you like Arrow?

Arrow Org
<