Interface Fn2<A,B,C>
- Type Parameters:
A- The first argument typeB- The second argument typeC- The return type
- All Superinterfaces:
Applicative<Fn1<B,C>, Fn1<A, ?>>, Cartesian<A, Fn1<B, C>, Fn1<?, ?>>, Cocartesian<A, Fn1<B, C>, Fn1<?, ?>>, Contravariant<A, Profunctor<?, Fn1<B, C>, Fn1<?, ?>>>, Fn1<A, Fn1<B, C>>, Functor<Fn1<B, C>, Fn1<A, ?>>, Monad<Fn1<B, C>, Fn1<A, ?>>, MonadReader<A, Fn1<B, C>, Fn1<A, ?>>, MonadRec<Fn1<B, C>, Fn1<A, ?>>, MonadWriter<A, Fn1<B, C>, Fn1<A, ?>>, Profunctor<A, Fn1<B, C>, Fn1<?, ?>>
- All Known Subinterfaces:
BiMonoidFactory<A,B, C>, BiPredicate<A, B>, BiSemigroupFactory<A, B, C>, Fn3<A, B, C, D>, Fn4<A, B, C, D, E>, Fn5<A, B, C, D, E, F>, Fn6<A, B, C, D, E, F, G>, Fn7<A, B, C, D, E, F, G, H>, Fn8<A, B, C, D, E, F, G, H, I>, Monoid<A>, MonoidFactory<A, B>, Semigroup<A>, SemigroupFactory<A, B>
- All Known Implementing Classes:
$, Absent, AddAll, All, Alter, And, Any, AutoBracket, Between, Both, Bracket, CartesianProduct, Clamp, CmpEq, CmpEqBy, CmpEqWith, Collapse, Collapse, Compare, Compose, Compose, Concat, Cons, Constantly, Difference, Drop, DropWhile, Endo, EndoK, Eq, Filter, Find, First, FoldLeft, FoldRight, GroupBy, GT, GTBy, GTE, GTEBy, GTEWith, GTWith, IfThenElse, InGroupsOf, Intersection, Intersperse, Into, Into1, Into3, Into4, Into5, Into6, Into7, Into8, Iterate, Join, Last, LazyRec, LeftAll, LeftAll, LeftAny, LeftAny, LiftA2, LiftA3, LiftA4, LiftA5, LiftA6, LiftA7, LT, LTBy, LTE, LTEBy, LTEWith, LTWith, MagnetizeBy, Map, Matching, Max, MaxBy, MaxWith, Merge, Merge, MergeHMaps, MergeMaps, Min, MinBy, MinWith, Not, Or, Over, Partition, Peek, Peek2, PrependAll, Present, PutAll, RateLimit, ReduceLeft, ReduceRight, Replicate, RightAll, RightAll, RightAny, RightAny, RunAll, RunAll, ScanLeft, Sequence, Set, Slide, Snoc, SortBy, SortWith, Span, Take, TakeWhile, Times, ToArray, ToCollection, ToMap, Trampoline, Trivial, Tupler2, Under, Unfoldr, Union, Until, View, Xor, Zip, ZipWith
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A function taking two arguments.
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPartially apply this function by passing its first argument.default CInvoke this function with the given arguments.checkedApply(A a) Invoke this function with the given argument, potentially throwing anyThrowable.checkedApply(A a, B b) Right-to-left composition between different arity functions.Contravariantly mapA <- B.static <A,B, C> Fn2 <A, B, C> static <A,B, C> Fn2 <A, B, C> Contravariantly map over the argument to this function, producing a function that takes the new argument type, and produces the same result.discardR(Applicative<D, Fn1<A, ?>> appB) Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative.flip()Flip the order of the arguments.static <A,B, C> Fn2 <A, B, C> 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 aBiFunctionin anFn2.default BiFunction<A, B, C> View thisFn2as aBiFunction.uncurry()widen()Widen this function's argument list by prepending an ignored argument of any type to the front.
-
Method Details
-
checkedApply
-
apply
-
checkedApply
-
widen
-
apply
-
flip
-
uncurry
-
toBiFunction
View thisFn2as aBiFunction.- Returns:
- the same logic as a
BiFunction - See Also:
-
discardR
Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative. This is generally useful for sequentially performing side-effects.- Specified by:
discardRin interfaceApplicative<A,B> - Specified by:
discardRin interfaceFn1<A,B> - Specified by:
discardRin interfaceMonad<A,B> - Specified by:
discardRin interfaceMonadReader<A,B, C> - Specified by:
discardRin interfaceMonadRec<A,B> - Specified by:
discardRin interfaceMonadWriter<A,B, C> - Type Parameters:
D- the type of appB's parameter- Parameters:
appB- the other Applicative- Returns:
- this Applicative
-
diMapL
Contravariantly map over the argument to this function, producing a function that takes the new argument type, and produces the same result.- Specified by:
diMapLin interfaceCartesian<A,B, C> - Specified by:
diMapLin interfaceCocartesian<A,B, C> - Specified by:
diMapLin interfaceFn1<A,B> - Specified by:
diMapLin interfaceProfunctor<A,B, C> - Type Parameters:
Z- the new argument type- Parameters:
fn- the contravariant argument mapping function- Returns:
- an
Fn1<Z, B>
-
contraMap
Contravariantly mapA <- B.- Specified by:
contraMapin interfaceCartesian<A,B, C> - Specified by:
contraMapin interfaceCocartesian<A,B, C> - Specified by:
contraMapin interfaceContravariant<A,B> - Specified by:
contraMapin interfaceFn1<A,B> - Specified by:
contraMapin interfaceProfunctor<A,B, C> - Type Parameters:
Z- the new parameter type- Parameters:
fn- the mapping function- Returns:
- the mapped Contravariant functor instance
-
compose
Right-to-left composition between different arity functions. Preserves highest arity in the return type. -
fromBiFunction
Static factory method for wrapping aBiFunctionin anFn2.- Type Parameters:
A- the first input argument typeB- the second input argument typeC- the output type- Parameters:
biFunction- the biFunction to adapt- Returns:
- the
Fn2
-
curried
-
curry
-
fn2
-