Interface CoProduct8<A,B,C,D,E,F,G,H,CP8 extends CoProduct8<A,B,C,D,E,F,G,H,?>>
- Type Parameters:
A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typeG
- the seventh possible typeH
- the eighth possible typeCP8
- the recursive type of this coproduct (used for embedding)
- All Known Implementing Classes:
Choice8
,Choice8._A
,Choice8._B
,Choice8._C
,Choice8._D
,Choice8._E
,Choice8._F
,Choice8._G
,Choice8._H
- 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 CoProduct8<A,B,C,D,E,F,G,H,CP8 extends CoProduct8<A,B,C,D,E,F,G,H,?>>
A generalization of the coproduct of eight types.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionConverge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.default <R> R
embed
(Fn1<? super CP8, ? extends R> aFn, Fn1<? super CP8, ? extends R> bFn, Fn1<? super CP8, ? extends R> cFn, Fn1<? super CP8, ? extends R> dFn, Fn1<? super CP8, ? extends R> eFn, Fn1<? super CP8, ? extends R> fFn, Fn1<? super CP8, ? extends R> gFn, Fn1<? super CP8, ? extends R> hFn) Embed this coproduct inside another value; that is, given morphisms from this coproduct toR
, 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, Fn1<? super H, ? extends R> hFn) Type-safe convergence requiring a match against all potential types.project()
Project this coproduct onto a product.projectA()
Convenience method for projecting this coproduct onto a product and then extracting the first slot value.projectB()
Convenience method for projecting this coproduct onto a product and then extracting the second slot value.projectC()
Convenience method for projecting this coproduct onto a product and then extracting the third slot value.projectD()
Convenience method for projecting this coproduct onto a product and then extracting the fourth slot value.projectE()
Convenience method for projecting this coproduct onto a product and then extracting the fifth slot value.projectF()
Convenience method for projecting this coproduct onto a product and then extracting the sixth slot value.projectG()
Convenience method for projecting this coproduct onto a product and then extracting the seventh slot value.projectH()
Convenience method for projecting this coproduct onto a product and then extracting the eighth 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, Fn1<? super H, ? extends R> hFn) Type-safe convergence requiring a match against all potential types.- Type Parameters:
R
- result type- Parameters:
aFn
- morphismA -> R
bFn
- morphismB -> R
cFn
- morphismC -> R
dFn
- morphismD -> R
eFn
- morphismE -> R
fFn
- morphismF -> R
gFn
- morphismG -> R
hFn
- morphismH -> R
- Returns:
- the result of applying the appropriate morphism from whichever type is represented by this coproduct to R
- See Also:
-
converge
default CoProduct7<A,B, convergeC, D, E, F, G, ? extends CoProduct7<A, B, C, D, E, F, G, ?>> (Fn1<? super H, ? extends CoProduct7<A, B, C, D, E, F, G, ?>> convergenceFn) Converge this coproduct down to a lower order coproduct by mapping the last possible type into an earlier possible type.- Parameters:
convergenceFn
- morphismG ->
CoProduct6
<A, B, C, D, E, F, G>- Returns:
- a
CoProduct7
<A, B, C, D, E, F, G>
-
project
Project this coproduct onto a product.- Returns:
- a product of the coproduct projection
- See Also:
-
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
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
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
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
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
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
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
-
projectH
Convenience method for projecting this coproduct onto a product and then extracting the eighth slot value.- Returns:
- an optional value representing the projection of the "h" type index
-
embed
default <R> R embed(Fn1<? super CP8, ? extends R> aFn, Fn1<? super CP8, ? extends R> bFn, Fn1<? super CP8, ? extends R> cFn, Fn1<? super CP8, ? extends R> dFn, Fn1<? super CP8, ? extends R> eFn, Fn1<? super CP8, ? extends R> fFn, Fn1<? super CP8, ? extends R> gFn, Fn1<? super CP8, ? extends R> hFn) Embed this coproduct inside another value; that is, given morphisms from this coproduct toR
, apply the appropriate morphism to this coproduct as a whole. Likematch(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>, com.jnape.palatable.lambda.functions.Fn1<? super G, ? extends R>, com.jnape.palatable.lambda.functions.Fn1<? super H, ? extends R>)
, but without unwrapping the value.- Type Parameters:
R
- result type- Parameters:
aFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theA
casebFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theB
casecFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theC
casedFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theD
caseeFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theE
casefFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theF
casegFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theG
casehFn
- morphismA v B v C v D v E v F v G v H -> R
, applied in theH
case- Returns:
- the result of applying the appropriate morphism to this coproduct
-