Class Tuple7<_1,_2,_3,_4,_5,_6,_7>
- java.lang.Object
-
- com.jnape.palatable.lambda.adt.hlist.HList
-
- com.jnape.palatable.lambda.adt.hlist.HList.HCons<_1,Tuple6<_2,_3,_4,_5,_6,_7>>
-
- com.jnape.palatable.lambda.adt.hlist.Tuple7<_1,_2,_3,_4,_5,_6,_7>
-
- 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
- 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>,Applicative<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>,Bifunctor<_6,_7,Tuple7<_1,_2,_3,_4,_5,?,?>>,BoundedBifunctor<_6,_7,java.lang.Object,java.lang.Object,Tuple7<_1,_2,_3,_4,_5,?,?>>,Functor<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>,Monad<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>,MonadRec<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>,Traversable<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>,java.util.Map.Entry<_1,_2>
public class Tuple7<_1,_2,_3,_4,_5,_6,_7> extends HList.HCons<_1,Tuple6<_2,_3,_4,_5,_6,_7>> implements Product7<_1,_2,_3,_4,_5,_6,_7>, MonadRec<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>, Bifunctor<_6,_7,Tuple7<_1,_2,_3,_4,_5,?,?>>, Traversable<_7,Tuple7<_1,_2,_3,_4,_5,_6,?>>
A 7-element tuple product type, implemented as a specialized HList. Supports random access.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jnape.palatable.lambda.adt.hlist.HList
HList.HCons<Head,Tail extends HList>, HList.HNil
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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._5_5()Retrieve the fifth element._6_6()Retrieve the sixth element._7_7()Retrieve the seventh element.<_6Prime,_7Prime>
Tuple7<_1,_2,_3,_4,_5,_6Prime,_7Prime>biMap(Fn1<? super _6,? extends _6Prime> lFn, Fn1<? super _7,? extends _7Prime> rFn)Dually map covariantly over both the left and right parameters.<_6Prime> Tuple7<_1,_2,_3,_4,_5,_6Prime,_7>biMapL(Fn1<? super _6,? extends _6Prime> fn)Covariantly map over the left parameter.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>biMapR(Fn1<? super _7,? extends _7Prime> fn)Covariantly map over the right parameter.<_0> Tuple8<_0,_1,_2,_3,_4,_5,_6,_7>cons(_0 _0)Cons an element onto the front of this HList.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>discardL(Applicative<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>> appB)Sequence both thisApplicativeandappB, discarding thisApplicative'sresult and returningappB.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7>discardR(Applicative<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>> appB)Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative.static <A> Tuple7<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.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>flatMap(Fn1<? super _7,? extends Monad<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>>> f)Chain dependent computations that may continue or short-circuit based on previous results.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>fmap(Fn1<? super _7,? extends _7Prime> fn)Covariantly transmute this functor's parameter using the given mapping function.static <A> Maybe<Tuple7<A,A,A,A,A,A,A>>fromIterable(java.lang.Iterable<A> as)Tuple6<_1,_2,_3,_4,_5,_6>init()Tuple7<_2,_1,_3,_4,_5,_6,_7>invert()Rotate the first two slots of this product.<_7Prime> Lazy<Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>>lazyZip(Lazy<? extends Applicative<Fn1<? super _7,? extends _7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>>> lazyAppFn)Given alazyinstance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>pure(_7Prime _7Prime)Lift the valuebinto this applicative functor.static <_1,_2,_3,_4,_5,_6>
Pure<Tuple7<_1,_2,_3,_4,_5,_6,?>>pureTuple(_1 _1, _2 _2, _3 _3, _4 _4, _5 _5, _6 _6)Tuple7<_2,_3,_1,_4,_5,_6,_7>rotateL3()Rotate the first three values of this product one slot to the left.Tuple7<_2,_3,_4,_1,_5,_6,_7>rotateL4()Rotate the first four values of this product one slot to the left.Tuple7<_2,_3,_4,_5,_1,_6,_7>rotateL5()Rotate the first five values of this product one slot to the left.Tuple7<_2,_3,_4,_5,_6,_1,_7>rotateL6()Rotate the first six values of this product one slot to the left.Tuple7<_2,_3,_4,_5,_6,_7,_1>rotateL7()Rotate the first seven values of this product one slot to the left.Tuple7<_3,_1,_2,_4,_5,_6,_7>rotateR3()Rotate the first three values of this product one slot to the right.Tuple7<_4,_1,_2,_3,_5,_6,_7>rotateR4()Rotate the first four values of this product one slot to the right.Tuple7<_5,_1,_2,_3,_4,_6,_7>rotateR5()Rotate the first five values of this product one slot to the right.Tuple7<_6,_1,_2,_3,_4,_5,_7>rotateR6()Rotate the first six values of this product one slot to the right.Tuple7<_7,_1,_2,_3,_4,_5,_6>rotateR7()Rotate the first seven values of this product one slot to the right.<_8> Tuple8<_1,_2,_3,_4,_5,_6,_7,_8>snoc(_8 _8)Snoc an element onto the back of thisTuple7.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>trampolineM(Fn1<? super _7,? extends MonadRec<RecursiveResult<_7,_7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>>> fn)Given some operation yielding aRecursiveResultinside thisMonadRec, internally trampoline the operation until it yields aterminationinstruction.<_7Prime,App extends Applicative<?,App>,TravB extends Traversable<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>>,AppTrav extends Applicative<TravB,App>>
AppTravtraverse(Fn1<? super _7,? extends Applicative<_7Prime,App>> fn, Fn1<? super TravB,? extends AppTrav> pure)Applyfnto 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.<_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>zip(Applicative<Fn1<? super _7,? extends _7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>> appFn)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
-
-
-
-
Method Detail
-
cons
public <_0> Tuple8<_0,_1,_2,_3,_4,_5,_6,_7> cons(_0 _0)
Cons an element onto the front of this HList.
-
snoc
public <_8> Tuple8<_1,_2,_3,_4,_5,_6,_7,_8> snoc(_8 _8)
Snoc an element onto the back of thisTuple7.- Type Parameters:
_8- the new last element type- Parameters:
_8- the new last element- Returns:
- the new
Tuple8
-
_1
public _1 _1()
Retrieve the first element.
-
_2
public _2 _2()
Retrieve the second element.
-
_3
public _3 _3()
Retrieve the third element.
-
_4
public _4 _4()
Retrieve the fourth element.
-
_5
public _5 _5()
Retrieve the fifth element.
-
_6
public _6 _6()
Retrieve the sixth element.
-
_7
public _7 _7()
Retrieve the seventh element.
-
rotateL7
public Tuple7<_2,_3,_4,_5,_6,_7,_1> rotateL7()
Rotate the first seven values of this product one slot to the left.
-
rotateR7
public Tuple7<_7,_1,_2,_3,_4,_5,_6> rotateR7()
Rotate the first seven values of this product one slot to the right.
-
rotateL6
public Tuple7<_2,_3,_4,_5,_6,_1,_7> rotateL6()
Rotate the first six values of this product one slot to the left.
-
rotateR6
public Tuple7<_6,_1,_2,_3,_4,_5,_7> rotateR6()
Rotate the first six values of this product one slot to the right.
-
rotateL5
public Tuple7<_2,_3,_4,_5,_1,_6,_7> rotateL5()
Rotate the first five values of this product one slot to the left.
-
rotateR5
public Tuple7<_5,_1,_2,_3,_4,_6,_7> rotateR5()
Rotate the first five values of this product one slot to the right.
-
rotateL4
public Tuple7<_2,_3,_4,_1,_5,_6,_7> rotateL4()
Rotate the first four values of this product one slot to the left.- Specified by:
rotateL4in interfaceProduct4<_1,_2,_3,_4>- Specified by:
rotateL4in interfaceProduct5<_1,_2,_3,_4,_5>- Specified by:
rotateL4in interfaceProduct6<_1,_2,_3,_4,_5,_6>- Specified by:
rotateL4in interfaceProduct7<_1,_2,_3,_4,_5,_6,_7>- Returns:
- the left-rotated product
-
rotateR4
public Tuple7<_4,_1,_2,_3,_5,_6,_7> rotateR4()
Rotate the first four values of this product one slot to the right.- Specified by:
rotateR4in interfaceProduct4<_1,_2,_3,_4>- Specified by:
rotateR4in interfaceProduct5<_1,_2,_3,_4,_5>- Specified by:
rotateR4in interfaceProduct6<_1,_2,_3,_4,_5,_6>- Specified by:
rotateR4in interfaceProduct7<_1,_2,_3,_4,_5,_6,_7>- Returns:
- the right-rotated product
-
rotateL3
public Tuple7<_2,_3,_1,_4,_5,_6,_7> rotateL3()
Rotate the first three values of this product one slot to the left.- Specified by:
rotateL3in interfaceProduct3<_1,_2,_3>- Specified by:
rotateL3in interfaceProduct4<_1,_2,_3,_4>- Specified by:
rotateL3in interfaceProduct5<_1,_2,_3,_4,_5>- Specified by:
rotateL3in interfaceProduct6<_1,_2,_3,_4,_5,_6>- Specified by:
rotateL3in interfaceProduct7<_1,_2,_3,_4,_5,_6,_7>- Returns:
- the left-rotated product
-
rotateR3
public Tuple7<_3,_1,_2,_4,_5,_6,_7> rotateR3()
Rotate the first three values of this product one slot to the right.- Specified by:
rotateR3in interfaceProduct3<_1,_2,_3>- Specified by:
rotateR3in interfaceProduct4<_1,_2,_3,_4>- Specified by:
rotateR3in interfaceProduct5<_1,_2,_3,_4,_5>- Specified by:
rotateR3in interfaceProduct6<_1,_2,_3,_4,_5,_6>- Specified by:
rotateR3in interfaceProduct7<_1,_2,_3,_4,_5,_6,_7>- Returns:
- the right-rotated product
-
invert
public Tuple7<_2,_1,_3,_4,_5,_6,_7> invert()
Rotate the first two slots of this product.- Specified by:
invertin interfaceProduct2<_1,_2>- Specified by:
invertin interfaceProduct3<_1,_2,_3>- Specified by:
invertin interfaceProduct4<_1,_2,_3,_4>- Specified by:
invertin interfaceProduct5<_1,_2,_3,_4,_5>- Specified by:
invertin interfaceProduct6<_1,_2,_3,_4,_5,_6>- Specified by:
invertin interfaceProduct7<_1,_2,_3,_4,_5,_6,_7>- Returns:
- the rotated product
-
fmap
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> fmap(Fn1<? super _7,? extends _7Prime> fn)
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:
fmapin interfaceApplicative<_1,_2>- Specified by:
fmapin interfaceFunctor<_1,_2>- Specified by:
fmapin interfaceMonad<_1,_2>- Specified by:
fmapin interfaceMonadRec<_1,_2>- Specified by:
fmapin interfaceTraversable<_1,_2>- Type Parameters:
_7Prime- the new parameter type- Parameters:
fn- the mapping function- Returns:
- a functor over B (the new parameter type)
-
biMapL
public <_6Prime> Tuple7<_1,_2,_3,_4,_5,_6Prime,_7> biMapL(Fn1<? super _6,? extends _6Prime> fn)
Covariantly map over the left parameter.- Specified by:
biMapLin interfaceBifunctor<_1,_2,_3>- Specified by:
biMapLin interfaceBoundedBifunctor<_1,_2,_3,_4,_5>- Type Parameters:
_6Prime- the new left parameter type- Parameters:
fn- the mapping function- Returns:
- a bifunctor over C (the new left parameter) and B (the same right parameter)
-
biMapR
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> biMapR(Fn1<? super _7,? extends _7Prime> fn)
Covariantly map over the right parameter. For all bifunctors that are also functors, it should hold thatbiMapR(f) == fmap(f).- Specified by:
biMapRin interfaceBifunctor<_1,_2,_3>- Specified by:
biMapRin interfaceBoundedBifunctor<_1,_2,_3,_4,_5>- Type Parameters:
_7Prime- 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 <_6Prime,_7Prime> Tuple7<_1,_2,_3,_4,_5,_6Prime,_7Prime> biMap(Fn1<? super _6,? extends _6Prime> lFn, Fn1<? super _7,? extends _7Prime> rFn)
Dually map covariantly over both the left and right parameters. This is isomorphic tobiMapL(lFn).biMapR(rFn).- Specified by:
biMapin interfaceBifunctor<_1,_2,_3>- Specified by:
biMapin interfaceBoundedBifunctor<_1,_2,_3,_4,_5>- Type Parameters:
_6Prime- the new left parameter type_7Prime- 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
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> pure(_7Prime _7Prime)
Lift the valuebinto this applicative functor.- Specified by:
purein interfaceApplicative<_1,_2>- Specified by:
purein interfaceMonad<_1,_2>- Specified by:
purein interfaceMonadRec<_1,_2>- Type Parameters:
_7Prime- the type of the returned applicative's parameter- Parameters:
_7Prime- the value- Returns:
- an instance of this applicative over b
-
zip
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> zip(Applicative<Fn1<? super _7,? extends _7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>> 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 <_7Prime> Lazy<Tuple7<_1,_2,_3,_4,_5,_6,_7Prime>> lazyZip(Lazy<? extends Applicative<Fn1<? super _7,? extends _7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>>> lazyAppFn)
Given alazyinstance 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:
lazyZipin interfaceApplicative<_1,_2>- Specified by:
lazyZipin interfaceMonad<_1,_2>- Specified by:
lazyZipin interfaceMonadRec<_1,_2>- Type Parameters:
_7Prime- the resulting applicative parameter type- Parameters:
lazyAppFn- the lazy other applicative instance- Returns:
- the mapped applicative
- See Also:
Maybe,Either
-
discardL
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> discardL(Applicative<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>> appB)
Sequence both thisApplicativeandappB, discarding thisApplicative'sresult and returningappB. This is generally useful for sequentially performing side-effects.
-
discardR
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7> discardR(Applicative<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>> appB)
Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative. This is generally useful for sequentially performing side-effects.
-
flatMap
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> flatMap(Fn1<? super _7,? extends Monad<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>>> f)
Chain dependent computations that may continue or short-circuit based on previous results.
-
trampolineM
public <_7Prime> Tuple7<_1,_2,_3,_4,_5,_6,_7Prime> trampolineM(Fn1<? super _7,? extends MonadRec<RecursiveResult<_7,_7Prime>,Tuple7<_1,_2,_3,_4,_5,_6,?>>> fn)
Given some operation yielding aRecursiveResultinside thisMonadRec, internally trampoline the operation until it yields aterminationinstruction.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:
trampolineMin interfaceMonadRec<_1,_2>- Type Parameters:
_7Prime- the ultimate resulting carrier type- Parameters:
fn- the function to internally trampoline- Returns:
- the trampolined
MonadRec - See Also:
for a basic implementation,for a implementation,for an implementation leveraging an already stack-safe,for a implementation
-
traverse
public <_7Prime,App extends Applicative<?,App>,TravB extends Traversable<_7Prime,Tuple7<_1,_2,_3,_4,_5,_6,?>>,AppTrav extends Applicative<TravB,App>> AppTrav traverse(Fn1<? super _7,? extends Applicative<_7Prime,App>> fn, Fn1<? super TravB,? extends AppTrav> pure)
Applyfnto 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:
traversein interfaceTraversable<_1,_2>- Type Parameters:
_7Prime- 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
public Tuple6<_1,_2,_3,_4,_5,_6> init()
Returns aof all the elements of thisTuple6<_1, _2, _3, _4, _5, _6>except the last.Tuple7<_1, _2, _3, _4, _5, _6, _7>- Returns:
- The
Tuple6<_1, _2, _3, _4, _5, _6> representing all but the last element
-
fill
public static <A> Tuple7<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.- Type Parameters:
A- the value type- Parameters:
a- the value to fill the tuple with- Returns:
- the filled tuple
- See Also:
Tuple2.fill(A)
-
fromIterable
public static <A> Maybe<Tuple7<A,A,A,A,A,A,A>> fromIterable(java.lang.Iterable<A> as)
Returnjustthe first seven elements from the givenIterable, ornothingif there are less than seven elements.- Type Parameters:
A- theIterableelement type- Parameters:
as- theIterable- Returns:
Maybethe first seven elements of the givenIterable
-
pureTuple
public static <_1,_2,_3,_4,_5,_6> Pure<Tuple7<_1,_2,_3,_4,_5,_6,?>> pureTuple(_1 _1, _2 _2, _3 _3, _4 _4, _5 _5, _6 _6)
- 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- 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- Returns:
- the
Pureinstance
-
-