1111
1212/// A collection wrapper that breaks a collection into chunks based on a
1313/// predicate or projection.
14- public struct LazyChunked < Base: Collection , Subject> {
14+ public struct Chunked < Base: Collection , Subject> {
1515 /// The collection that this instance provides a view onto.
1616 @usableFromInline
1717 internal let base : Base
@@ -45,7 +45,7 @@ public struct LazyChunked<Base: Collection, Subject> {
4545 }
4646}
4747
48- extension LazyChunked : LazyCollectionProtocol {
48+ extension Chunked : LazyCollectionProtocol {
4949 /// A position in a chunked collection.
5050 public struct Index : Comparable {
5151 /// The range corresponding to the chunk at this position.
@@ -106,9 +106,9 @@ extension LazyChunked: LazyCollectionProtocol {
106106 }
107107}
108108
109- extension LazyChunked . Index : Hashable where Base. Index: Hashable { }
109+ extension Chunked . Index : Hashable where Base. Index: Hashable { }
110110
111- extension LazyChunked : BidirectionalCollection
111+ extension Chunked : BidirectionalCollection
112112 where Base: BidirectionalCollection
113113{
114114 /// Returns the index in the base collection of the start of the chunk ending
@@ -131,6 +131,9 @@ extension LazyChunked: BidirectionalCollection
131131 }
132132}
133133
134+ @available ( * , deprecated, renamed: " Chunked " )
135+ public typealias LazyChunked < Base: Collection , Subject> = Chunked < Base , Subject >
136+
134137//===----------------------------------------------------------------------===//
135138// lazy.chunked(by:)
136139//===----------------------------------------------------------------------===//
@@ -143,8 +146,8 @@ extension LazyCollectionProtocol {
143146 @inlinable
144147 public func chunked(
145148 by belongInSameGroup: @escaping ( Element , Element ) -> Bool
146- ) -> LazyChunked < Elements , Element > {
147- LazyChunked (
149+ ) -> Chunked < Elements , Element > {
150+ Chunked (
148151 base: elements,
149152 projection: { $0 } ,
150153 belongInSameGroup: belongInSameGroup)
@@ -157,8 +160,8 @@ extension LazyCollectionProtocol {
157160 @inlinable
158161 public func chunked< Subject: Equatable > (
159162 on projection: @escaping ( Element ) -> Subject
160- ) -> LazyChunked < Elements , Subject > {
161- LazyChunked (
163+ ) -> Chunked < Elements , Subject > {
164+ Chunked (
162165 base: elements,
163166 projection: projection,
164167 belongInSameGroup: == )
0 commit comments