@@ -410,6 +410,9 @@ extension LazySequenceProtocol where Self: Collection, Elements: Collection {
410
410
/// Returns a lazy collection of subsequences of this collection, chunked by
411
411
/// the given predicate.
412
412
///
413
+ /// - Parameter belongInSameGroup: A closure that takes two adjacent elements
414
+ /// of the sequence and returns whether or not they belong in the same group.
415
+ ///
413
416
/// - Complexity: O(*n*), because the start index is pre-computed.
414
417
@inlinable
415
418
public func chunked(
@@ -422,7 +425,11 @@ extension LazySequenceProtocol where Self: Collection, Elements: Collection {
422
425
}
423
426
424
427
/// Returns a lazy collection of subsequences of this collection, chunked by
425
- /// grouping elements that project to the same value.
428
+ /// grouping elements that project to equal values.
429
+ ///
430
+ /// - Parameter projection: A closure that takes an element in the sequence
431
+ /// and returns an `Equatable` value that can be used to determine if adjacent
432
+ /// elements belong in the same group.
426
433
///
427
434
/// - Complexity: O(*n*), because the start index is pre-computed.
428
435
@inlinable
@@ -443,6 +450,10 @@ extension Collection {
443
450
/// Returns a collection of subsequences of this collection, chunked by the
444
451
/// given predicate.
445
452
///
453
+ /// - Parameter belongInSameGroup: A closure that takes two adjacent elements
454
+ /// of the collection and returns whether or not they belong in the same
455
+ /// group.
456
+ ///
446
457
/// - Complexity: O(*n*), where *n* is the length of this collection.
447
458
@inlinable
448
459
public func chunked(
@@ -470,7 +481,11 @@ extension Collection {
470
481
}
471
482
472
483
/// Returns a collection of subsequences of this collection, chunked by
473
- /// grouping elements that project to the same value.
484
+ /// grouping elements that project to equal values.
485
+ ///
486
+ /// - Parameter projection: A closure that takes an element in the collection
487
+ /// and returns an `Equatable` value that can be used to determine if adjacent
488
+ /// elements belong in the same group.
474
489
///
475
490
/// - Complexity: O(*n*), where *n* is the length of this collection.
476
491
@inlinable
0 commit comments