Tuple

/ˈtʌp.əl/ · Noun · Development

Definitions

  1. A fixed-size, ordered collection of elements where each position can hold a different type. Unlike arrays or lists, tuples are typically immutable and their length and per-position types are known at compile time — making them ideal for returning multiple values from a function or representing heterogeneous records like (latitude, longitude).

    In plain English: A small, fixed-size group of values bundled together, like a row with a specific number of columns that cannot change.

    Example: "The function returns a tuple of (user, error) so the caller can pattern-match on both."

Related Terms