//arrow-core/arrow.core/Eval/Later

Later

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

Construct a lazy Eval instance.

This type should be used for most “lazy” values. In some sense it is equivalent to using a lazy val.

When caching is not required or desired (e.g. if the value produced may be large) prefer Always. When there is no computation necessary, prefer Now.

Once Later has been evaluated, the closure (and any values captured by the closure) will not be retained, and will be available for garbage collection.

Constructors

   
Later common fun <out A> Later(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

Properties

Name Summary
value common val value: A

Do you like Arrow?

Arrow Org
<