A
- The first argument typeB
- The second argument typeC
- The return type@FunctionalInterface public interface Fn2<A,B,C> extends Fn1<A,Fn1<B,C>>
Note that defining Fn2
in terms of Fn1
provides a reasonable approximation of currying in the
form of multiple apply(A, B)
overloads that take different numbers of arguments.
Fn1
Modifier and Type | Method and Description |
---|---|
default Fn1<B,C> |
apply(A a)
Partially apply this function by passing its first argument.
|
default C |
apply(A a,
B b)
Invoke this function with the given arguments.
|
default Fn1<B,C> |
checkedApply(A a)
Invoke this function with the given argument, potentially throwing any
Throwable . |
C |
checkedApply(A a,
B b) |
default <Y,Z> Fn3<Y,Z,B,C> |
compose(Fn2<? super Y,? super Z,? extends A> before)
Right-to-left composition between different arity functions.
|
default <Z> Fn2<Z,B,C> |
contraMap(Fn1<? super Z,? extends A> fn)
Contravariantly map
A <- B . |
static <A,B,C> Fn2<A,B,C> |
curried(Fn1<A,Fn1<B,C>> curriedFn1)
|
static <A,B,C> Fn2<A,B,C> |
curry(Fn1<? super Tuple2<A,B>,? extends C> uncurriedFn1)
|
default <Z> Fn2<Z,B,C> |
diMapL(Fn1<? super Z,? extends A> fn)
Contravariantly map over the argument to this function, producing a function that takes the new argument type,
and produces the same result.
|
default <D> Fn2<A,B,C> |
discardR(Applicative<D,Fn1<A,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
default Fn2<B,A,C> |
flip()
Flip the order of the arguments.
|
static <A,B,C> Fn2<A,B,C> |
fn2(Fn2<A,B,C> fn2)
Static method to aid inference.
|
static <A,B,C> Fn2<A,B,C> |
fromBiFunction(BiFunction<? super A,? super B,? extends C> biFunction)
Static factory method for wrapping a
BiFunction in an Fn2 . |
default BiFunction<A,B,C> |
toBiFunction()
View this
Fn2 as a BiFunction . |
default Fn1<? super Product2<? extends A,? extends B>,C> |
uncurry()
|
default <Z> Fn3<Z,A,B,C> |
widen()
Widen this function's argument list by prepending an ignored argument of any type to the front.
|
default C apply(A a, B b)
a
- the first argumentb
- the second argumentdefault Fn1<B,C> checkedApply(A a) throws Throwable
Throwable
.default <Z> Fn3<Z,A,B,C> widen()
default BiFunction<A,B,C> toBiFunction()
Fn2
as a BiFunction
.BiFunction
BiFunction
default <D> Fn2<A,B,C> discardR(Applicative<D,Fn1<A,?>> appB)
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<Fn1<B,C>,Fn1<A,?>>
discardR
in interface Fn1<A,Fn1<B,C>>
discardR
in interface Monad<Fn1<B,C>,Fn1<A,?>>
discardR
in interface MonadReader<A,Fn1<B,C>,Fn1<A,?>>
discardR
in interface MonadRec<Fn1<B,C>,Fn1<A,?>>
discardR
in interface MonadWriter<A,Fn1<B,C>,Fn1<A,?>>
D
- the type of appB's parameterappB
- the other Applicativedefault <Z> Fn2<Z,B,C> diMapL(Fn1<? super Z,? extends A> fn)
diMapL
in interface Cartesian<A,Fn1<B,C>,Fn1<?,?>>
diMapL
in interface Cocartesian<A,Fn1<B,C>,Fn1<?,?>>
diMapL
in interface Fn1<A,Fn1<B,C>>
diMapL
in interface Profunctor<A,Fn1<B,C>,Fn1<?,?>>
Z
- the new argument typefn
- the contravariant argument mapping functionFn1
<Z, B>default <Z> Fn2<Z,B,C> contraMap(Fn1<? super Z,? extends A> fn)
A <- B
.contraMap
in interface Cartesian<A,Fn1<B,C>,Fn1<?,?>>
contraMap
in interface Cocartesian<A,Fn1<B,C>,Fn1<?,?>>
contraMap
in interface Contravariant<A,Profunctor<?,Fn1<B,C>,Fn1<?,?>>>
contraMap
in interface Fn1<A,Fn1<B,C>>
contraMap
in interface Profunctor<A,Fn1<B,C>,Fn1<?,?>>
Z
- the new parameter typefn
- the mapping functiondefault <Y,Z> Fn3<Y,Z,B,C> compose(Fn2<? super Y,? super Z,? extends A> before)
static <A,B,C> Fn2<A,B,C> fromBiFunction(BiFunction<? super A,? super B,? extends C> biFunction)
BiFunction
in an Fn2
.A
- the first input argument typeB
- the second input argument typeC
- the output typebiFunction
- the biFunction to adaptFn2
static <A,B,C> Fn2<A,B,C> curried(Fn1<A,Fn1<B,C>> curriedFn1)
A
- the first input argument typeB
- the second input argument typeC
- the output typecurriedFn1
- the curried fn1 to adaptFn2