Interface Predicate<A>
- Type Parameters:
A
- The argument type
- All Superinterfaces:
Applicative<Boolean,
,Fn1<A, ?>> Cartesian<A,
,Boolean, Fn1<?, ?>> Cocartesian<A,
,Boolean, Fn1<?, ?>> Contravariant<A,
,Profunctor<?, Boolean, Fn1<?, ?>>> Fn1<A,
,Boolean> Functor<Boolean,
,Fn1<A, ?>> Monad<Boolean,
,Fn1<A, ?>> MonadReader<A,
,Boolean, Fn1<A, ?>> MonadRec<Boolean,
,Fn1<A, ?>> MonadWriter<A,
,Boolean, Fn1<A, ?>> Profunctor<A,
Boolean, Fn1<?, ?>>
- All Known Implementing Classes:
Empty
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A specialized
Fn1
that returns a Boolean
.-
Method Summary
Modifier and TypeMethodDescriptionLeft-to-right short-circuiting logical conjunction.default <Y,
Z> BiPredicate <Y, Z> Right-to-left composition between different arity functions.default <Z> Predicate
<Z> Contravariantly mapA <- B
.default <Z> Predicate
<Z> Contravariantly map over the argument to this function, producing a function that takes the new argument type, and produces the same result.discardR
(Applicative<C, Fn1<A, ?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.static <A> Predicate
<A> fromPredicate
(Predicate<A> predicate) negate()
Logical negation.Left-to-right short-circuiting logical disjunction.static <A> Predicate
<A> Static factory method to create a predicate from anFn1
.default <Z> BiPredicate
<Z, A> widen()
Widen this function's argument list by prepending an ignored argument of any type to the front.
-
Method Details
-
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:
diMapL
in interfaceCartesian<A,
Boolean, Fn1<?, ?>> - Specified by:
diMapL
in interfaceCocartesian<A,
Boolean, Fn1<?, ?>> - Specified by:
diMapL
in interfaceFn1<A,
Boolean> - Specified by:
diMapL
in interfaceProfunctor<A,
Boolean, Fn1<?, ?>> - 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:
contraMap
in interfaceCartesian<A,
Boolean, Fn1<?, ?>> - Specified by:
contraMap
in interfaceCocartesian<A,
Boolean, Fn1<?, ?>> - Specified by:
contraMap
in interfaceContravariant<A,
Profunctor<?, Boolean, Fn1<?, ?>>> - Specified by:
contraMap
in interfaceFn1<A,
Boolean> - Specified by:
contraMap
in interfaceProfunctor<A,
Boolean, Fn1<?, ?>> - Type Parameters:
Z
- the new parameter type- Parameters:
fn
- the mapping function- Returns:
- the mapped Contravariant functor instance
-
widen
Widen this function's argument list by prepending an ignored argument of any type to the front. -
discardR
Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
. This is generally useful for sequentially performing side-effects.- Specified by:
discardR
in interfaceApplicative<Boolean,
Fn1<A, ?>> - Specified by:
discardR
in interfaceFn1<A,
Boolean> - Specified by:
discardR
in interfaceMonad<Boolean,
Fn1<A, ?>> - Specified by:
discardR
in interfaceMonadReader<A,
Boolean, Fn1<A, ?>> - Specified by:
discardR
in interfaceMonadRec<Boolean,
Fn1<A, ?>> - Specified by:
discardR
in interfaceMonadWriter<A,
Boolean, Fn1<A, ?>> - Type Parameters:
C
- the type of appB's parameter- Parameters:
appB
- the other Applicative- Returns:
- this Applicative
-
compose
Right-to-left composition between different arity functions. Preserves highest arity in the return type. -
and
Left-to-right short-circuiting logical conjunction.- Parameters:
other
- the predicate to test if this one succeeds- Returns:
- a predicate representing the conjunction of this predicate and other
-
or
Left-to-right short-circuiting logical disjunction.- Parameters:
other
- the predicate to test if this one fails- Returns:
- a predicate representing the disjunction of this predicate and other
-
negate
Logical negation.- Returns:
- the negation of this predicate
-
toPredicate
- Returns:
- the
Predicate
-
predicate
Static factory method to create a predicate from anFn1
.- Type Parameters:
A
- the input type- Parameters:
predicate
- theFn1
- Returns:
- the predicate
-
fromPredicate
-