com.jnape.palatable.lambda.adt.choice

## Class Choice6<A,B,C,D,E,F>

- java.lang.Object
- - com.jnape.palatable.lambda.adt.choice.Choice6<A,B,C,D,E,F>

- Type Parameters:
    `A` - the first possible type
    `B` - the second possible type
    `C` - the third possible type
    `D` - the fourth possible type
    `E` - the fifth possible type
    `F` - the sixth possible type
  All Implemented Interfaces:
    CoProduct6<A,B,C,D,E,F,Choice6<A,B,C,D,E,F>>, Applicative<F,Choice6<A,B,C,D,E,?>>, Bifunctor<E,F,Choice6<A,B,C,D,?,?>>, BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>, Functor<F,Choice6<A,B,C,D,E,?>>, Monad<F,Choice6<A,B,C,D,E,?>>, MonadRec<F,Choice6<A,B,C,D,E,?>>, Traversable<F,Choice6<A,B,C,D,E,?>>

      public abstract class Choice6<A,B,C,D,E,F>
      extends Object
      implements CoProduct6<A,B,C,D,E,F,Choice6<A,B,C,D,E,F>>, MonadRec<F,Choice6<A,B,C,D,E,?>>, Bifunctor<E,F,Choice6<A,B,C,D,?,?>>, Traversable<F,Choice6<A,B,C,D,E,?>>

  Canonical ADT representation of `CoProduct6`.
  See Also:
    `Choice5`, `Choice7`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `a(A a)` Static factory method for wrapping a value of type `A` in a `Choice6`.
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `b(B b)` Static factory method for wrapping a value of type `B` in a `Choice6`.
    `<G,H> Choice6<A,B,C,D,G,H>` | `biMap(Fn1<? super E,? extends G> lFn, Fn1<? super F,? extends H> rFn)` Dually map covariantly over both the left and right parameters.
    `<G> Choice6<A,B,C,D,G,F>` | `biMapL(Fn1<? super E,? extends G> fn)` Covariantly map over the left parameter.
    `<G> Choice6<A,B,C,D,E,G>` | `biMapR(Fn1<? super F,? extends G> fn)` Covariantly map over the right parameter.
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `c(C c)` Static factory method for wrapping a value of type `C` in a `Choice6`.
    `Choice5<A,B,C,D,E>` | `converge(Fn1<? super F,? extends CoProduct5<A,B,C,D,E,?>> convergenceFn)` Converge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `d(D d)` Static factory method for wrapping a value of type `D` in a `Choice6`.
    `<G> Choice6<A,B,C,D,E,G>` | `discardL(Applicative<G,Choice6<A,B,C,D,E,?>> appB)` Sequence both this `Applicative` and `appB`, discarding this `Applicative's` result and returning `appB`.
    `<G> Choice6<A,B,C,D,E,F>` | `discardR(Applicative<G,Choice6<A,B,C,D,E,?>> appB)` Sequence both this `Applicative` and `appB`, discarding `appB's` result and returning this `Applicative`.
    `<G> Choice7<A,B,C,D,E,F,G>` | `diverge()` Diverge this coproduct by introducing another possible type that it could represent.
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `e(E e)` Static factory method for wrapping a value of type `E` in a `Choice6`.
    `static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F>` | `f(F f)` Static factory method for wrapping a value of type `F` in a `Choice6`.
    `<G> Choice6<A,B,C,D,E,G>` | `flatMap(Fn1<? super F,? extends Monad<G,Choice6<A,B,C,D,E,?>>> fn)` Chain dependent computations that may continue or short-circuit based on previous results.
    `<G> Choice6<A,B,C,D,E,G>` | `fmap(Fn1<? super F,? extends G> fn)` Covariantly transmute this functor's parameter using the given mapping function.
    `<G> Lazy<Choice6<A,B,C,D,E,G>>` | `lazyZip(Lazy<? extends Applicative<Fn1<? super F,? extends G>,Choice6<A,B,C,D,E,?>>> lazyAppFn)` Given a `lazy` instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
    `Tuple6<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>>` | `project()` Specialize this choice's projection to a `Tuple6`.
    `<G> Choice6<A,B,C,D,E,G>` | `pure(G g)` Lift the value `b` into this applicative functor.
    `static <A,B,C,D,E> Pure<Choice6<A,B,C,D,E,?>>` | `pureChoice()` The canonical `Pure` instance for `Choice6`.
    `<G> Choice6<A,B,C,D,E,G>` | `trampolineM(Fn1<? super F,? extends MonadRec<RecursiveResult<F,G>,Choice6<A,B,C,D,E,?>>> fn)` Given some operation yielding a `RecursiveResult` inside this `MonadRec`, internally trampoline the operation until it yields a `termination` instruction.
    `<G,App extends Applicative<?,App>,TravB extends Traversable<G,Choice6<A,B,C,D,E,?>>,AppTrav extends Applicative<TravB,App>> AppTrav` | `traverse(Fn1<? super F,? extends Applicative<G,App>> fn, Fn1<? super TravB,? extends AppTrav> pure)` Apply `fn` to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.
    `<G> Choice6<A,B,C,D,E,G>` | `zip(Applicative<Fn1<? super F,? extends G>,Choice6<A,B,C,D,E,?>> appFn)` Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.

    - ### 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.adt.coproduct.CoProduct6

      `embed, match, projectA, projectB, projectC, projectD, projectE, projectF`

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

      `join`

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

      `coerce`

- - ### Method Detail

    - #### project

          public Tuple6<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>> project()

      Specialize this choice's projection to a `Tuple6`.
      Specified by:
        `project` in interface `CoProduct6<A,B,C,D,E,F,Choice6<A,B,C,D,E,F>>`
      Returns:
        a `Tuple6`
      See Also:
        `CoProduct2.project()`

    - #### diverge

          public <G> Choice7<A,B,C,D,E,F,G> diverge()

      Diverge this coproduct by introducing another possible type that it could represent.
      Specified by:
        `diverge` in interface `CoProduct6<A,B,C,D,E,F,Choice6<A,B,C,D,E,F>>`
      Type Parameters:
        `G` - the additional possible type of this coproduct
      Returns:
        a Coproduct7<A, B, C, D, E, F, G>
      See Also:
        `CoProduct2.diverge()`

    - #### converge

          public Choice5<A,B,C,D,E> converge(Fn1<? super F,? extends CoProduct5<A,B,C,D,E,?>> convergenceFn)

      Converge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.
      Specified by:
        `converge` in interface `CoProduct6<A,B,C,D,E,F,Choice6<A,B,C,D,E,F>>`
      Parameters:
        `convergenceFn` - morphism `F -> `CoProduct5`<A, B, C, D, E>`
      Returns:
        a `CoProduct5`<A, B, C, D, E>

    - #### fmap

          public <G> Choice6<A,B,C,D,E,G> fmap(Fn1<? super F,? extends G> fn)

      Covariantly transmute this functor's parameter using the given mapping function. Generally this method is specialized to return an instance of the class implementing Functor.
      Specified by:
        `fmap` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `fmap` in interface `Functor<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `fmap` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `fmap` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `fmap` in interface `Traversable<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the new parameter type
      Parameters:
        `fn` - the mapping function
      Returns:
        a functor over B (the new parameter type)

    - #### biMapL

          public <G> Choice6<A,B,C,D,G,F> biMapL(Fn1<? super E,? extends G> fn)

      Covariantly map over the left parameter.
      Specified by:
        `biMapL` in interface `Bifunctor<E,F,Choice6<A,B,C,D,?,?>>`
      Specified by:
        `biMapL` in interface `BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>`
      Type Parameters:
        `G` - the new left parameter type
      Parameters:
        `fn` - the mapping function
      Returns:
        a bifunctor over C (the new left parameter) and B (the same right parameter)

    - #### biMapR

          public <G> Choice6<A,B,C,D,E,G> biMapR(Fn1<? super F,? extends G> fn)

      Covariantly map over the right parameter. For all bifunctors that are also functors, it should hold that `biMapR(f) == fmap(f)`.
      Specified by:
        `biMapR` in interface `Bifunctor<E,F,Choice6<A,B,C,D,?,?>>`
      Specified by:
        `biMapR` in interface `BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>`
      Type Parameters:
        `G` - the new right parameter type
      Parameters:
        `fn` - the mapping function
      Returns:
        a bifunctor over A (the same left parameter) and C (the new right parameter)

    - #### biMap

          public <G,H> Choice6<A,B,C,D,G,H> biMap(Fn1<? super E,? extends G> lFn,
                                                  Fn1<? super F,? extends H> rFn)

      Dually map covariantly over both the left and right parameters. This is isomorphic to `biMapL(lFn).biMapR(rFn)`.
      Specified by:
        `biMap` in interface `Bifunctor<E,F,Choice6<A,B,C,D,?,?>>`
      Specified by:
        `biMap` in interface `BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>`
      Type Parameters:
        `G` - the new left parameter type
        `H` - the new right parameter type
      Parameters:
        `lFn` - the left parameter mapping function
        `rFn` - the right parameter mapping function
      Returns:
        a bifunctor over C (the new left parameter type) and D (the new right parameter type)

    - #### pure

          public <G> Choice6<A,B,C,D,E,G> pure(G g)

      Lift the value `b` into this applicative functor.
      Specified by:
        `pure` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `pure` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `pure` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the type of the returned applicative's parameter
      Parameters:
        `g` - the value
      Returns:
        an instance of this applicative over b

    - #### zip

          public <G> Choice6<A,B,C,D,E,G> zip(Applicative<Fn1<? super F,? extends G>,Choice6<A,B,C,D,E,?>> appFn)

      Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
      Specified by:
        `zip` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `zip` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `zip` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the resulting applicative parameter type
      Parameters:
        `appFn` - the other applicative instance
      Returns:
        the mapped applicative

    - #### lazyZip

          public <G> Lazy<Choice6<A,B,C,D,E,G>> lazyZip(Lazy<? extends Applicative<Fn1<? super F,? extends G>,Choice6<A,B,C,D,E,?>>> lazyAppFn)

      Given a `lazy` instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports. This is useful for applicatives that support lazy evaluation and early termination.
      Specified by:
        `lazyZip` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `lazyZip` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `lazyZip` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the resulting applicative parameter type
      Parameters:
        `lazyAppFn` - the lazy other applicative instance
      Returns:
        the mapped applicative
      See Also:
        `Maybe`, `Either`

    - #### discardL

          public <G> Choice6<A,B,C,D,E,G> discardL(Applicative<G,Choice6<A,B,C,D,E,?>> appB)

      Sequence both this `Applicative` and `appB`, discarding this `Applicative's` result and returning `appB`. This is generally useful for sequentially performing side-effects.
      Specified by:
        `discardL` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `discardL` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `discardL` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the type of the returned Applicative's parameter
      Parameters:
        `appB` - the other Applicative
      Returns:
        appB

    - #### discardR

          public <G> Choice6<A,B,C,D,E,F> discardR(Applicative<G,Choice6<A,B,C,D,E,?>> appB)

      Sequence both this `Applicative` and `appB`, discarding `appB's` result and returning this `Applicative`. This is generally useful for sequentially performing side-effects.
      Specified by:
        `discardR` in interface `Applicative<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `discardR` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `discardR` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the type of appB's parameter
      Parameters:
        `appB` - the other Applicative
      Returns:
        this Applicative

    - #### flatMap

          public <G> Choice6<A,B,C,D,E,G> flatMap(Fn1<? super F,? extends Monad<G,Choice6<A,B,C,D,E,?>>> fn)

      Chain dependent computations that may continue or short-circuit based on previous results.
      Specified by:
        `flatMap` in interface `Monad<F,Choice6<A,B,C,D,E,?>>`
      Specified by:
        `flatMap` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the resulting monad parameter type
      Parameters:
        `fn` - the dependent computation over A
      Returns:
        the new monad instance

    - #### trampolineM

          public <G> Choice6<A,B,C,D,E,G> trampolineM(Fn1<? super F,? extends MonadRec<RecursiveResult<F,G>,Choice6<A,B,C,D,E,?>>> fn)

      Given some operation yielding a `RecursiveResult` inside this `MonadRec`, internally trampoline the operation until it yields a `termination` instruction.

      Stack-safety depends on implementations guaranteeing that the growth of the call stack is a constant factor independent of the number of invocations of the operation. For various examples of how this can be achieved in stereotypical circumstances, see the referenced types.

      Specified by:
        `trampolineM` in interface `MonadRec<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the ultimate resulting carrier type
      Parameters:
        `fn` - the function to internally trampoline
      Returns:
        the trampolined `MonadRec`
      See Also:
        `for a basic implementation`, `for a {@link CoProduct2 coproduct} implementation`, `for an implementation leveraging an already stack-safe {@link Monad#flatMap(Fn1)}`, `for a {@link MonadT monad transformer} implementation`

    - #### traverse

          public <G,App extends Applicative<?,App>,TravB extends Traversable<G,Choice6<A,B,C,D,E,?>>,AppTrav extends Applicative<TravB,App>> AppTrav traverse(Fn1<? super F,? extends Applicative<G,App>> fn,
                                                                                                                                                              Fn1<? super TravB,? extends AppTrav> pure)

      Apply `fn` to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.
      Specified by:
        `traverse` in interface `Traversable<F,Choice6<A,B,C,D,E,?>>`
      Type Parameters:
        `G` - the resulting element type
        `App` - the result applicative type
        `TravB` - this Traversable instance over B
        `AppTrav` - the full inferred resulting type from the traversal
      Parameters:
        `fn` - the function to apply
        `pure` - the applicative pure function
      Returns:
        the traversed Traversable, wrapped inside an applicative

    - #### a

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> a(A a)

      Static factory method for wrapping a value of type `A` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `a` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### b

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> b(B b)

      Static factory method for wrapping a value of type `B` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `b` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### c

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> c(C c)

      Static factory method for wrapping a value of type `C` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `c` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### d

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> d(D d)

      Static factory method for wrapping a value of type `D` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `d` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### e

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> e(E e)

      Static factory method for wrapping a value of type `E` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `e` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### f

          public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> f(F f)

      Static factory method for wrapping a value of type `F` in a `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
        `F` - the sixth possible type
      Parameters:
        `f` - the value
      Returns:
        the wrapped value as a `Choice6`<A, B, C, D, E, F>

    - #### pureChoice

          public static <A,B,C,D,E> Pure<Choice6<A,B,C,D,E,?>> pureChoice()

      The canonical `Pure` instance for `Choice6`.
      Type Parameters:
        `A` - the first possible type
        `B` - the second possible type
        `C` - the third possible type
        `D` - the fourth possible type
        `E` - the fifth possible type
      Returns:
        the `Pure` instance