_1
- The first slot element type_2
- The second slot element type_3
- The third slot element type_4
- The fourth slot element typepublic class Tuple4<_1,_2,_3,_4> extends HList.HCons<_1,Tuple3<_2,_3,_4>> implements Product4<_1,_2,_3,_4>, MonadRec<_4,Tuple4<_1,_2,_3,?>>, Bifunctor<_3,_4,Tuple4<_1,_2,?,?>>, Traversable<_4,Tuple4<_1,_2,_3,?>>
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.
|
_4 |
_4()
Retrieve the fourth element.
|
<_3Prime,_4Prime> |
biMap(Fn1<? super _3,? extends _3Prime> lFn,
Fn1<? super _4,? extends _4Prime> rFn)
Dually map covariantly over both the left and right parameters.
|
<_3Prime> Tuple4<_1,_2,_3Prime,_4> |
biMapL(Fn1<? super _3,? extends _3Prime> fn)
Covariantly map over the left parameter.
|
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
biMapR(Fn1<? super _4,? extends _4Prime> fn)
Covariantly map over the right parameter.
|
<_0> Tuple5<_0,_1,_2,_3,_4> |
cons(_0 _0)
Cons an element onto the front of this HList.
|
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
discardL(Applicative<_4Prime,Tuple4<_1,_2,_3,?>> appB)
Sequence both this
Applicative and appB , discarding this Applicative's
result and returning appB . |
<_4Prime> Tuple4<_1,_2,_3,_4> |
discardR(Applicative<_4Prime,Tuple4<_1,_2,_3,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
static <A> Tuple4<A,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. |
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
flatMap(Fn1<? super _4,? extends Monad<_4Prime,Tuple4<_1,_2,_3,?>>> f)
Chain dependent computations that may continue or short-circuit based on previous results.
|
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
fmap(Fn1<? super _4,? extends _4Prime> fn)
Covariantly transmute this functor's parameter using the given mapping function.
|
static <A> Maybe<Tuple4<A,A,A,A>> |
fromIterable(Iterable<A> as)
|
Tuple4<_2,_1,_3,_4> |
invert()
Rotate the first two slots of this product.
|
<_4Prime> Lazy<Tuple4<_1,_2,_3,_4Prime>> |
lazyZip(Lazy<? extends Applicative<Fn1<? super _4,? extends _4Prime>,Tuple4<_1,_2,_3,?>>> 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. |
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
pure(_4Prime _4Prime)
Lift the value
b into this applicative functor. |
static <_1,_2,_3> Pure<Tuple4<_1,_2,_3,?>> |
pureTuple(_1 _1,
_2 _2,
_3 _3)
|
Tuple4<_2,_3,_1,_4> |
rotateL3()
Rotate the first three values of this product one slot to the left.
|
Tuple4<_2,_3,_4,_1> |
rotateL4()
Rotate the first four values of this product one slot to the left.
|
Tuple4<_3,_1,_2,_4> |
rotateR3()
Rotate the first three values of this product one slot to the right.
|
Tuple4<_4,_1,_2,_3> |
rotateR4()
Rotate the first four values of this product one slot to the right.
|
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
trampolineM(Fn1<? super _4,? extends MonadRec<RecursiveResult<_4,_4Prime>,Tuple4<_1,_2,_3,?>>> fn)
Given some operation yielding a
RecursiveResult inside this MonadRec , internally trampoline the
operation until it yields a termination instruction. |
<_4Prime,App extends Applicative<?,App>,TravB extends Traversable<_4Prime,Tuple4<_1,_2,_3,?>>,AppTrav extends Applicative<TravB,App>> |
traverse(Fn1<? super _4,? extends Applicative<_4Prime,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. |
<_4Prime> Tuple4<_1,_2,_3,_4Prime> |
zip(Applicative<Fn1<? super _4,? extends _4Prime>,Tuple4<_1,_2,_3,?>> 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, 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 _4 _4()
public Tuple4<_2,_3,_4,_1> rotateL4()
public Tuple4<_4,_1,_2,_3> rotateR4()
public Tuple4<_2,_3,_1,_4> rotateL3()
public Tuple4<_3,_1,_2,_4> rotateR3()
public <_4Prime> Tuple4<_1,_2,_3,_4Prime> fmap(Fn1<? super _4,? extends _4Prime> fn)
fmap
in interface Applicative<_4,Tuple4<_1,_2,_3,?>>
fmap
in interface Functor<_4,Tuple4<_1,_2,_3,?>>
fmap
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
fmap
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
fmap
in interface Traversable<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the new parameter typefn
- the mapping functionpublic <_3Prime> Tuple4<_1,_2,_3Prime,_4> biMapL(Fn1<? super _3,? extends _3Prime> fn)
biMapL
in interface Bifunctor<_3,_4,Tuple4<_1,_2,?,?>>
biMapL
in interface BoundedBifunctor<_3,_4,Object,Object,Tuple4<_1,_2,?,?>>
_3Prime
- the new left parameter typefn
- the mapping functionpublic <_4Prime> Tuple4<_1,_2,_3,_4Prime> biMapR(Fn1<? super _4,? extends _4Prime> fn)
biMapR(f) == fmap(f)
.biMapR
in interface Bifunctor<_3,_4,Tuple4<_1,_2,?,?>>
biMapR
in interface BoundedBifunctor<_3,_4,Object,Object,Tuple4<_1,_2,?,?>>
_4Prime
- the new right parameter typefn
- the mapping functionpublic <_3Prime,_4Prime> Tuple4<_1,_2,_3Prime,_4Prime> biMap(Fn1<? super _3,? extends _3Prime> lFn, Fn1<? super _4,? extends _4Prime> rFn)
biMapL(lFn).biMapR(rFn)
.biMap
in interface Bifunctor<_3,_4,Tuple4<_1,_2,?,?>>
biMap
in interface BoundedBifunctor<_3,_4,Object,Object,Tuple4<_1,_2,?,?>>
_3Prime
- the new left parameter type_4Prime
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functionpublic <_4Prime> Tuple4<_1,_2,_3,_4Prime> pure(_4Prime _4Prime)
b
into this applicative functor.pure
in interface Applicative<_4,Tuple4<_1,_2,_3,?>>
pure
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
pure
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the type of the returned applicative's parameter_4Prime
- the valuepublic <_4Prime> Tuple4<_1,_2,_3,_4Prime> zip(Applicative<Fn1<? super _4,? extends _4Prime>,Tuple4<_1,_2,_3,?>> appFn)
zip
in interface Applicative<_4,Tuple4<_1,_2,_3,?>>
zip
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
zip
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the resulting applicative parameter typeappFn
- the other applicative instancepublic <_4Prime> Lazy<Tuple4<_1,_2,_3,_4Prime>> lazyZip(Lazy<? extends Applicative<Fn1<? super _4,? extends _4Prime>,Tuple4<_1,_2,_3,?>>> 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<_4,Tuple4<_1,_2,_3,?>>
lazyZip
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
lazyZip
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the resulting applicative parameter typelazyAppFn
- the lazy other applicative instanceMaybe
,
Either
public <_4Prime> Tuple4<_1,_2,_3,_4Prime> discardL(Applicative<_4Prime,Tuple4<_1,_2,_3,?>> 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<_4,Tuple4<_1,_2,_3,?>>
discardL
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
discardL
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the type of the returned Applicative's parameterappB
- the other Applicativepublic <_4Prime> Tuple4<_1,_2,_3,_4> discardR(Applicative<_4Prime,Tuple4<_1,_2,_3,?>> 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<_4,Tuple4<_1,_2,_3,?>>
discardR
in interface Monad<_4,Tuple4<_1,_2,_3,?>>
discardR
in interface MonadRec<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- the type of appB's parameterappB
- the other Applicativepublic <_4Prime> Tuple4<_1,_2,_3,_4Prime> flatMap(Fn1<? super _4,? extends Monad<_4Prime,Tuple4<_1,_2,_3,?>>> f)
public <_4Prime> Tuple4<_1,_2,_3,_4Prime> trampolineM(Fn1<? super _4,? extends MonadRec<RecursiveResult<_4,_4Prime>,Tuple4<_1,_2,_3,?>>> 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<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- 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 <_4Prime,App extends Applicative<?,App>,TravB extends Traversable<_4Prime,Tuple4<_1,_2,_3,?>>,AppTrav extends Applicative<TravB,App>> AppTrav traverse(Fn1<? super _4,? extends Applicative<_4Prime,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<_4,Tuple4<_1,_2,_3,?>>
_4Prime
- 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> Tuple4<A,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)