Pairs

  • Pair of two values.

    Pair makes no assumptions about the equivalence of types, or order of the values contained herein.

    See more

    Declaration

    Swift

    public protocol Pair
  • A Pair in which the two values are of the same type.

    See more

    Declaration

    Swift

    public protocol SymmetricPair : Pair where Self.A == Self.B
  • A SymmetricPair whose values can be interchanged.

    See more

    Declaration

    Swift

    public protocol SwappablePair : SymmetricPair
  • Pair of two values with potentially different types.

    See more

    Declaration

    Swift

    public struct Cross<T, U> : Pair
    extension Cross: CustomStringConvertible
    extension Cross: Comparable where T: Comparable, U: Comparable
    extension Cross: Equatable where T: Equatable, U: Equatable
    extension Cross: Hashable where T: Hashable, U: Hashable
    extension Cross: Codable where T: Codable, U: Codable
  • Pair of two values of the same type for which the order of the values is not meaningful.

    See more

    Declaration

    Swift

    public struct UnorderedPair<T> : SymmetricPair
    extension UnorderedPair: CustomStringConvertible
    extension UnorderedPair: Equatable where T: Equatable
    extension UnorderedPair: Hashable where T: Hashable
    extension UnorderedPair: Codable where T: Codable
  • Pair of two values of the same type for which the order of the values is meaningful.

    See more

    Declaration

    Swift

    public struct OrderedPair<T> : SwappablePair
    extension OrderedPair: CustomStringConvertible
    extension OrderedPair: Equatable where T: Equatable
    extension OrderedPair: Hashable where T: Hashable
    extension OrderedPair: Codable where T: Codable