Pair

public protocol Pair

Pair of two values.

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

Associated Types

  • A

    The type of the first value contained herein.

    Declaration

    Swift

    associatedtype A
  • B

    The type of the second value contained herein.

    Declaration

    Swift

    associatedtype B

Instance Properties

  • a

    The first value contained herein.

    Declaration

    Swift

    var a: A { get }
  • b

    The second value contained herein.

    Declaration

    Swift

    var b: B { get }

Initializers

  • Creates a Pair with the given values.

    Declaration

    Swift

    init(_ a: A, _ b: B)

Instance Methods

  • map(_:) Extension method

    Declaration

    Swift

    public func map<P, C, D>(_ f: (A, B) -> (C, D)) -> P where P : Pair, C == P.A, D == P.B

    Return Value

    A Pair with its members transformed by the given function.