A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typepublic 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,?>>
CoProduct6
.Modifier and Type | Method and Description |
---|---|
static <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> |
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> |
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> |
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> |
e(E e)
Static factory method for wrapping a value of type
E in a Choice6 . |
static <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> |
pureChoice()
|
<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>> |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tuple6<Maybe<A>,Maybe<B>,Maybe<C>,Maybe<D>,Maybe<E>,Maybe<F>> project()
Tuple6
.public <G> Choice7<A,B,C,D,E,F,G> diverge()
public Choice5<A,B,C,D,E> converge(Fn1<? super F,? extends CoProduct5<A,B,C,D,E,?>> convergenceFn)
public <G> Choice6<A,B,C,D,E,G> fmap(Fn1<? super F,? extends G> fn)
fmap
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
fmap
in interface Functor<F,Choice6<A,B,C,D,E,?>>
fmap
in interface Monad<F,Choice6<A,B,C,D,E,?>>
fmap
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
fmap
in interface Traversable<F,Choice6<A,B,C,D,E,?>>
G
- the new parameter typefn
- the mapping functionpublic <G> Choice6<A,B,C,D,G,F> biMapL(Fn1<? super E,? extends G> fn)
biMapL
in interface Bifunctor<E,F,Choice6<A,B,C,D,?,?>>
biMapL
in interface BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>
G
- the new left parameter typefn
- the mapping functionpublic <G> Choice6<A,B,C,D,E,G> biMapR(Fn1<? super F,? extends G> fn)
biMapR(f) == fmap(f)
.biMapR
in interface Bifunctor<E,F,Choice6<A,B,C,D,?,?>>
biMapR
in interface BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>
G
- the new right parameter typefn
- the mapping functionpublic <G,H> Choice6<A,B,C,D,G,H> biMap(Fn1<? super E,? extends G> lFn, Fn1<? super F,? extends H> rFn)
biMapL(lFn).biMapR(rFn)
.biMap
in interface Bifunctor<E,F,Choice6<A,B,C,D,?,?>>
biMap
in interface BoundedBifunctor<E,F,Object,Object,Choice6<A,B,C,D,?,?>>
G
- the new left parameter typeH
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functionpublic <G> Choice6<A,B,C,D,E,G> pure(G g)
b
into this applicative functor.pure
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
pure
in interface Monad<F,Choice6<A,B,C,D,E,?>>
pure
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the type of the returned applicative's parameterg
- the valuepublic <G> Choice6<A,B,C,D,E,G> zip(Applicative<Fn1<? super F,? extends G>,Choice6<A,B,C,D,E,?>> appFn)
zip
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
zip
in interface Monad<F,Choice6<A,B,C,D,E,?>>
zip
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the resulting applicative parameter typeappFn
- the other applicative instancepublic <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)
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.lazyZip
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
lazyZip
in interface Monad<F,Choice6<A,B,C,D,E,?>>
lazyZip
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the resulting applicative parameter typelazyAppFn
- the lazy other applicative instanceMaybe
,
Either
public <G> Choice6<A,B,C,D,E,G> discardL(Applicative<G,Choice6<A,B,C,D,E,?>> appB)
Applicative
and appB
, discarding this Applicative's
result and returning appB
. This is generally useful for sequentially performing side-effects.discardL
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
discardL
in interface Monad<F,Choice6<A,B,C,D,E,?>>
discardL
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the type of the returned Applicative's parameterappB
- the other Applicativepublic <G> Choice6<A,B,C,D,E,F> discardR(Applicative<G,Choice6<A,B,C,D,E,?>> appB)
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<F,Choice6<A,B,C,D,E,?>>
discardR
in interface Monad<F,Choice6<A,B,C,D,E,?>>
discardR
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the type of appB's parameterappB
- the other Applicativepublic <G> Choice6<A,B,C,D,E,G> flatMap(Fn1<? super F,? extends Monad<G,Choice6<A,B,C,D,E,?>>> fn)
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)
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.
trampolineM
in interface MonadRec<F,Choice6<A,B,C,D,E,?>>
G
- the ultimate resulting carrier typefn
- the function to internally trampolineMonadRec
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
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)
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.traverse
in interface Traversable<F,Choice6<A,B,C,D,E,?>>
G
- the resulting element typeApp
- the result applicative typeTravB
- this Traversable instance over BAppTrav
- the full inferred resulting type from the traversalfn
- the function to applypure
- the applicative pure functionpublic static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> a(A a)
A
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typea
- the valueChoice6
<A, B, C, D, E, F>public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> b(B b)
B
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typeb
- the valueChoice6
<A, B, C, D, E, F>public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> c(C c)
C
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typec
- the valueChoice6
<A, B, C, D, E, F>public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> d(D d)
D
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typed
- the valueChoice6
<A, B, C, D, E, F>public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> e(E e)
E
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typee
- the valueChoice6
<A, B, C, D, E, F>public static <A,B,C,D,E,F> Choice6<A,B,C,D,E,F> f(F f)
F
in a Choice6
.A
- the first possible typeB
- the second possible typeC
- the third possible typeD
- the fourth possible typeE
- the fifth possible typeF
- the sixth possible typef
- the valueChoice6
<A, B, C, D, E, F>