final class Later[A] extends Leaf[A]
Construct a lazy Eval[A] 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.
- Source
- Eval.scala
- Alphabetic
- By Inheritance
- Later
- Leaf
- Eval
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Later(f: () => A)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap[B](f: (A) => Eval[B]): Eval[B]
Lazily perform a computation based on an Eval[A], using the function
f
to produce an Eval[B] given an A.Lazily perform a computation based on an Eval[A], using the function
f
to produce an Eval[B] given an A.This call is stack-safe -- many .flatMap calls may be chained without consumed additional stack during evaluation. It is also written to avoid left-association problems, so that repeated calls to .flatMap will be efficiently applied.
Computation performed in f is always lazy, even when called on an eager (Now) instance.
- Definition Classes
- Eval
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B): Eval[B]
Transform an Eval[A] into an Eval[B] given the transformation function
f
.Transform an Eval[A] into an Eval[B] given the transformation function
f
.This call is stack-safe -- many .map calls may be chained without consumed additional stack during evaluation.
Computation performed in f is always lazy, even when called on an eager (Now) instance.
- Definition Classes
- Eval
- def memoize: Eval[A]
Ensure that the result of the computation (if any) will be memoized.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- lazy val value: A
Evaluate the computation and return an A value.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()