Class MinWith<A>
java.lang.Object
com.jnape.palatable.lambda.semigroup.builtin.MinWith<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
x
is strictly greater thany
in 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> MinWith
<A> minWith()
static <A> Semigroup
<A> minWith
(Comparator<A> compareFn) static <A> Fn1
<A, A> minWith
(Comparator<A> compareFn, A x) static <A> A
minWith
(Comparator<A> compareFn, A x, A y) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
toBiFunction
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn3
apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, uncurry, widen
Methods inherited from interface com.jnape.palatable.lambda.functions.specialized.SemigroupFactory
apply, checkedApply
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
MinWith
private MinWith()
-
-
Method Details
-
minWith
-
minWith
-
minWith
-
minWith
-
checkedApply
Description copied from interface:Fn2
Invoke this function with the given argument, potentially throwing anyThrowable
.- Specified by:
checkedApply
in interfaceFn1<Comparator<A>,
Fn1<A, Fn1<A, A>>> - Specified by:
checkedApply
in interfaceFn2<Comparator<A>,
A, Fn1<A, A>> - Specified by:
checkedApply
in interfaceSemigroupFactory<Comparator<A>,
A> - Parameters:
comparator
- the argument- Returns:
- the result of the function application
-