Pair

Noun · Development

Definitions

  1. A simple composite data structure that holds exactly two values, often of different types — called `Pair<A, B>` in Kotlin, `std::pair` in C++, or a 2-tuple in Python and Haskell. Commonly used to return two related values from a function without defining a full struct or class.

    In plain English: A tiny container that bundles exactly two values together, like a key and its associated value.

    Example: "The function returns a pair of the parsed config and a list of warnings, so callers can decide whether to surface the warnings to the user."

Related Terms