Package fj.control
Class Trampoline.Codense<A>
java.lang.Object
fj.control.Trampoline<A>
fj.control.Trampoline.Codense<A>
- Enclosing class:
Trampoline<A>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final F
<Object, Trampoline<A>> private final Trampoline.Normal
<Object> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Codense
(Trampoline.Normal<Object> t, F<Object, Trampoline<A>> k) -
Method Summary
Modifier and TypeMethodDescription<B> Trampoline
<B> bind
(F<A, Trampoline<B>> f) Binds the given continuation to the result of this trampoline.<R> R
fold
(F<Trampoline.Normal<A>, R> n, F<Trampoline.Codense<A>, R> gs) Either
<P1<Trampoline<A>>, A> resume()
Runs a single step of this computation.
-
Field Details
-
sub
-
cont
-
-
Constructor Details
-
Codense
-
-
Method Details
-
fold
- Specified by:
fold
in classTrampoline<A>
-
bind
Description copied from class:Trampoline
Binds the given continuation to the result of this trampoline.- Specified by:
bind
in classTrampoline<A>
- Parameters:
f
- A function that constructs a trampoline from the result of this trampoline.- Returns:
- A new trampoline that runs this trampoline, then continues with the given function.
-
resume
Description copied from class:Trampoline
Runs a single step of this computation.- Specified by:
resume
in classTrampoline<A>
- Returns:
- The next step of this compuation.
-