Tuple2<T1, T2> class
Tuple2<T1, T2>
is a type that contains a value of type T1
and a value of type T2
.
Used to avoid creating a custom class that contains two different types or to return two values from one function.
Properties
Methods
-
all(
bool predicate(T2 a)) → bool -
Return the result of calling
predicate
on the second value of the Tuple2.override -
any(
bool predicate(T2 a)) → bool -
Return the result of calling
predicate
on the second value of the Tuple2.override -
apply<
A> (A f(T1 first, T2 second)) → A -
Return result of calling
f
givenvalue1
andvalue2
from thisTuple
. -
bimap<
C, D> (C mFirst(T1 a), D mSecond(T2 b)) → Tuple2< C, D> -
Change type of both values of the
Tuple
. -
concatenate(
Monoid< T2> monoid) → T2 -
Combine the second value of Tuple2 using
monoid
.override -
copyWith(
{T1? value1, T2? value2}) → Tuple2< T1, T2> -
Create a copy of this
Tuple
by changingvalue1
and/orvalue2
. -
duplicate(
) → Tuple2< T1, Tuple2< T1, T2> > -
Wrap this
Tuple2
inside anotherTuple2
.override -
extend<
Z> (Z f(Tuple2< T1, T2> t)) → Tuple2<T1, Z> -
Convert the second value of the Tuple2 from
T2
toZ
usingf
.override -
extendFirst<
Z> (Z f(Tuple2< T1, T2> t)) → Tuple2<Z, T2> -
Convert the first value of the Tuple2 from
T1
toZ
usingf
. -
foldLeft<
C> (C b, C f(C b, T2 a)) → C -
Return value of type
C
by callingf
withb
and the second value of the Tuple2.override -
foldLeftFirst<
C> (C b, C f(C b, T1 a)) → C -
Return value of type
C
by callingf
withb
and the first value of the Tuple2. -
foldLeftFirstWithIndex<
C> (C c, C f(int i, C c, T1 b)) → C -
Return value of type
C
by callingf
withb
and the first value of the Tuple2. -
foldLeftWithIndex<
C> (C c, C f(int i, C acc, T2 b)) → C -
Return value of type
C
by callingf
withb
and the second value of the Tuple2.override -
foldMap<
C> (Monoid< C> monoid, C f(T2 a)) → C -
Return value of type
C
by applyingf
onmonoid
.override -
foldMapFirst<
C> (Monoid< C> monoid, C f(T1 a)) → C -
Return value of type
C
by applyingf
onmonoid
. -
foldRight<
C> (C b, C f(C acc, T2 a)) → C -
Return value of type
C
by callingf
withb
and the second value of the Tuple2.override -
foldRightFirst<
C> (C b, C f(C acc, T1 a)) → C -
Return value of type
C
by callingf
withb
and the first value of the Tuple2. -
foldRightFirstWithIndex<
C> (C c, C f(int i, C c, T1 b)) → C -
Return value of type
C
by callingf
withb
and the first value of the Tuple2. -
foldRightWithIndex<
C> (C c, C f(int i, C acc, T2 b)) → C -
Return value of type
C
by callingf
withb
and the second value of the Tuple2.override -
length(
) → int -
Returns
1
.override -
map<
C> (C f(T2 a)) → Tuple2< T1, C> -
Change type of second value of the
Tuple
fromT2
toC
usingf
.override -
mapBoth<
C, D> (Tuple2< C, D> f(T1 first, T2 second)) → Tuple2<C, D> -
Change type of both values of the
Tuple
usingf
. -
mapFirst<
TN> (TN f(T1 first)) → Tuple2< TN, T2> -
Change type of first value of the
Tuple
fromT1
toTN
usingf
. -
mapSecond<
TN> (TN f(T2 second)) → Tuple2< T1, TN> -
Change type of second value of the
Tuple
fromT2
toTN
usingf
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
swap(
) → Tuple2< T2, T1> -
Swap types
T1
andT2
of Tuple2. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override