View source

abstract thx.Tuple2<T0, T1>({_1:T1, _0:T0}) from {_1:T1, _0:T0} to {_1:T1, _0:T0}

import thx.Tuple;

Available on all platforms

Tuple2 is a tuple with two values. It maps to an anonymous object with fields _0 and _1.

Class Fields

inline function arrayToTuple2<T>(v:Array<T>):Tuple2<T, T>

inline function of<A, B>(_0:A, _1:B):Tuple2<A, B>

Constructs an instance of Tuple2 the 2 required value. This is required because Tuple2.new.bind(...) crashes the compiler.

Instance Fields

var left(get,null):T0

Alias for _0.

var right(get,null):T1

Alias for _1.

inline function new(_0:T0, _1:T1):Tuple2<T0, T1>

Constructs an instance of Tuple2 the 2 required value.

inline function dropLeft():Tuple1<T1>

dropLeft returns a new Tuple with one less element by dropping the first on the left.

inline function dropRight():Tuple1<T0>

dropLeft returns a new Tuple with one less element by dropping the last on the right.

inline function flip():Tuple2<T1, T0>

flip returns a new Tuple with the values in reverse order.

function map<T2>(f:T1 -> T2):Tuple2<T0, T2>

inline function toString():String

Provides a string representation of the Tuple

inline function with<T2>(v:T2):Tuple3<T0, T1, T2>

Creates a new Tuple with the addition of the extra value v. The Tuple of course increase in size by one.