com.jnape.palatable.lambda.functions.builtin.fn2

## Class ReduceRight<A>

- java.lang.Object
- - com.jnape.palatable.lambda.functions.builtin.fn2.ReduceRight<A>

- Type Parameters:
    `A` - The input Iterable element type, as well as the accumulation type
  All Implemented Interfaces:
    Fn1<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>>, Fn2<Fn2<? super A,? super A,? extends A>,Iterable<A>,Maybe<A>>, Applicative<Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>, Cartesian<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>,Fn1<?,?>>, Cocartesian<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>,Fn1<?,?>>, Contravariant<Fn2<? super A,? super A,? extends A>,Profunctor<?,Fn1<Iterable<A>,Maybe<A>>,Fn1<?,?>>>, Functor<Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>, Profunctor<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>,Fn1<?,?>>, Monad<Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>, MonadReader<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>, MonadRec<Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>, MonadWriter<Fn2<? super A,? super A,? extends A>,Fn1<Iterable<A>,Maybe<A>>,Fn1<Fn2<? super A,? super A,? extends A>,?>>

      public final class ReduceRight<A>
      extends Object
      implements Fn2<Fn2<? super A,? super A,? extends A>,Iterable<A>,Maybe<A>>

  Given an ``Iterable`<A>` and a ``Fn2`<A, A, A>`, iteratively accumulate over the `Iterable`, returning ``Maybe`<A>`. If the `Iterable` is empty, the result is `Maybe.nothing()`; otherwise, the result is wrapped in `Maybe.just(A)`. For this reason, `null` accumulation results are considered erroneous and will throw.

  This function is isomorphic to a right fold over the `Iterable` where the tail element is the starting accumulation value and the result is lifted into `Maybe`.

  See Also:
    `ReduceLeft`, `FoldRight`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Maybe<A>` | `checkedApply(Fn2<? super A,? super A,? extends A> fn, Iterable<A> as)`
    `static <A> ReduceRight<A>` | `reduceRight()`
    `static <A> Fn1<Iterable<A>,Maybe<A>>` | `reduceRight(Fn2<? super A,? super A,? extends A> fn)`
    `static <A> Maybe<A>` | `reduceRight(Fn2<? super A,? super A,? extends A> fn, Iterable<A> as)`

    - ### 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.Fn2

      `apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, flip, 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`

- - ### Method Detail

    - #### checkedApply

          public final Maybe<A> checkedApply(Fn2<? super A,? super A,? extends A> fn,
                                             Iterable<A> as)

      Specified by:
        `checkedApply` in interface `Fn2<Fn2<? super A,? super A,? extends A>,Iterable<A>,Maybe<A>>`

    - #### reduceRight

          public static <A> ReduceRight<A> reduceRight()

    - #### reduceRight

          public static <A> Fn1<Iterable<A>,Maybe<A>> reduceRight(Fn2<? super A,? super A,? extends A> fn)

    - #### reduceRight

          public static <A> Maybe<A> reduceRight(Fn2<? super A,? super A,? extends A> fn,
                                                 Iterable<A> as)