0001    /// :nodoc:
0002    public struct NilPaddedZipGenerator
Zip.swift:22
  public func generate() -> NilPaddedZipGenerator<S0.Generator, S1.Generator> {
Zip.swift:23
    return NilPaddedZipGenerator(g0: s0.generate(), g1: s1.generate())
Zip.swift:47
  private var g: NilPaddedZipGenerator<G0, G1>
Zip.swift:63
      g: NilPaddedZipGenerator(
<G0
Zip.swift:4
  private var (g0, g1): (G0?, G1?)
Zip.swift:6
  public mutating func next() -> (G0.Element?, G1.Element?)? {
: GeneratorType, G1
Zip.swift:4
  private var (g0, g1): (G0?, G1?)
Zip.swift:6
  public mutating func next() -> (G0.Element?, G1.Element?)? {
: GeneratorType> : GeneratorType { 0003 0004 private var (g0
Zip.swift:7
    let (e0,e1) = (g0?.next(),g1?.next())
Zip.swift:11
    case (nil,  _): g0 = nil
, g1
Zip.swift:7
    let (e0,e1) = (g0?.next(),g1?.next())
Zip.swift:10
    case (  _,nil): g1 = nil
): (G0?, G1?) 0005 0006 public mutating func next
Zip.swift:51
    guard let (e0,e1) = g.next() else { return nil }
() -> (G0.Element?, G1.Element?)? { 0007 let (e0,e1) = (g0?.next(),g1?.next()) 0008 switch (e0,e1) { 0009 case (nil,nil): return nil 0010 case ( _,nil): g1 = nil 0011 case (nil, _): g0 = nil 0012 default: break 0013 } 0014 return (e0,e1) 0015 } 0016 } 0017 /// :nodoc: 0018 public struct NilPaddedZip
Zip.swift:38
  -> NilPaddedZip<S0, S1> {
Zip.swift:39
    return NilPaddedZip(s0: s0, s1: s1)
<S0
Zip.swift:20
  private let (s0, s1): (S0, S1)
Zip.swift:22
  public func generate() -> NilPaddedZipGenerator<S0.Generator, S1.Generator> {
: SequenceType, S1
Zip.swift:20
  private let (s0, s1): (S0, S1)
Zip.swift:22
  public func generate() -> NilPaddedZipGenerator<S0.Generator, S1.Generator> {
: SequenceType> : LazySequenceType { 0019 0020 private let (s0
Zip.swift:23
    return NilPaddedZipGenerator(g0: s0.generate(), g1: s1.generate())
, s1
Zip.swift:23
    return NilPaddedZipGenerator(g0: s0.generate(), g1: s1.generate())
): (S0, S1) 0021 /// :nodoc: 0022 public func generate() -> NilPaddedZipGenerator<S0.Generator, S1.Generator> { 0023 return NilPaddedZipGenerator(g0: s0.generate(), g1: s1.generate()) 0024 } 0025 } 0026 0027 /// A sequence of pairs built out of two underlying sequences, where the elements of the 0028 /// ith pair are optional ith elements of each underlying sequence. If one sequence is 0029 /// shorter than the other, pairs will continue to be returned after it is exhausted, but 0030 /// with its elements replaced by nil. 0031 /// ```swift 0032 /// zipWithPadding([1, 2, 3], [1, 2]) 0033 /// 0034 /// (1?, 1?), (2?, 2?), (3?, nil) 0035 /// ``` 0036 @warn_unused_result 0037 public func zipWithPadding<S0: SequenceType, S1: SequenceType>(s0: S0, _ s1: S1) 0038 -> NilPaddedZip<S0, S1> { 0039 return NilPaddedZip(s0: s0, s1: s1) 0040 } 0041 /// :nodoc: 0042 public struct PaddedZipGenerator
Zip.swift:61
  public func generate() -> PaddedZipGenerator<S0.Generator, S1.Generator> {
Zip.swift:62
    return PaddedZipGenerator(
<G0
Zip.swift:44
  typealias E0 = G0.Element
Zip.swift:47
  private var g: NilPaddedZipGenerator<G0, G1>
: GeneratorType, G1
Zip.swift:45
  typealias E1 = G1.Element
Zip.swift:47
  private var g: NilPaddedZipGenerator<G0, G1>
: GeneratorType> : GeneratorType { 0043 0044 typealias E0
Zip.swift:48
  private let (p0, p1): (E0, E1)
Zip.swift:50
  public mutating func next() -> (E0, E1)? {
= G0.Element 0045 typealias E1
Zip.swift:48
  private let (p0, p1): (E0, E1)
Zip.swift:50
  public mutating func next() -> (E0, E1)? {
= G1.Element 0046 0047 private var g
Zip.swift:51
    guard let (e0,e1) = g.next() else { return nil }
: NilPaddedZipGenerator<G0, G1> 0048 private let (p0
Zip.swift:52
    return (e0 ?? p0, e1 ?? p1)
, p1
Zip.swift:52
    return (e0 ?? p0, e1 ?? p1)
): (E0, E1) 0049 0050 public mutating func next() -> (E0, E1)? { 0051 guard let (e0,e1) = g.next() else { return nil } 0052 return (e0 ?? p0, e1 ?? p1) 0053 } 0054 } 0055 /// :nodoc: 0056 public struct PaddedZip
Zip.swift:88
  -> PaddedZip<S0, S1> {
Zip.swift:89
    return PaddedZip(s0: s0, s1: s1, p0: pad0, p1: pad1)
<S0
Zip.swift:58
  private let (s0, s1): (S0, S1)
Zip.swift:59
  private let (p0, p1): (S0.Generator.Element, S1.Generator.Element)
Zip.swift:61
  public func generate() -> PaddedZipGenerator<S0.Generator, S1.Generator> {
: SequenceType, S1
Zip.swift:58
  private let (s0, s1): (S0, S1)
Zip.swift:59
  private let (p0, p1): (S0.Generator.Element, S1.Generator.Element)
Zip.swift:61
  public func generate() -> PaddedZipGenerator<S0.Generator, S1.Generator> {
: SequenceType> : LazySequenceType { 0057 0058 private let (s0
Zip.swift:64
        g0: s0.generate(),
, s1
Zip.swift:65
        g1: s1.generate()
): (S0, S1) 0059 private let (p0
Zip.swift:67
      p0: p0,
, p1
Zip.swift:68
      p1: p1
): (S0.Generator.Element, S1.Generator.Element) 0060 /// :nodoc: 0061 public func generate() -> PaddedZipGenerator<S0.Generator, S1.Generator> { 0062 return PaddedZipGenerator( 0063 g: NilPaddedZipGenerator( 0064 g0: s0.generate(), 0065 g1: s1.generate() 0066 ), 0067 p0: p0, 0068 p1: p1 0069 ) 0070 } 0071 } 0072 0073 /// A sequence of pairs built out of two underlying sequences, where the elements of the 0074 /// ith pair are the ith elements of each underlying sequence. If one sequence is 0075 /// shorter than the other, pairs will continue to be returned after it is exhausted, but 0076 /// with its elements replaced by its respective pad. 0077 /// - Parameter pad0: the element to pad `s0` with after it is exhausted 0078 /// - Parameter pad1: the element to pad `s1` with after it is exhausted 0079 /// ```swift 0080 /// zipWithPadding([1, 2, 3], [1, 2], pad0: 100, pad1: 900) 0081 /// 0082 /// (1, 1), (2, 2), (3, 900) 0083 /// ``` 0084 @warn_unused_result 0085 public func zipWithPadding< 0086 S0: SequenceType, S1: SequenceType 0087 >(s0: S0, _ s1: S1, pad0: S0.Generator.Element, pad1: S1.Generator.Element) 0088 -> PaddedZip<S0, S1> { 0089 return PaddedZip(s0: s0, s1: s1, p0: pad0, p1: pad1) 0090 } 0091