Skip to content

Commit 7a34dec

Browse files
committed
Replace P1 by F0 in method arguments of various API
whenever it safe to do so without breaking source compatibility. This should improve overall support for java8 lambda syntax.
1 parent e23bddd commit 7a34dec

39 files changed

+272
-520
lines changed

core/src/main/java/fj/Effect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Effect {
2222
private Effect() {}
2323

2424
public static P1<Unit> f(Effect0 e) {
25-
return P.lazy(u -> unit());
25+
return P.lazy(() -> unit());
2626
}
2727

2828
/**

core/src/main/java/fj/F1Functions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static public <A, B, C> F<F<B, F<B, C>>, F<A, F<A, C>>> on(final F<A, B> f) {
128128
* @return This function promoted to return its result in a product-1.
129129
*/
130130
static public <A, B> F<A, P1<B>> lazy(final F<A, B> f) {
131-
return a -> P.lazy(u -> f.f(a));
131+
return a -> P.lazy(() -> f.f(a));
132132
}
133133

134134
/**
@@ -138,7 +138,7 @@ static public <A, B> F<A, P1<B>> lazy(final F<A, B> f) {
138138
* @return The function partially applied to the given argument to return a lazy value.
139139
*/
140140
static public <A, B> P1<B> f(final F<A, B> f, final A a) {
141-
return P.lazy(u -> f.f(a));
141+
return P.lazy(() -> f.f(a));
142142
}
143143

144144
/**

0 commit comments

Comments
 (0)