_1
- The first slot element type_2
- The second slot element type_3
- The third slot element typepublic class Tuple3<_1,_2,_3> extends HList.HCons<_1,Tuple2<_2,_3>> implements Product3<_1,_2,_3>, MonadRec<_3,Tuple3<_1,_2,?>>, Bifunctor<_2,_3,Tuple3<_1,?,?>>, Traversable<_3,Tuple3<_1,_2,?>>
HList.HCons<Head,Tail extends HList>, HList.HNil
Modifier and Type | Method and Description |
---|---|
_1 |
_1()
Retrieve the first element.
|
_2 |
_2()
Retrieve the second element.
|
_3 |
_3()
Retrieve the third element.
|
<_2Prime,_3Prime> |
biMap(Fn1<? super _2,? extends _2Prime> lFn,
Fn1<? super _3,? extends _3Prime> rFn)
Dually map covariantly over both the left and right parameters.
|
<_2Prime> Tuple3<_1,_2Prime,_3> |
biMapL(Fn1<? super _2,? extends _2Prime> fn)
Covariantly map over the left parameter.
|
<_3Prime> Tuple3<_1,_2,_3Prime> |
biMapR(Fn1<? super _3,? extends _3Prime> fn)
Covariantly map over the right parameter.
|
<_0> Tuple4<_0,_1,_2,_3> |
cons(_0 _0)
Cons an element onto the front of this HList.
|
<_3Prime> Tuple3<_1,_2,_3Prime> |
discardL(Applicative<_3Prime,Tuple3<_1,_2,?>> appB)
Sequence both this
Applicative and appB , discarding this Applicative's
result and returning appB . |
<_3Prime> Tuple3<_1,_2,_3> |
discardR(Applicative<_3Prime,Tuple3<_1,_2,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
static <A> Tuple3<A,A,A> |
fill(A a)
Given a value of type
A , produced an instance of this tuple with each slot set to that value. |
<_3Prime> Tuple3<_1,_2,_3Prime> |
flatMap(Fn1<? super _3,? extends Monad<_3Prime,Tuple3<_1,_2,?>>> f)
Chain dependent computations that may continue or short-circuit based on previous results.
|
<_3Prime> Tuple3<_1,_2,_3Prime> |
fmap(Fn1<? super _3,? extends _3Prime> fn)
Covariantly transmute this functor's parameter using the given mapping function.
|
static <A> Maybe<Tuple3<A,A,A>> |
fromIterable(Iterable<A> as)
|
Tuple3<_2,_1,_3> |
invert()
Rotate the first two slots of this product.
|
<_3Prime> Lazy<Tuple3<_1,_2,_3Prime>> |
lazyZip(Lazy<? extends Applicative<Fn1<? super _3,? extends _3Prime>,Tuple3<_1,_2,?>>> 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. |
<_3Prime> Tuple3<_1,_2,_3Prime> |
pure(_3Prime _3Prime)
Lift the value
b into this applicative functor. |
static <_1,_2> Pure<Tuple3<_1,_2,?>> |
pureTuple(_1 _1,
_2 _2)
|
Tuple3<_2,_3,_1> |
rotateL3()
Rotate the first three values of this product one slot to the left.
|
Tuple3<_3,_1,_2> |
rotateR3()
Rotate the first three values of this product one slot to the right.
|
<_3Prime> Tuple3<_1,_2,_3Prime> |
trampolineM(Fn1<? super _3,? extends MonadRec<RecursiveResult<_3,_3Prime>,Tuple3<_1,_2,?>>> fn)
Given some operation yielding a
RecursiveResult inside this MonadRec , internally trampoline the
operation until it yields a termination instruction. |
<_3Prime,App extends Applicative<?,App>,TravB extends Traversable<_3Prime,Tuple3<_1,_2,?>>,AppTrav extends Applicative<TravB,App>> |
traverse(Fn1<? super _3,? extends Applicative<_3Prime,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. |
<_3Prime> Tuple3<_1,_2,_3Prime> |
zip(Applicative<Fn1<? super _3,? extends _3Prime>,Tuple3<_1,_2,?>> appFn)
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|
equals, hashCode, head, tail
cons, nil, singletonHList, toString, tuple, tuple, tuple, tuple, tuple, tuple, tuple
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getKey, getValue, into, product, setValue
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
public _1 _1()
public _2 _2()
public _3 _3()
public Tuple3<_2,_3,_1> rotateL3()
public Tuple3<_3,_1,_2> rotateR3()
public <_3Prime> Tuple3<_1,_2,_3Prime> fmap(Fn1<? super _3,? extends _3Prime> fn)
fmap
in interface Applicative<_3,Tuple3<_1,_2,?>>
fmap
in interface Functor<_3,Tuple3<_1,_2,?>>
fmap
in interface Monad<_3,Tuple3<_1,_2,?>>
fmap
in interface MonadRec<_3,Tuple3<_1,_2,?>>
fmap
in interface Traversable<_3,Tuple3<_1,_2,?>>
_3Prime
- the new parameter typefn
- the mapping functionpublic <_2Prime> Tuple3<_1,_2Prime,_3> biMapL(Fn1<? super _2,? extends _2Prime> fn)
biMapL
in interface Bifunctor<_2,_3,Tuple3<_1,?,?>>
biMapL
in interface BoundedBifunctor<_2,_3,Object,Object,Tuple3<_1,?,?>>
_2Prime
- the new left parameter typefn
- the mapping functionpublic <_3Prime> Tuple3<_1,_2,_3Prime> biMapR(Fn1<? super _3,? extends _3Prime> fn)
biMapR(f) == fmap(f)
.biMapR
in interface Bifunctor<_2,_3,Tuple3<_1,?,?>>
biMapR
in interface BoundedBifunctor<_2,_3,Object,Object,Tuple3<_1,?,?>>
_3Prime
- the new right parameter typefn
- the mapping functionpublic <_2Prime,_3Prime> Tuple3<_1,_2Prime,_3Prime> biMap(Fn1<? super _2,? extends _2Prime> lFn, Fn1<? super _3,? extends _3Prime> rFn)
biMapL(lFn).biMapR(rFn)
.biMap
in interface Bifunctor<_2,_3,Tuple3<_1,?,?>>
biMap
in interface BoundedBifunctor<_2,_3,Object,Object,Tuple3<_1,?,?>>
_2Prime
- the new left parameter type_3Prime
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functionpublic <_3Prime> Tuple3<_1,_2,_3Prime> pure(_3Prime _3Prime)
b
into this applicative functor.pure
in interface Applicative<_3,Tuple3<_1,_2,?>>
pure
in interface Monad<_3,Tuple3<_1,_2,?>>
pure
in interface MonadRec<_3,Tuple3<_1,_2,?>>
_3Prime
- the type of the returned applicative's parameter_3Prime
- the valuepublic <_3Prime> Tuple3<_1,_2,_3Prime> zip(Applicative<Fn1<? super _3,? extends _3Prime>,Tuple3<_1,_2,?>> appFn)
zip
in interface Applicative<_3,Tuple3<_1,_2,?>>
zip
in interface Monad<_3,Tuple3<_1,_2,?>>
zip
in interface MonadRec<_3,Tuple3<_1,_2,?>>
_3Prime
- the resulting applicative parameter typeappFn
- the other applicative instancepublic <_3Prime> Lazy<Tuple3<_1,_2,_3Prime>> lazyZip(Lazy<? extends Applicative<Fn1<? super _3,? extends _3Prime>,Tuple3<_1,_2,?>>> 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<_3,Tuple3<_1,_2,?>>
lazyZip
in interface Monad<_3,Tuple3<_1,_2,?>>
lazyZip
in interface MonadRec<_3,Tuple3<_1,_2,?>>
_3Prime
- the resulting applicative parameter typelazyAppFn
- the lazy other applicative instanceMaybe
,
Either
public <_3Prime> Tuple3<_1,_2,_3Prime> discardL(Applicative<_3Prime,Tuple3<_1,_2,?>> 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<_3,Tuple3<_1,_2,?>>
discardL
in interface Monad<_3,Tuple3<_1,_2,?>>
discardL
in interface MonadRec<_3,Tuple3<_1,_2,?>>
_3Prime
- the type of the returned Applicative's parameterappB
- the other Applicativepublic <_3Prime> Tuple3<_1,_2,_3> discardR(Applicative<_3Prime,Tuple3<_1,_2,?>> 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<_3,Tuple3<_1,_2,?>>
discardR
in interface Monad<_3,Tuple3<_1,_2,?>>
discardR
in interface MonadRec<_3,Tuple3<_1,_2,?>>
_3Prime
- the type of appB's parameterappB
- the other Applicativepublic <_3Prime> Tuple3<_1,_2,_3Prime> flatMap(Fn1<? super _3,? extends Monad<_3Prime,Tuple3<_1,_2,?>>> f)
public <_3Prime> Tuple3<_1,_2,_3Prime> trampolineM(Fn1<? super _3,? extends MonadRec<RecursiveResult<_3,_3Prime>,Tuple3<_1,_2,?>>> 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<_3,Tuple3<_1,_2,?>>
_3Prime
- 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 <_3Prime,App extends Applicative<?,App>,TravB extends Traversable<_3Prime,Tuple3<_1,_2,?>>,AppTrav extends Applicative<TravB,App>> AppTrav traverse(Fn1<? super _3,? extends Applicative<_3Prime,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<_3,Tuple3<_1,_2,?>>
_3Prime
- 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> Tuple3<A,A,A> fill(A a)
A
, produced an instance of this tuple with each slot set to that value.A
- the value typea
- the value to fill the tuple withTuple2.fill(A)