@@ -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
} %
@@ -211,7 +211,7 @@ extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} {
211
211
${equivalenceExplanation}
212
212
/// - Parameters:
213
213
/// - possiblePrefix: A sequence to compare to this sequence.
214
- /// - isEquivalent : A predicate that returns `true` if its two arguments
214
+ /// - areEquivalent : A predicate that returns `true` if its two arguments
215
215
/// are equivalent; otherwise, `false`.
216
216
/// - Returns: `true` if the initial elements of the sequence are equivalent
217
217
/// to the elements of `possiblePrefix`; otherwise, `false`. Returns
@@ -237,12 +237,12 @@ ${equivalenceExplanation}
237
237
/// the elements of `possiblePrefix`; otherwise, `false`. Returns `true`
238
238
/// if `possiblePrefix` has no elements.
239
239
///
240
- /// - SeeAlso: `starts(with:isEquivalent :)`
240
+ /// - SeeAlso: `starts(with:by :)`
241
241
% end
242
242
public func starts< PossiblePrefix> (
243
243
with possiblePrefix: PossiblePrefix ${ " , " if preds else " " }
244
244
% if preds:
245
- isEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
245
+ by areEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
246
246
% end
247
247
) ${rethrows_}-> Bool
248
248
where
@@ -252,7 +252,7 @@ ${equivalenceExplanation}
252
252
var possiblePrefixIterator = possiblePrefix.makeIterator()
253
253
for e0 in self {
254
254
if let e1 = possiblePrefixIterator.next() {
255
- if ${ " try !is Equivalent ( e0, e1) " if preds else " e0 != e1" } {
255
+ if ${ " try ! areEquivalent ( e0, e1) " if preds else " e0 != e1" } {
256
256
return false
257
257
}
258
258
}
@@ -287,10 +287,10 @@ extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} {
287
287
${equivalenceExplanation}
288
288
/// - Parameters:
289
289
/// - other: A sequence to compare to this sequence.
290
- /// - isEquivalent : A predicate that returns `true` if its two arguments
290
+ /// - areEquivalent : A predicate that returns `true` if its two arguments
291
291
/// are equivalent; otherwise, `false`.
292
292
/// - Returns: `true` if this sequence and `other` contain equivalent items,
293
- /// using `isEquivalent ` as the equivalence test; otherwise, `false.`
293
+ /// using `areEquivalent ` as the equivalence test; otherwise, `false.`
294
294
///
295
295
/// - SeeAlso: `elementsEqual(_:)`
296
296
% else:
@@ -313,12 +313,12 @@ ${equivalenceExplanation}
313
313
/// - Returns: `true` if this sequence and `other` contain the same elements
314
314
/// in the same order.
315
315
///
316
- /// - SeeAlso: `elementsEqual(_:isEquivalent :)`
316
+ /// - SeeAlso: `elementsEqual(_:by :)`
317
317
% end
318
318
public func elementsEqual< OtherSequence> (
319
319
_ other: OtherSequence ${ " , " if preds else " " }
320
320
% if preds:
321
- isEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
321
+ by areEquivalent : @noescape (${GElement}, ${GElement}) throws -> Bool
322
322
% end
323
323
) ${rethrows_}-> Bool
324
324
where
@@ -330,7 +330,7 @@ ${equivalenceExplanation}
330
330
while true {
331
331
switch (iter1.next(), iter2.next()) {
332
332
case let (e1?, e2?):
333
- if ${'try !isEquivalent (e1, e2)' if preds else 'e1 != e2'} {
333
+ if ${'try !areEquivalent (e1, e2)' if preds else 'e1 != e2'} {
334
334
return false
335
335
}
336
336
case (_?, nil),
@@ -694,7 +694,7 @@ extension Sequence {
694
694
Builtin . unreachable ( )
695
695
}
696
696
697
- @available ( * , unavailable, renamed: " starts(with:isEquivalent :) " )
697
+ @available ( * , unavailable, renamed: " starts(with:by :) " )
698
698
public func startsWith< PossiblePrefix> (
699
699
_ possiblePrefix: PossiblePrefix ,
700
700
isEquivalent: @noescape ( Iterator . Element, Iterator . Element) throws -> Bool
0 commit comments