Package fj.control
Class Trampoline.Codense<A>
- java.lang.Object
-
- fj.control.Trampoline<A>
-
- fj.control.Trampoline.Codense<A>
-
- Enclosing class:
- Trampoline<A>
private static final class Trampoline.Codense<A> extends Trampoline<A>
-
-
Field Summary
Fields Modifier and Type Field Description private F<java.lang.Object,Trampoline<A>>contprivate Trampoline.Normal<java.lang.Object>sub
-
Constructor Summary
Constructors Modifier Constructor Description privateCodense(Trampoline.Normal<java.lang.Object> t, F<java.lang.Object,Trampoline<A>> k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <B> Trampoline<B>bind(F<A,Trampoline<B>> f)Binds the given continuation to the result of this trampoline.<R> Rfold(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 Detail
-
sub
private final Trampoline.Normal<java.lang.Object> sub
-
cont
private final F<java.lang.Object,Trampoline<A>> cont
-
-
Constructor Detail
-
Codense
private Codense(Trampoline.Normal<java.lang.Object> t, F<java.lang.Object,Trampoline<A>> k)
-
-
Method Detail
-
fold
public <R> R fold(F<Trampoline.Normal<A>,R> n, F<Trampoline.Codense<A>,R> gs)
- Specified by:
foldin classTrampoline<A>
-
bind
public <B> Trampoline<B> bind(F<A,Trampoline<B>> f)
Description copied from class:TrampolineBinds the given continuation to the result of this trampoline.- Specified by:
bindin 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
public Either<P1<Trampoline<A>>,A> resume()
Description copied from class:TrampolineRuns a single step of this computation.- Specified by:
resumein classTrampoline<A>- Returns:
- The next step of this compuation.
-
-