A type that holds two values; essentially a 2-Tuple. Can be used with structure syntax.

abc.with(123) == { _1: abc, _2: 123 } == new Pair(abc, 123)

Static methods

staticinlineapply<A, B, Z>(t:Pair<A, B>, fn:(A, B) ‑> Z):Z

Applies a function to a Pair of values

staticinlineapply2<A, B, Z>(fn:(A, B) ‑> Z, t:Pair<A, B>):Z

Applies a function to a Pair of values

staticinlineapply2c<A, B, Z>(fn:A ‑> B ‑> Z, t:Pair<A, B>):Z

Applies a curried function to a Pair of values

staticinlineeval<A, Z>(t:Pair<A ‑> Z, A>):Z

Given a Pair of a function and a value, apply the function to the value

staticflip<A, B>(t:Pair<A, B>):Pair<B, A>

Swaps the order of values in a Pair

staticinlinefst<A>(tup:{_1:A}):A

Returns the first element of a Pair

staticmap_1<A, B, Z>(t:Pair<A, B>, fn:A ‑> Z):Pair<Z, B>

Applies a function to the first value in a Pair

Returns:

A new Pair with fn applied

staticmap_2<A, B, Z>(t:Pair<A, B>, fn:B ‑> Z):Pair<A, Z>

Applies a function to the second value in a Pair

Returns:

A new Pair with fn applied

staticinlinesnd<A>(tup:{_2:A}):A

Returns the second element of a Pair

staticinlinetoKeyValue<A, B>(t:Pair<A, B>):KeyValuePair<A, B>

Converts a Pair to a KeyValuePair, using Pair._1 as the key and Pair._2 as the value

staticinlinewith<A, B>(a:A, b:B):Pair<A, B>

Constructs a new Pair with a and b as the values

Constructor

new(_1:X, _2:Y)

Variables

final_1:X

final_2:Y