Class Tuple8<_1,_2,_3,_4,_5,_6,_7,_8>
java.lang.Object
com.jnape.palatable.lambda.adt.hlist.HList
com.jnape.palatable.lambda.adt.hlist.HList.HCons<_1,Tuple7<_2,_3,_4,_5,_6,_7,_8>>
com.jnape.palatable.lambda.adt.hlist.Tuple8<_1,_2,_3,_4,_5,_6,_7,_8>
- Type Parameters:
_1
- The first slot element type_2
- The second slot element type_3
- The third slot element type_4
- The fourth slot element type_5
- The fifth slot element type_6
- The sixth slot element type_7
- The seventh slot element type_8
- The eighth slot element type
- All Implemented Interfaces:
Product2<_1,
,_2> Product3<_1,
,_2, _3> Product4<_1,
,_2, _3, _4> Product5<_1,
,_2, _3, _4, _5> Product6<_1,
,_2, _3, _4, _5, _6> Product7<_1,
,_2, _3, _4, _5, _6, _7> Product8<_1,
,_2, _3, _4, _5, _6, _7, _8> Applicative<_8,
,Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> Bifunctor<_7,
,_8, Tuple8<_1, _2, _3, _4, _5, _6, ?, ?>> BoundedBifunctor<_7,
,_8, Object, Object, Tuple8<_1, _2, _3, _4, _5, _6, ?, ?>> Functor<_8,
,Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> Monad<_8,
,Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> MonadRec<_8,
,Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> Traversable<_8,
,Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> Map.Entry<_1,
_2>
public class Tuple8<_1,_2,_3,_4,_5,_6,_7,_8>
extends HList.HCons<_1,Tuple7<_2,_3,_4,_5,_6,_7,_8>>
implements Product8<_1,_2,_3,_4,_5,_6,_7,_8>, MonadRec<_8,Tuple8<_1,_2,_3,_4,_5,_6,_7,?>>, Bifunctor<_7,_8,Tuple8<_1,_2,_3,_4,_5,_6,?,?>>, Traversable<_8,Tuple8<_1,_2,_3,_4,_5,_6,_7,?>>
An 8-element tuple product type, implemented as a specialized HList. Supports random access.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jnape.palatable.lambda.adt.hlist.HList
HList.HCons<Head,
Tail extends HList>, HList.HNil -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_1()
Retrieve the first element._2()
Retrieve the second element._3()
Retrieve the third element._4()
Retrieve the fourth element._5()
Retrieve the fifth element._6()
Retrieve the sixth element._7()
Retrieve the seventh element._8()
Retrieve the eighth element.Dually map covariantly over both the left and right parameters.Covariantly map over the left parameter.Covariantly map over the right parameter.cons
(_0 _0) Cons an element onto the front of this HList.Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
.Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.static <A> Tuple8
<A, A, A, A, A, A, A, A> fill
(A a) Given a value of typeA
, produced an instance of this tuple with each slot set to that value.Chain dependent computations that may continue or short-circuit based on previous results.Covariantly transmute this functor's parameter using the given mapping function.fromIterable
(Iterable<A> as) init()
invert()
Rotate the first two slots of this product.lazyZip
(Lazy<? extends Applicative<Fn1<? super _8, ? extends _8Prime>, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>> lazyAppFn) Given alazy
instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.pure
(_8Prime _8Prime) Lift the valueb
into this applicative functor.pureTuple
(_1 _1, _2 _2, _3 _3, _4 _4, _5 _5, _6 _6, _7 _7) rotateL3()
Rotate the first three values of this product one slot to the left.rotateL4()
Rotate the first four values of this product one slot to the left.rotateL5()
Rotate the first five values of this product one slot to the left.rotateL6()
Rotate the first six values of this product one slot to the left.rotateL7()
Rotate the first seven values of this product one slot to the left.rotateL8()
Rotate all eight values of this product one slot to the left.rotateR3()
Rotate the first three values of this product one slot to the right.rotateR4()
Rotate the first four values of this product one slot to the right.rotateR5()
Rotate the first five values of this product one slot to the right.rotateR6()
Rotate the first six values of this product one slot to the right.rotateR7()
Rotate the first seven values of this product one slot to the right.rotateR8()
Rotate all eight values of this product one slot to the right.snoc
(_9 _9) Snoc an element onto the back of thisTuple8
.trampolineM
(Fn1<? super _8, ? extends MonadRec<RecursiveResult<_8, _8Prime>, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
instruction.<_8Prime,
App extends Applicative<?, App>, TravB extends Traversable<_8Prime, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>, AppTrav extends Applicative<TravB, App>>
AppTravtraverse
(Fn1<? super _8, ? extends Applicative<_8Prime, App>> fn, Fn1<? super TravB, ? extends AppTrav> pure) Applyfn
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.Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.Methods inherited from class com.jnape.palatable.lambda.adt.hlist.HList.HCons
equals, hashCode, head, tail
Methods inherited from class com.jnape.palatable.lambda.adt.hlist.HList
cons, nil, singletonHList, toString, tuple, tuple, tuple, tuple, tuple, tuple, tuple
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
_1
-
_2
-
_3
-
_4
-
_5
-
_6
-
_7
-
_8
-
-
Constructor Details
-
Tuple8
-
-
Method Details
-
cons
Cons an element onto the front of this HList. -
snoc
Snoc an element onto the back of thisTuple8
. -
_1
Retrieve the first element. -
_2
Retrieve the second element. -
_3
Retrieve the third element. -
_4
Retrieve the fourth element. -
_5
Retrieve the fifth element. -
_6
Retrieve the sixth element. -
_7
Retrieve the seventh element. -
_8
Retrieve the eighth element. -
rotateL8
Rotate all eight values of this product one slot to the left. -
rotateR8
Rotate all eight values of this product one slot to the right. -
rotateL7
Rotate the first seven values of this product one slot to the left. -
rotateR7
Rotate the first seven values of this product one slot to the right. -
rotateL6
Rotate the first six values of this product one slot to the left. -
rotateR6
Rotate the first six values of this product one slot to the right. -
rotateL5
Rotate the first five values of this product one slot to the left. -
rotateR5
Rotate the first five values of this product one slot to the right. -
rotateL4
Rotate the first four values of this product one slot to the left.- Specified by:
rotateL4
in interfaceProduct4<_1,
_2, _3, _4> - Specified by:
rotateL4
in interfaceProduct5<_1,
_2, _3, _4, _5> - Specified by:
rotateL4
in interfaceProduct6<_1,
_2, _3, _4, _5, _6> - Specified by:
rotateL4
in interfaceProduct7<_1,
_2, _3, _4, _5, _6, _7> - Specified by:
rotateL4
in interfaceProduct8<_1,
_2, _3, _4, _5, _6, _7, _8> - Returns:
- the left-rotated product
-
rotateR4
Rotate the first four values of this product one slot to the right.- Specified by:
rotateR4
in interfaceProduct4<_1,
_2, _3, _4> - Specified by:
rotateR4
in interfaceProduct5<_1,
_2, _3, _4, _5> - Specified by:
rotateR4
in interfaceProduct6<_1,
_2, _3, _4, _5, _6> - Specified by:
rotateR4
in interfaceProduct7<_1,
_2, _3, _4, _5, _6, _7> - Specified by:
rotateR4
in interfaceProduct8<_1,
_2, _3, _4, _5, _6, _7, _8> - Returns:
- the right-rotated product
-
rotateL3
Rotate the first three values of this product one slot to the left.- Specified by:
rotateL3
in interfaceProduct3<_1,
_2, _3> - Specified by:
rotateL3
in interfaceProduct4<_1,
_2, _3, _4> - Specified by:
rotateL3
in interfaceProduct5<_1,
_2, _3, _4, _5> - Specified by:
rotateL3
in interfaceProduct6<_1,
_2, _3, _4, _5, _6> - Specified by:
rotateL3
in interfaceProduct7<_1,
_2, _3, _4, _5, _6, _7> - Specified by:
rotateL3
in interfaceProduct8<_1,
_2, _3, _4, _5, _6, _7, _8> - Returns:
- the left-rotated product
-
rotateR3
Rotate the first three values of this product one slot to the right.- Specified by:
rotateR3
in interfaceProduct3<_1,
_2, _3> - Specified by:
rotateR3
in interfaceProduct4<_1,
_2, _3, _4> - Specified by:
rotateR3
in interfaceProduct5<_1,
_2, _3, _4, _5> - Specified by:
rotateR3
in interfaceProduct6<_1,
_2, _3, _4, _5, _6> - Specified by:
rotateR3
in interfaceProduct7<_1,
_2, _3, _4, _5, _6, _7> - Specified by:
rotateR3
in interfaceProduct8<_1,
_2, _3, _4, _5, _6, _7, _8> - Returns:
- the right-rotated product
-
invert
Rotate the first two slots of this product.- Specified by:
invert
in interfaceProduct2<_1,
_2> - Specified by:
invert
in interfaceProduct3<_1,
_2, _3> - Specified by:
invert
in interfaceProduct4<_1,
_2, _3, _4> - Specified by:
invert
in interfaceProduct5<_1,
_2, _3, _4, _5> - Specified by:
invert
in interfaceProduct6<_1,
_2, _3, _4, _5, _6> - Specified by:
invert
in interfaceProduct7<_1,
_2, _3, _4, _5, _6, _7> - Specified by:
invert
in interfaceProduct8<_1,
_2, _3, _4, _5, _6, _7, _8> - Returns:
- the rotated product
-
fmap
Covariantly transmute this functor's parameter using the given mapping function. Generally this method is specialized to return an instance of the class implementing Functor.- Specified by:
fmap
in interfaceApplicative<_1,
_2> - Specified by:
fmap
in interfaceFunctor<_1,
_2> - Specified by:
fmap
in interfaceMonad<_1,
_2> - Specified by:
fmap
in interfaceMonadRec<_1,
_2> - Specified by:
fmap
in interfaceTraversable<_1,
_2> - Type Parameters:
_8Prime
- the new parameter type- Parameters:
fn
- the mapping function- Returns:
- a functor over B (the new parameter type)
-
biMapL
Covariantly map over the left parameter. -
biMapR
Covariantly map over the right parameter. For all bifunctors that are also functors, it should hold thatbiMapR(f) == fmap(f)
.- Specified by:
biMapR
in interfaceBifunctor<_1,
_2, _3> - Specified by:
biMapR
in interfaceBoundedBifunctor<_1,
_2, _3, _4, _5> - Type Parameters:
_8Prime
- the new right parameter type- Parameters:
fn
- the mapping function- Returns:
- a bifunctor over A (the same left parameter) and C (the new right parameter)
-
biMap
public <_7Prime,_8Prime> Tuple8<_1,_2, biMap_3, _4, _5, _6, _7Prime, _8Prime> (Fn1<? super _7, ? extends _7Prime> lFn, Fn1<? super _8, ? extends _8Prime> rFn) Dually map covariantly over both the left and right parameters. This is isomorphic tobiMapL(lFn).biMapR(rFn)
.- Specified by:
biMap
in interfaceBifunctor<_1,
_2, _3> - Specified by:
biMap
in interfaceBoundedBifunctor<_1,
_2, _3, _4, _5> - Type Parameters:
_7Prime
- the new left parameter type_8Prime
- the new right parameter type- Parameters:
lFn
- the left parameter mapping functionrFn
- the right parameter mapping function- Returns:
- a bifunctor over C (the new left parameter type) and D (the new right parameter type)
-
pure
Lift the valueb
into this applicative functor. -
zip
public <_8Prime> Tuple8<_1,_2, zip_3, _4, _5, _6, _7, _8Prime> (Applicative<Fn1<? super _8, ? extends _8Prime>, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> appFn) Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports. -
lazyZip
public <_8Prime> Lazy<Tuple8<_1,_2, lazyZip_3, _4, _5, _6, _7, _8Prime>> (Lazy<? extends Applicative<Fn1<? super _8, ? extends _8Prime>, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>> lazyAppFn) Given alazy
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.- Specified by:
lazyZip
in interfaceApplicative<_1,
_2> - Specified by:
lazyZip
in interfaceMonad<_1,
_2> - Specified by:
lazyZip
in interfaceMonadRec<_1,
_2> - Type Parameters:
_8Prime
- the resulting applicative parameter type- Parameters:
lazyAppFn
- the lazy other applicative instance- Returns:
- the mapped applicative
- See Also:
-
discardL
public <_8Prime> Tuple8<_1,_2, discardL_3, _4, _5, _6, _7, _8Prime> (Applicative<_8Prime, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> appB) Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
. This is generally useful for sequentially performing side-effects. -
discardR
public <_8Prime> Tuple8<_1,_2, discardR_3, _4, _5, _6, _7, _8> (Applicative<_8Prime, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
. This is generally useful for sequentially performing side-effects. -
flatMap
public <_8Prime> Tuple8<_1,_2, flatMap_3, _4, _5, _6, _7, _8Prime> (Fn1<? super _8, ? extends Monad<_8Prime, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>> f) Chain dependent computations that may continue or short-circuit based on previous results. -
trampolineM
public <_8Prime> Tuple8<_1,_2, trampolineM_3, _4, _5, _6, _7, _8Prime> (Fn1<? super _8, ? extends MonadRec<RecursiveResult<_8, _8Prime>, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
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.
- Specified by:
trampolineM
in interfaceMonadRec<_1,
_2> - Type Parameters:
_8Prime
- the ultimate resulting carrier type- Parameters:
fn
- the function to internally trampoline- Returns:
- the trampolined
MonadRec
- See Also:
-
traverse
public <_8Prime,App extends Applicative<?, AppTrav traverseApp>, TravB extends Traversable<_8Prime, Tuple8<_1, _2, _3, _4, _5, _6, _7, ?>>, AppTrav extends Applicative<TravB, App>> (Fn1<? super _8, ? extends Applicative<_8Prime, App>> fn, Fn1<? super TravB, ? extends AppTrav> pure) Applyfn
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.- Specified by:
traverse
in interfaceTraversable<_1,
_2> - Type Parameters:
_8Prime
- the resulting element typeApp
- the result applicative typeTravB
- this Traversable instance over BAppTrav
- the full inferred resulting type from the traversal- Parameters:
fn
- the function to applypure
- the applicative pure function- Returns:
- the traversed Traversable, wrapped inside an applicative
-
init
Returns a
of all the elements of thisTuple7
<_1, _2, _3, _4, _5, _6, _7>
except the last.Tuple8
<_1, _2, _3, _4, _5, _6, _7, _8>- Returns:
- The
Tuple7
<_1, _2, _3, _4, _5, _6, _7> representing all but the last element
-
fill
Given a value of typeA
, produced an instance of this tuple with each slot set to that value.- Type Parameters:
A
- the value type- Parameters:
a
- the value to fill the tuple with- Returns:
- the filled tuple
- See Also:
-
fromIterable
-
pureTuple
public static <_1,_2, Pure<Tuple8<_1,_3, _4, _5, _6, _7> _2, pureTuple_3, _4, _5, _6, _7, ?>> (_1 _1, _2 _2, _3 _3, _4 _4, _5 _5, _6 _6, _7 _7) - Type Parameters:
_1
- the head element type_2
- the second element type_3
- the third element type_4
- the fourth element type_5
- the fifth element type_6
- the sixth element type_7
- the seventh element type- Parameters:
_1
- the head element_2
- the second element_3
- the third element_4
- the fourth element_5
- the fifth element_6
- the sixth element_7
- the seventh element- Returns:
- the
Pure
instance
-