Skip to content

Commit 6825358

Browse files
committed
adding is alias for contramap
1 parent 0cf8f9d commit 6825358

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/main/java/fj/function/Booleans.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ public static <A, B> F<B, Boolean> contramap(F<B, A> f, F<A, Boolean> p){
9494
return compose(p, f);
9595
}
9696

97+
/**
98+
* alias for contramap
99+
* @param p predicate to be mapped over
100+
* @param f function
101+
* @return predicate function
102+
*/
103+
public static <A, B> F<B, Boolean> is(F<B, A> f, F<A, Boolean> p){
104+
return contramap(f, p);
105+
}
106+
97107
/**
98108
* returns inverse of contramap
99109
* @param p predicate to be mapped over

0 commit comments

Comments
 (0)