Interface CoProduct7<A,B,C,D,E,F,G,CP7 extends CoProduct7<A,B,C,D,E,F,G,?>>

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
G - the seventh possible type
CP7 - the recursive type of this coproduct (used for embedding)
All Known Implementing Classes:
Choice7, Choice7._A, Choice7._B, Choice7._C, Choice7._D, Choice7._E, Choice7._F, Choice7._G
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CoProduct7<A,B,C,D,E,F,G,CP7 extends CoProduct7<A,B,C,D,E,F,G,?>>
A generalization of the coproduct of seven types.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default CoProduct6<A,B,C,D,E,F,? extends CoProduct6<A,B,C,D,E,F,?>>
    converge(Fn1<? super G,? extends CoProduct6<A,B,C,D,E,F,?>> convergenceFn)
    Converge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.
    default <H> CoProduct8<A,B,C,D,E,F,G,H,? extends CoProduct8<A,B,C,D,E,F,G,H,?>>
    Diverge this coproduct by introducing another possible type that it could represent.
    default <R> R
    embed(Fn1<? super CP7,? extends R> aFn, Fn1<? super CP7,? extends R> bFn, Fn1<? super CP7,? extends R> cFn, Fn1<? super CP7,? extends R> dFn, Fn1<? super CP7,? extends R> eFn, Fn1<? super CP7,? extends R> fFn, Fn1<? super CP7,? extends R> gFn)
    Embed this coproduct inside another value; that is, given morphisms from this coproduct to R, apply the appropriate morphism to this coproduct as a whole.
    <R> R
    match(Fn1<? super A,? extends R> aFn, Fn1<? super B,? extends R> bFn, Fn1<? super C,? extends R> cFn, Fn1<? super D,? extends R> dFn, Fn1<? super E,? extends R> eFn, Fn1<? super F,? extends R> fFn, Fn1<? super G,? extends R> gFn)
    Type-safe convergence requiring a match against all potential types.
    Project this coproduct onto a product.
    default Maybe<A>
    Convenience method for projecting this coproduct onto a product and then extracting the first slot value.
    default Maybe<B>
    Convenience method for projecting this coproduct onto a product and then extracting the second slot value.
    default Maybe<C>
    Convenience method for projecting this coproduct onto a product and then extracting the third slot value.
    default Maybe<D>
    Convenience method for projecting this coproduct onto a product and then extracting the fourth slot value.
    default Maybe<E>
    Convenience method for projecting this coproduct onto a product and then extracting the fifth slot value.
    default Maybe<F>
    Convenience method for projecting this coproduct onto a product and then extracting the sixth slot value.
    default Maybe<G>
    Convenience method for projecting this coproduct onto a product and then extracting the seventh slot value.
  • Method Details

    • match

      <R> R match(Fn1<? super A,? extends R> aFn, Fn1<? super B,? extends R> bFn, Fn1<? super C,? extends R> cFn, Fn1<? super D,? extends R> dFn, Fn1<? super E,? extends R> eFn, Fn1<? super F,? extends R> fFn, Fn1<? super G,? extends R> gFn)
      Type-safe convergence requiring a match against all potential types.
      Type Parameters:
      R - result type
      Parameters:
      aFn - morphism A -> R
      bFn - morphism B -> R
      cFn - morphism C -> R
      dFn - morphism D -> R
      eFn - morphism E -> R
      fFn - morphism F -> R
      gFn - morphism G -> R
      Returns:
      the result of applying the appropriate morphism from whichever type is represented by this coproduct to R
      See Also:
    • diverge

      default <H> CoProduct8<A,B,C,D,E,F,G,H,? extends CoProduct8<A,B,C,D,E,F,G,H,?>> diverge()
      Diverge this coproduct by introducing another possible type that it could represent.
      Type Parameters:
      H - the additional possible type of this coproduct
      Returns:
      a Coproduct8<A, B, C, D, E, F, G, H>
      See Also:
    • converge

      default CoProduct6<A,B,C,D,E,F,? extends CoProduct6<A,B,C,D,E,F,?>> converge(Fn1<? super G,? extends CoProduct6<A,B,C,D,E,F,?>> convergenceFn)
      Converge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.
      Parameters:
      convergenceFn - morphism G -> CoProduct6<A, B, C, D, E, F>
      Returns:
      a CoProduct6<A, B, C, D, E, F>
    • project

      default Product7<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>,Maybe<G>> project()
      Project this coproduct onto a product.
      Returns:
      a product of the coproduct projection
      See Also:
    • projectA

      default Maybe<A> projectA()
      Convenience method for projecting this coproduct onto a product and then extracting the first slot value.
      Returns:
      an optional value representing the projection of the "a" type index
    • projectB

      default Maybe<B> projectB()
      Convenience method for projecting this coproduct onto a product and then extracting the second slot value.
      Returns:
      an optional value representing the projection of the "b" type index
    • projectC

      default Maybe<C> projectC()
      Convenience method for projecting this coproduct onto a product and then extracting the third slot value.
      Returns:
      an optional value representing the projection of the "c" type index
    • projectD

      default Maybe<D> projectD()
      Convenience method for projecting this coproduct onto a product and then extracting the fourth slot value.
      Returns:
      an optional value representing the projection of the "d" type index
    • projectE

      default Maybe<E> projectE()
      Convenience method for projecting this coproduct onto a product and then extracting the fifth slot value.
      Returns:
      an optional value representing the projection of the "e" type index
    • projectF

      default Maybe<F> projectF()
      Convenience method for projecting this coproduct onto a product and then extracting the sixth slot value.
      Returns:
      an optional value representing the projection of the "f" type index
    • projectG

      default Maybe<G> projectG()
      Convenience method for projecting this coproduct onto a product and then extracting the seventh slot value.
      Returns:
      an optional value representing the projection of the "g" type index
    • embed

      default <R> R embed(Fn1<? super CP7,? extends R> aFn, Fn1<? super CP7,? extends R> bFn, Fn1<? super CP7,? extends R> cFn, Fn1<? super CP7,? extends R> dFn, Fn1<? super CP7,? extends R> eFn, Fn1<? super CP7,? extends R> fFn, Fn1<? super CP7,? extends R> gFn)
      Type Parameters:
      R - result type
      Parameters:
      aFn - morphism A v B v C v D v E v F v G -> R, applied in the A case
      bFn - morphism A v B v C v D v E v F v G -> R, applied in the B case
      cFn - morphism A v B v C v D v E v F v G -> R, applied in the C case
      dFn - morphism A v B v C v D v E v F v G -> R, applied in the D case
      eFn - morphism A v B v C v D v E v F v G -> R, applied in the E case
      fFn - morphism A v B v C v D v E v F v G -> R, applied in the F case
      gFn - morphism A v B v C v D v E v F v G -> R, applied in the G case
      Returns:
      the result of applying the appropriate morphism to this coproduct