Skip to content

Commit

Permalink
Fix/missing zip with public declaration (#26)
Browse files Browse the repository at this point in the history
* create tests to prove the error

* make all existing zip(with:) function public

* add zip2(with:)
  • Loading branch information
FredericRuaudel authored and stephencelis committed Oct 23, 2018
1 parent 5e2b582 commit d748c13
Show file tree
Hide file tree
Showing 2 changed files with 469 additions and 8 deletions.
27 changes: 19 additions & 8 deletions Sources/Overture/ZipSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,18 @@ public struct Zip3Sequence<
}
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C
>(
with f: @escaping (A.Element, B.Element) -> C
)
-> (A, B) -> [C] {
return { zip($0, $1).map(f) }
}

public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -174,7 +185,7 @@ func zip<
return { zip($0, $1, $2).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -187,7 +198,7 @@ func zip<
return { zip($0, $1, $2, $3).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -201,7 +212,7 @@ func zip<
return { zip($0, $1, $2, $3, $4).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -216,7 +227,7 @@ func zip<
return { zip($0, $1, $2, $3, $4, $5).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -232,7 +243,7 @@ func zip<
return { zip($0, $1, $2, $3, $4, $5, $6).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -249,7 +260,7 @@ func zip<
return { zip($0, $1, $2, $3, $4, $5, $6, $7).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand All @@ -267,7 +278,7 @@ func zip<
return { zip($0, $1, $2, $3, $4, $5, $6, $7, $8).map(f) }
}

func zip<
public func zip<
A: Sequence,
B: Sequence,
C: Sequence,
Expand Down
Loading

0 comments on commit d748c13

Please sign in to comment.