Module std::tuple

Tuples. The type (A, B) is [Tuple2<A, B>], up to (A, B, C, D, E, F), Tuple6: the surface writes (a, b) for a literal, t.0 for a field and (x, y) for a pattern, and every program loads this module, so none of those needs a use. A tuple is copy, forget or linear as its components are, and compares, orders and hashes field by field where its components do (std::cmp's derives), clones where they clone (std::clone), and std::string prints it as (a, b).

Source: std/tuple.weir; committed interface: std/tuple.iface. Index

struct Tuple2

pub struct Tuple2<A: linear, B: linear>: forget copy {
    pub _0: A,
    pub _1: B,
}

Two values: the type (A, B), fields t.0 and t.1.

Fields:

Implementations:

struct Tuple3

pub struct Tuple3<A: linear, B: linear, C: linear>: forget copy {
    pub _0: A,
    pub _1: B,
    pub _2: C,
}

Three values: the type (A, B, C).

Fields:

Implementations:

struct Tuple4

pub struct Tuple4<A: linear, B: linear, C: linear, D: linear>: forget copy {
    pub _0: A,
    pub _1: B,
    pub _2: C,
    pub _3: D,
}

Four values: the type (A, B, C, D).

Fields:

Implementations:

struct Tuple5

pub struct Tuple5<A: linear, B: linear, C: linear, D: linear, E: linear>: forget copy {
    pub _0: A,
    pub _1: B,
    pub _2: C,
    pub _3: D,
    pub _4: E,
}

Five values: the type (A, B, C, D, E).

Fields:

Implementations:

struct Tuple6

pub struct Tuple6<A: linear, B: linear, C: linear, D: linear, E: linear, F: linear>: forget copy {
    pub _0: A,
    pub _1: B,
    pub _2: C,
    pub _3: D,
    pub _4: E,
    pub _5: F,
}

Six values: the type (A, B, C, D, E, F).

Fields:

Implementations: