//arrow-core/arrow.core/Eval/Always

Always

common data class Always<out A>(f: () -> A) : Eval<A>

Construct a lazy Eval instance.

This type can be used for “lazy” values. In some sense it is equivalent to using a Function0 value.

This type will evaluate the computation every time the value is required. It should be avoided except when laziness is required and caching must be avoided. Generally, prefer Later.

Constructors

   
Always common fun <out A> Always(f: () -> A)

Functions

Name Summary
coflatMap common inline fun <B> coflatMap(crossinline f: (Eval<A>) -> B): Eval<B>
flatMap common fun <B> flatMap(f: (A) -> Eval<B>): Eval<B>
map common inline fun <B> map(crossinline f: (A) -> B): Eval<B>
memoize common open override fun memoize(): Eval<A>
toString common open override fun toString(): String
value common open override fun value(): A

Do you like Arrow?

Arrow Org
<