com.jnape.palatable.lambda.monoid.builtin

## Class And

- java.lang.Object
- - com.jnape.palatable.lambda.monoid.builtin.And

- All Implemented Interfaces:
    Fn1<Boolean,Fn1<Boolean,Boolean>>, Fn2<Boolean,Boolean,Boolean>, BiPredicate<Boolean,Boolean>, Applicative<Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, Cartesian<Boolean,Fn1<Boolean,Boolean>,Fn1<?,?>>, Cocartesian<Boolean,Fn1<Boolean,Boolean>,Fn1<?,?>>, Contravariant<Boolean,Profunctor<?,Fn1<Boolean,Boolean>,Fn1<?,?>>>, Functor<Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, Profunctor<Boolean,Fn1<Boolean,Boolean>,Fn1<?,?>>, Monad<Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, MonadReader<Boolean,Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, MonadRec<Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, MonadWriter<Boolean,Fn1<Boolean,Boolean>,Fn1<Boolean,?>>, Monoid<Boolean>, Semigroup<Boolean>

      public final class And
      extends Object
      implements Monoid<Boolean>, BiPredicate<Boolean,Boolean>

  A `Monoid` instance formed by `Boolean`. Equivalent to logical `&&`.
  See Also:
    `Or`, `Monoid`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static And` | `and()`
    `static Fn1<Boolean,Boolean>` | `and(Boolean x)`
    `static Boolean` | `and(Boolean x, Boolean y)`
    `Boolean` | `checkedApply(Boolean x, Boolean y)`
    `And` | `flip()` Flip the order of the arguments.
    `<B> Boolean` | `foldMap(Fn1<? super B,? extends Boolean> fn, Iterable<B> bs)` Homomorphism combined with catamorphism.
    `Boolean` | `identity()` 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.monoid.Monoid

      `foldLeft, foldRight, monoid, monoid, reduceLeft, reduceRight`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2

      `apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, fn2, fromBiFunction, toBiFunction, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.specialized.BiPredicate

      `and, apply, contraMap, diMapL, discardR, fromBiPredicate, negate, or, toBiPredicate, uncurry`

- - ### Method Detail

    - #### identity

          public Boolean identity()

      Description copied from interface: `Monoid`
      The identity element of this monoid.
      Specified by:
        `identity` in interface `Monoid<Boolean>`
      Returns:
        the identity

    - #### checkedApply

          public Boolean checkedApply(Boolean x,
                                      Boolean y)

      Specified by:
        `checkedApply` in interface `Fn2<Boolean,Boolean,Boolean>`

    - #### foldMap

          public <B> Boolean foldMap(Fn1<? super B,? extends Boolean> fn,
                                     Iterable<B> bs)

      Description copied from interface: `Monoid`
      Homomorphism combined with catamorphism. Convert an `Iterable<B>` to an `Iterable<A>` (that is, an `Iterable` of 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:
        `foldMap` in interface `Monoid<Boolean>`
      Type Parameters:
        `B` - the input Iterable element type
      Parameters:
        `fn` - the mapping function from A to B
        `bs` - 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: `Monoid`
      Flip the order of the arguments.
      Specified by:
        `flip` in interface `Fn2<Boolean,Boolean,Boolean>`
      Specified by:
        `flip` in interface `BiPredicate<Boolean,Boolean>`
      Specified by:
        `flip` in interface `Monoid<Boolean>`
      Specified by:
        `flip` in interface `Semigroup<Boolean>`
      Returns:
        an `Fn2`<B, A, C>

    - #### and

          public static And and()

    - #### and

          public static Fn1<Boolean,Boolean> and(Boolean x)

    - #### and

          public static Boolean and(Boolean x,
                                    Boolean y)