Skip to content

Commit 38fe3f7

Browse files
committed
Effect#effect allows function input to be contravariant
1 parent 3b11003 commit 38fe3f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • src/main/java/com/jnape/palatable/lambda/functions

src/main/java/com/jnape/palatable/lambda/functions/Effect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import java.util.function.Consumer;
88
import java.util.function.Function;
99

10-
import static com.jnape.palatable.lambda.io.IO.io;
1110
import static com.jnape.palatable.lambda.functions.builtin.fn1.Constantly.constantly;
11+
import static com.jnape.palatable.lambda.io.IO.io;
1212

1313
/**
1414
* A function returning "no result", and therefore only useful as a side-effect.
@@ -78,7 +78,7 @@ static Effect<Unit> effect(Runnable runnable) {
7878
* @param <A> the effect argument type
7979
* @return the effect
8080
*/
81-
static <A> Effect<A> effect(Fn1<A, ? extends IO<?>> fn) {
81+
static <A> Effect<A> effect(Fn1<? super A, ? extends IO<?>> fn) {
8282
return a -> fn.apply(a).unsafePerformIO();
8383
}
8484
}

0 commit comments

Comments
 (0)