Skip to content

Commit ec78e55

Browse files
committed
Merge pull request #134 from javafp/f-effect0-bug
Fixed #133 and #135.
2 parents f6aaa48 + 35cdd65 commit ec78e55

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ 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(() -> {
26+
e.f();
27+
return unit();
28+
});
2629
}
2730

2831
/**
@@ -92,7 +95,7 @@ public static <A, B, C, D, E> F5<A, B, C, D, E, Unit> f(Effect5<A, B, C, D, E> z
9295
* @param f The function to map over the effect.
9396
* @return An effect after a contra-variant map.
9497
*/
95-
public final <A, B> Effect1<B> comap(Effect1<A> e1, final F<B, A> f) {
98+
public static final <A, B> Effect1<B> comap(Effect1<A> e1, final F<B, A> f) {
9699
return b -> e1.f(f.f(b));
97100
}
98101

0 commit comments

Comments
 (0)