Package fj.data
Class Eval.TrampolineEval<A>
java.lang.Object
fj.data.Eval<A>
fj.data.Eval.TrampolineEval<A>
- Direct Known Subclasses:
Eval.BindTrampolineEval
,Eval.DeferEval
,Eval.PureTrampolineEval
A helper abstraction that allows to perform recursive lazy transformations in O(1) stack space.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final Eval.TrampolineEval
<A> Transforms the current instance into a trampoline instance.protected abstract Trampoline
<A> final A
value()
Evaluates the computation and return its result.
-
Constructor Details
-
TrampolineEval
private TrampolineEval()
-
-
Method Details
-
trampoline
-
value
Description copied from class:Eval
Evaluates the computation and return its result. Depending on whether the current instance is lazy or eager the computation may or may not happen at this point. -
asTrampoline
Description copied from class:Eval
Transforms the current instance into a trampoline instance.- Specified by:
asTrampoline
in classEval<A>
-