@@ -36,10 +36,10 @@ equivalenceExplanation = """\
36
36
/// is, for any elements `a`, `b`, and `c`, the following conditions must
37
37
/// hold:
38
38
///
39
- /// - `isEquivalent (a, a)` is always `true`. (Reflexivity)
40
- /// - `isEquivalent (a, b)` implies `isEquivalent (b, a)`. (Symmetry)
41
- /// - If `isEquivalent (a, b)` and `isEquivalent (b, c)` are both `true`, then
42
- /// `isEquivalent (a, c)` is also `true`. (Transitivity)
39
+ /// - `areEquivalent (a, a)` is always `true`. (Reflexivity)
40
+ /// - `areEquivalent (a, b)` implies `areEquivalent (b, a)`. (Symmetry)
41
+ /// - If `areEquivalent (a, b)` and `areEquivalent (b, c)` are both `true`, then
42
+ /// `areEquivalent (a, c)` is also `true`. (Transitivity)
43
43
/// """
44
44
45
45
} %
@@ -209,7 +209,7 @@ extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} {
209
209
${equivalenceExplanation}
210
210
/// - Parameters:
211
211
/// - possiblePrefix: A sequence to compare to this sequence.
212
- /// - isEquivalent : A predicate that returns `true` if its two arguments
212
+ /// - areEquivalent : A predicate that returns `true` if its two arguments
213
213
/// are equivalent; otherwise, `false`.
214
214
/// - Returns: `true` if the initial elements of the sequence are equivalent
215
215
/// to the elements of `possiblePrefix`; otherwise, `false`. Returns
@@ -235,12 +235,12 @@ ${equivalenceExplanation}
235
235
/// the elements of `possiblePrefix`; otherwise, `false`. Returns `true`
236
236
/// if `possiblePrefix` has no elements.
237
237
///
238
- /// - SeeAlso: `starts(with:isEquivalent :)`
238
+ /// - SeeAlso: `starts(with:comparingBy :)`
239
239
% end
240
240
public func starts< PossiblePrefix> (
241
241
with possiblePrefix: PossiblePrefix ${ " , " if preds else " " }
242
242
% if preds:
243
- isEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
243
+ comparingBy areEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
244
244
% end
245
245
) ${rethrows_}-> Bool
246
246
where
@@ -250,7 +250,7 @@ ${equivalenceExplanation}
250
250
var possiblePrefixIterator = possiblePrefix.makeIterator()
251
251
for e0 in self {
252
252
if let e1 = possiblePrefixIterator.next() {
253
- if ${ " try !is Equivalent ( e0, e1) " if preds else " e0 != e1" } {
253
+ if ${ " try ! areEquivalent ( e0, e1) " if preds else " e0 != e1" } {
254
254
return false
255
255
}
256
256
}
@@ -285,10 +285,10 @@ extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} {
285
285
${equivalenceExplanation}
286
286
/// - Parameters:
287
287
/// - other: A sequence to compare to this sequence.
288
- /// - isEquivalent : A predicate that returns `true` if its two arguments
288
+ /// - areEquivalent : A predicate that returns `true` if its two arguments
289
289
/// are equivalent; otherwise, `false`.
290
290
/// - Returns: `true` if this sequence and `other` contain equivalent items,
291
- /// using `isEquivalent ` as the equivalence test; otherwise, `false.`
291
+ /// using `areEquivalent ` as the equivalence test; otherwise, `false.`
292
292
///
293
293
/// - SeeAlso: `elementsEqual(_:)`
294
294
% else:
@@ -311,12 +311,12 @@ ${equivalenceExplanation}
311
311
/// - Returns: `true` if this sequence and `other` contain the same elements
312
312
/// in the same order.
313
313
///
314
- /// - SeeAlso: `elementsEqual(_:isEquivalent :)`
314
+ /// - SeeAlso: `elementsEqual(_:comparingBy :)`
315
315
% end
316
316
public func elementsEqual< OtherSequence> (
317
317
_ other: OtherSequence ${ " , " if preds else " " }
318
318
% if preds:
319
- isEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
319
+ comparingBy areEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
320
320
% end
321
321
) ${rethrows_}-> Bool
322
322
where
@@ -328,7 +328,7 @@ ${equivalenceExplanation}
328
328
while true {
329
329
switch (iter1.next(), iter2.next()) {
330
330
case let (e1?, e2?):
331
- if ${'try !isEquivalent (e1, e2)' if preds else 'e1 != e2'} {
331
+ if ${'try !areEquivalent (e1, e2)' if preds else 'e1 != e2'} {
332
332
return false
333
333
}
334
334
case (_?, nil),
@@ -692,9 +692,9 @@ extension Sequence {
692
692
Builtin . unreachable ( )
693
693
}
694
694
695
- @available ( * , unavailable, renamed: " starts " )
695
+ @available ( * , unavailable, renamed: " starts(with:comparingBy:) " )
696
696
public func startsWith< PossiblePrefix> (
697
- with possiblePrefix: PossiblePrefix ,
697
+ _ possiblePrefix: PossiblePrefix ,
698
698
isEquivalent: @noescape ( Iterator . Element, Iterator . Element) throws -> Bool
699
699
) rethrows -> Bool
700
700
where
@@ -728,9 +728,9 @@ extension Sequence where Iterator.Element : Comparable {
728
728
Builtin . unreachable ( )
729
729
}
730
730
731
- @available ( * , unavailable, renamed: " starts " )
731
+ @available ( * , unavailable, renamed: " starts(with:) " )
732
732
public func startsWith< PossiblePrefix> (
733
- with possiblePrefix: PossiblePrefix
733
+ _ possiblePrefix: PossiblePrefix
734
734
) -> Bool
735
735
where
736
736
PossiblePrefix : Sequence ,
0 commit comments