Skip to content

Commit a24b159

Browse files
committed
Formatting changes.
1 parent 6c21646 commit a24b159

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

core/src/main/java/fj/control/Trampoline.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public Trampoline<A> f(final A a) {
149149

150150
/**
151151
* Constructs a leaf computation that results in the given value.
152+
*
152153
* @param a The value of the result.
153154
* @return A trampoline that results in the given value.
154155
*/
@@ -158,6 +159,7 @@ public static <A> Trampoline<A> pure(final A a) {
158159

159160
/**
160161
* Suspends the given computation in a thunk.
162+
*
161163
* @param a A trampoline suspended in a thunk.
162164
* @return A trampoline whose next step runs the given thunk.
163165
*/
@@ -180,13 +182,15 @@ public Trampoline<A> f(final P1<Trampoline<A>> trampolineP1) {
180182

181183
/**
182184
* Binds the given continuation to the result of this trampoline.
185+
*
183186
* @param f A function that constructs a trampoline from the result of this trampoline.
184187
* @return A new trampoline that runs this trampoline, then continues with the given function.
185188
*/
186189
public abstract <B> Trampoline<B> bind(final F<A, Trampoline<B>> f);
187190

188191
/**
189192
* Maps the given function across the result of this trampoline. Monadic bind.
193+
*
190194
* @param f A function that gets applied to the result of this trampoline.
191195
* @return A new trampoline that runs this trampoline, then applies the given function to the result.
192196
*/
@@ -237,23 +241,25 @@ public Either<P1<Trampoline<A>>, A> f(final Trampoline<A> aTrampoline) {
237241

238242
/**
239243
* Runs a single step of this computation.
244+
*
240245
* @return The next step of this compuation.
241246
*/
242247
public abstract Either<P1<Trampoline<A>>, A> resume();
243248

244249
/**
245250
* Runs this computation all the way to the end, in constant stack.
251+
*
246252
* @return The end result of this computation.
247253
*/
248254
@SuppressWarnings("LoopStatementThatDoesntLoop")
249255
public A run() {
250256
Trampoline<A> current = this;
251257
while (true) {
252258
final Either<P1<Trampoline<A>>, A> x = current.resume();
253-
for (final P1<Trampoline<A>> t: x.left()) {
259+
for (final P1<Trampoline<A>> t : x.left()) {
254260
current = t._1();
255261
}
256-
for (final A a: x.right()) {
262+
for (final A a : x.right()) {
257263
return a;
258264
}
259265
}
@@ -272,7 +278,7 @@ public Trampoline<B> f(final F<A, B> f) {
272278
}
273279
});
274280
}
275-
281+
276282
/**
277283
* Binds the given function across the result of this Trampoline and the given Trampoline.
278284
*
@@ -283,7 +289,7 @@ public Trampoline<B> f(final F<A, B> f) {
283289
public final <B, C> Trampoline<C> bind(final Trampoline<B> lb, final F<A, F<B, C>> f) {
284290
return lb.apply(map(f));
285291
}
286-
292+
287293

288294
/**
289295
* Promotes the given function of arity-2 to a function on Trampolines.
@@ -298,6 +304,6 @@ public Trampoline<C> f(final Trampoline<A> as, final Trampoline<B> bs) {
298304
}
299305
});
300306
}
301-
307+
302308

303309
}

0 commit comments

Comments
 (0)