Class And
- java.lang.Object
-
- com.jnape.palatable.lambda.monoid.builtin.And
-
- All Implemented Interfaces:
Fn1<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>>,Fn2<java.lang.Boolean,java.lang.Boolean,java.lang.Boolean>,BiPredicate<java.lang.Boolean,java.lang.Boolean>,Applicative<Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,Cartesian<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<?,?>>,Cocartesian<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<?,?>>,Contravariant<java.lang.Boolean,Profunctor<?,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<?,?>>>,Functor<Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,Profunctor<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<?,?>>,Monad<Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,MonadReader<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,MonadRec<Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,MonadWriter<java.lang.Boolean,Fn1<java.lang.Boolean,java.lang.Boolean>,Fn1<java.lang.Boolean,?>>,Monoid<java.lang.Boolean>,Semigroup<java.lang.Boolean>
public final class And extends java.lang.Object implements Monoid<java.lang.Boolean>, BiPredicate<java.lang.Boolean,java.lang.Boolean>
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAnd()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Andand()static Fn1<java.lang.Boolean,java.lang.Boolean>and(java.lang.Boolean x)static java.lang.Booleanand(java.lang.Boolean x, java.lang.Boolean y)java.lang.BooleancheckedApply(java.lang.Boolean x, java.lang.Boolean y)Andflip()Flip the order of the arguments.<B> java.lang.BooleanfoldMap(Fn1<? super B,? extends java.lang.Boolean> fn, java.lang.Iterable<B> bs)Homomorphism combined with catamorphism.java.lang.Booleanidentity()The identity element of this monoid.-
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.specialized.BiPredicate
and, apply, contraMap, diMapL, discardR, negate, or, toBiPredicate, uncurry
-
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
apply, checkedApply, compose, toBiFunction, widen
-
Methods inherited from interface com.jnape.palatable.lambda.monoid.Monoid
foldLeft, foldRight, reduceLeft, reduceRight
-
-
-
-
Field Detail
-
INSTANCE
private static final And INSTANCE
-
-
Method Detail
-
identity
public java.lang.Boolean identity()
Description copied from interface:MonoidThe identity element of this monoid.
-
checkedApply
public java.lang.Boolean checkedApply(java.lang.Boolean x, java.lang.Boolean y)- Specified by:
checkedApplyin interfaceFn2<java.lang.Boolean,java.lang.Boolean,java.lang.Boolean>
-
foldMap
public <B> java.lang.Boolean foldMap(Fn1<? super B,? extends java.lang.Boolean> fn, java.lang.Iterable<B> bs)
Description copied from interface:MonoidHomomorphism combined with catamorphism. Convert anIterable<B>to anIterable<A>(that is, anIterableof elements this monoid is formed over), then reduce the result from left to right. Under algebraic data types, this is isomorphic to a flatMap.- Specified by:
foldMapin interfaceMonoid<java.lang.Boolean>- Type Parameters:
B- the input Iterable element type- Parameters:
fn- the mapping function from A to Bbs- the Iterable of Bs- Returns:
- the folded result under this Monoid
- See Also:
Map,Monoid.reduceLeft(Iterable)
-
flip
public And flip()
Description copied from interface:MonoidFlip the order of the arguments.- Specified by:
flipin interfaceBiPredicate<java.lang.Boolean,java.lang.Boolean>- Specified by:
flipin interfaceFn2<java.lang.Boolean,java.lang.Boolean,java.lang.Boolean>- Specified by:
flipin interfaceMonoid<java.lang.Boolean>- Specified by:
flipin interfaceSemigroup<java.lang.Boolean>- Returns:
- an
Fn2<B, A, C>
-
and
public static And and()
-
and
public static Fn1<java.lang.Boolean,java.lang.Boolean> and(java.lang.Boolean x)
-
and
public static java.lang.Boolean and(java.lang.Boolean x, java.lang.Boolean y)
-
-