Class MaxWith<A>
java.lang.Object
com.jnape.palatable.lambda.semigroup.builtin.MaxWith<A>
- Type Parameters:
A- the value type
- All Implemented Interfaces:
Fn1<Comparator<A>, Fn1<A,Fn1<A, A>>>, Fn2<Comparator<A>, A, Fn1<A, A>>, Fn3<Comparator<A>, A, A, A>, SemigroupFactory<Comparator<A>, A>, Applicative<Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>, Cartesian<Comparator<A>, Fn1<A, Fn1<A, A>>, Fn1<?, ?>>, Cocartesian<Comparator<A>, Fn1<A, Fn1<A, A>>, Fn1<?, ?>>, Contravariant<Comparator<A>, Profunctor<?, Fn1<A, Fn1<A, A>>, Fn1<?, ?>>>, Functor<Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>, Profunctor<Comparator<A>, Fn1<A, Fn1<A, A>>, Fn1<?, ?>>, Monad<Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>, MonadReader<Comparator<A>, Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>, MonadRec<Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>, MonadWriter<Comparator<A>, Fn1<A, Fn1<A, A>>, Fn1<Comparator<A>, ?>>
Given a comparator for some type
A, produce a Semigroup over A that chooses
between two values x and y via the following rules:
- If
xis strictly less thanyin terms ofB, returny - Otherwise, return
x
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckedApply(Comparator<A> comparator) Invoke this function with the given argument, potentially throwing anyThrowable.static <A> MaxWith<A> maxWith()static <A> Semigroup<A> maxWith(Comparator<A> compareFn) static <A> Fn1<A, A> maxWith(Comparator<A> compareFn, A x) static <A> AmaxWith(Comparator<A> compareFn, A x, A y) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zipMethods inherited from interface Fn2
toBiFunctionMethods inherited from interface Fn3
apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, uncurry, widenMethods inherited from interface SemigroupFactory
apply, checkedApply
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
MaxWith
private MaxWith()
-
-
Method Details
-
maxWith
-
maxWith
-
maxWith
-
maxWith
-
checkedApply
Description copied from interface:Fn2Invoke this function with the given argument, potentially throwing anyThrowable.- Specified by:
checkedApplyin interfaceFn1<Comparator<A>, Fn1<A,Fn1<A, A>>> - Specified by:
checkedApplyin interfaceFn2<Comparator<A>, A, Fn1<A,A>> - Specified by:
checkedApplyin interfaceSemigroupFactory<Comparator<A>, A>- Parameters:
comparator- the argument- Returns:
- the result of the function application
-