A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typeCP6
- the recursive type of this coproduct (used for embedding)@FunctionalInterface public interface CoProduct6<A,B,C,D,E,F,CP6 extends CoProduct6<A,B,C,D,E,F,?>>
CoProduct2
Modifier and Type | Method and Description |
---|---|
default CoProduct5<A,B,C,D,E,? extends CoProduct5<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.
|
default <G> CoProduct7<A,B,C,D,E,F,G,? extends CoProduct7<A,B,C,D,E,F,G,?>> |
diverge()
Diverge this coproduct by introducing another possible type that it could represent.
|
default <R> R |
embed(Fn1<? super CP6,? extends R> aFn,
Fn1<? super CP6,? extends R> bFn,
Fn1<? super CP6,? extends R> cFn,
Fn1<? super CP6,? extends R> dFn,
Fn1<? super CP6,? extends R> eFn,
Fn1<? super CP6,? extends R> fFn)
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)
Type-safe convergence requiring a match against all potential types.
|
default Product6<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>> |
project()
Project this coproduct onto a product.
|
default Maybe<A> |
projectA()
Convenience method for projecting this coproduct onto a product and then extracting the first slot value.
|
default Maybe<B> |
projectB()
Convenience method for projecting this coproduct onto a product and then extracting the second slot value.
|
default Maybe<C> |
projectC()
Convenience method for projecting this coproduct onto a product and then extracting the third slot value.
|
default Maybe<D> |
projectD()
Convenience method for projecting this coproduct onto a product and then extracting the fourth slot value.
|
default Maybe<E> |
projectE()
Convenience method for projecting this coproduct onto a product and then extracting the fifth slot value.
|
default Maybe<F> |
projectF()
Convenience method for projecting this coproduct onto a product and then extracting the sixth slot value.
|
<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)
R
- result typeaFn
- morphism A -> R
bFn
- morphism B -> R
cFn
- morphism C -> R
dFn
- morphism D -> R
eFn
- morphism E -> R
fFn
- morphism F -> R
CoProduct2.match(Fn1, Fn1)
default <G> CoProduct7<A,B,C,D,E,F,G,? extends CoProduct7<A,B,C,D,E,F,G,?>> diverge()
G
- the additional possible type of this coproductCoProduct2.diverge()
default CoProduct5<A,B,C,D,E,? extends CoProduct5<A,B,C,D,E,?>> converge(Fn1<? super F,? extends CoProduct5<A,B,C,D,E,?>> convergenceFn)
convergenceFn
- morphism F -> CoProduct5
<A, B, C, D, E>
CoProduct5
<A, B, C, D, E>default Product6<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>> project()
CoProduct2.project()
default Maybe<A> projectA()
default Maybe<B> projectB()
default Maybe<C> projectC()
default Maybe<D> projectD()
default Maybe<E> projectE()
default Maybe<F> projectF()
default <R> R embed(Fn1<? super CP6,? extends R> aFn, Fn1<? super CP6,? extends R> bFn, Fn1<? super CP6,? extends R> cFn, Fn1<? super CP6,? extends R> dFn, Fn1<? super CP6,? extends R> eFn, Fn1<? super CP6,? extends R> fFn)
R
, apply
the appropriate morphism to this coproduct as a whole. Like match(com.jnape.palatable.lambda.functions.Fn1<? super A, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super B, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super C, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super D, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super E, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super F, ? extends R>)
, but without unwrapping the
value.R
- result typeaFn
- morphism A v B v C v D v E v F -> R
, applied in the A
casebFn
- morphism A v B v C v D v E v F -> R
, applied in the B
casecFn
- morphism A v B v C v D v E v F -> R
, applied in the C
casedFn
- morphism A v B v C v D v E v F -> R
, applied in the D
caseeFn
- morphism A v B v C v D v E v F -> R
, applied in the E
casefFn
- morphism A v B v C v D v E v F -> R
, applied in the F
case