Zip

  • Undocumented

    See more

    Declaration

    Swift

    public struct Zip3Sequence <
        Sequence1: Sequence,
        Sequence2: Sequence,
        Sequence3: Sequence
    >: IteratorProtocol, Sequence
  • Lazy sequence zipping two Sequence values together to the longest of the two sequences, filling in the others with the given fill1, and fill2 values.

    See more

    Declaration

    Swift

    public struct ZipToLongest2Sequence <Sequence1: Sequence, Sequence2: Sequence>
        : IteratorProtocol, Sequence
  • Lazy sequence zipping three Sequence values together to the longest of the three sequences, filling in the others with the given fill1, fill2, and fill3 values.

    See more

    Declaration

    Swift

    public struct ZipToLongest3Sequence <Sequence1: Sequence, Sequence2: Sequence, Sequence3: Sequence>
        : IteratorProtocol, Sequence
  • Invariant

    a and b are the same shape.

    Declaration

    Swift

    @inlinable
    public func zip<T, U, V>(_ a: Tree<T, T>, _ b: Tree<U, U>, _ f: (T, U) -> V) -> Tree<V, V>

    Return Value

    A new Tree resulting from applying the given function f to each corresponding node in the given trees a and b.

  • Lazy Sequence zipping three Sequence values together.

    Note

    This should be deprecated when Variadic Generics are implemented in Swift. As outlined in the Generics Manifesto

    Modified by James Bean.

    Declaration

    Swift

    @inlinable
    public func zip <Sequence1,Sequence2,Sequence3> (
        _ sequence1: Sequence1,
        _ sequence2: Sequence2,
        _ sequence3: Sequence3
    ) -> Zip3Sequence<Sequence1,Sequence2,Sequence3>
  • Declaration

    Swift

    public func zip <Sequence1,Sequence2> (
        _ sequence1: Sequence1,
        _ sequence2: Sequence2,
        fill1: Sequence1.Element,
        fill2: Sequence2.Element
    ) -> ZipToLongest2Sequence<Sequence1,Sequence2>

    Return Value

    A ZipToLongest2Sequence for the two given sequences, using fill1 and fill2 as default values if the other sequence is longer.

  • Declaration

    Swift

    public func zip <Sequence1,Sequence2> (
        _ sequence1: Sequence1,
        _ sequence2: Sequence2,
        fill: Sequence1.Element
    ) -> ZipToLongest2Sequence<Sequence1,Sequence2>
        where Sequence1.Element == Sequence2.Element

    Return Value

    A ZipToLongest2Sequence for the two given sequences, using fill and fill as default values if the other sequence is longer.

  • Declaration

    Swift

    public func zip <Sequence1,Sequence2,Sequence3> (
        _ sequence1: Sequence1,
        _ sequence2: Sequence2,
        _ sequence3: Sequence3,
        fill1: Sequence1.Element,
        fill2: Sequence2.Element,
        fill3: Sequence3.Element
    ) -> ZipToLongest3Sequence<Sequence1,Sequence2,Sequence3>

    Return Value

    A ZipToLongest3Sequence for the three given sequences, using firstFill, secondFill, and thirdFill as default values if the other sequences are longer.

  • Declaration

    Swift

    public func zip <Sequence1,Sequence2,Sequence3> (
        _ sequence1: Sequence1,
        _ sequence2: Sequence2,
        _ sequence3: Sequence3,
        fill: Sequence1.Element
    ) -> ZipToLongest3Sequence<Sequence1,Sequence2,Sequence3>
        where Sequence1.Element == Sequence2.Element, Sequence2.Element == Sequence3.Element

    Return Value

    A ZipToLongest3Sequence for the three given sequences, using fill as a default value if the other sequences are longer.