SymmetricPair

public protocol SymmetricPair : Pair where Self.A == Self.B

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

Instance Methods

  • map(_:) Extension method

    Declaration

    Swift

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

    Return Value

    A SymmetricPair with its members transformed by the given function.

Available where A: Equatable

  • contains(_:) Extension method

    Declaration

    Swift

    @inlinable
    public func contains(_ value: A) -> Bool

    Return Value

    true if one of the values contained herein is equivalent to the given value. Otherwise, false.