From 01e1a7bd522d9a2475cae5290d05756a7be59a55 Mon Sep 17 00:00:00 2001 From: Maxim Moiseev Date: Wed, 4 Nov 2015 11:16:26 -0800 Subject: [PATCH] LazyCollectionType => LazyCollectionProtocol --- stdlib/public/core/Filter.swift | 4 ++-- stdlib/public/core/FlatMap.swift | 4 ++-- stdlib/public/core/Flatten.swift.gyb | 2 +- stdlib/public/core/LazyCollection.swift | 14 +++++++------- stdlib/public/core/LazySequence.swift | 2 +- stdlib/public/core/Map.swift | 4 ++-- stdlib/public/core/Reverse.swift | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/stdlib/public/core/Filter.swift b/stdlib/public/core/Filter.swift index de6f46909230d..5fda217cdfcc3 100644 --- a/stdlib/public/core/Filter.swift +++ b/stdlib/public/core/Filter.swift @@ -154,7 +154,7 @@ public func == ( /// documented complexity. public struct LazyFilterCollection< Base : Collection -> : LazyCollectionType { +> : LazyCollectionProtocol { /// A type that represents a valid position in the collection. /// @@ -238,7 +238,7 @@ extension LazySequenceType { } } -extension LazyCollectionType { +extension LazyCollectionProtocol { /// Return the elements of `self` that satisfy `predicate`. /// /// - Note: The elements of the result are computed on-demand, as diff --git a/stdlib/public/core/FlatMap.swift b/stdlib/public/core/FlatMap.swift index f2aa27331f0a0..eb37bd9e36c9f 100644 --- a/stdlib/public/core/FlatMap.swift +++ b/stdlib/public/core/FlatMap.swift @@ -26,7 +26,7 @@ extension LazySequenceType { } } -extension LazyCollectionType { +extension LazyCollectionProtocol { /// Returns the concatenated results of mapping `transform` over /// `self`. Equivalent to /// @@ -44,7 +44,7 @@ extension LazyCollectionType { } } -extension LazyCollectionType where Elements.Index : BidirectionalIndexType +extension LazyCollectionProtocol where Elements.Index : BidirectionalIndexType { /// Returns the concatenated results of mapping `transform` over /// `self`. Equivalent to diff --git a/stdlib/public/core/Flatten.swift.gyb b/stdlib/public/core/Flatten.swift.gyb index 65e086a534530..ac870a04a1358 100644 --- a/stdlib/public/core/Flatten.swift.gyb +++ b/stdlib/public/core/Flatten.swift.gyb @@ -298,7 +298,7 @@ extension Collection where ${constraints % {'Base': ''}} { } } -extension LazyCollectionType +extension LazyCollectionProtocol where ${constraints % {'Base': ''}}, ${constraints % {'Base': 'Elements.'}}, Iterator.Element == Elements.Iterator.Element { diff --git a/stdlib/public/core/LazyCollection.swift b/stdlib/public/core/LazyCollection.swift index c79f5656f30c5..5ad4aeb0e43da 100644 --- a/stdlib/public/core/LazyCollection.swift +++ b/stdlib/public/core/LazyCollection.swift @@ -13,15 +13,15 @@ /// A collection on which normally-eager operations such as `map` and /// `filter` are implemented lazily. /// -/// Please see `LazySequenceType` for background; `LazyCollectionType` +/// Please see `LazySequenceType` for background; `LazyCollectionProtocol` /// is an analogous component, but for collections. /// /// To add new lazy collection operations, extend this protocol with /// methods that return lazy wrappers that are themselves -/// `LazyCollectionType`s. +/// `LazyCollectionProtocol`s. /// /// - See Also: `LazySequenceType`, `LazyCollection` -public protocol LazyCollectionType +public protocol LazyCollectionProtocol : Collection, LazySequenceType { /// A `Collection` that can contain the same elements as this one, /// possibly with a simpler type. @@ -33,7 +33,7 @@ public protocol LazyCollectionType /// When there's no special associated `Elements` type, the `elements` /// property is provided. -extension LazyCollectionType where Elements == Self { +extension LazyCollectionProtocol where Elements == Self { /// Identical to `self`. public var elements: Self { return self } } @@ -44,7 +44,7 @@ extension LazyCollectionType where Elements == Self { /// /// - See also: `LazySequenceType`, `LazyCollection` public struct LazyCollection - : LazyCollectionType { + : LazyCollectionProtocol { /// The type of the underlying collection public typealias Elements = Base @@ -171,13 +171,13 @@ extension Collection { /// normally-eager operations such as `map` and `filter` are /// implemented lazily. /// - /// - See Also: `LazySequenceType`, `LazyCollectionType`. + /// - See Also: `LazySequenceType`, `LazyCollectionProtocol`. public var lazy: LazyCollection { return LazyCollection(self) } } -extension LazyCollectionType { +extension LazyCollectionProtocol { /// Identical to `self`. public var lazy: Self { // Don't re-wrap already-lazy collections return self diff --git a/stdlib/public/core/LazySequence.swift b/stdlib/public/core/LazySequence.swift index f9e3483d4f7c0..caa02ae806c90 100644 --- a/stdlib/public/core/LazySequence.swift +++ b/stdlib/public/core/LazySequence.swift @@ -108,7 +108,7 @@ /// } /// } /// -/// - See also: `LazySequence`, `LazyCollectionType`, `LazyCollection` +/// - See also: `LazySequence`, `LazyCollectionProtocol`, `LazyCollection` /// /// - Note: The explicit permission to implement further operations /// lazily applies only in contexts where the sequence is statically diff --git a/stdlib/public/core/Map.swift b/stdlib/public/core/Map.swift index 697709f05d3c2..00f47e5c93425 100644 --- a/stdlib/public/core/Map.swift +++ b/stdlib/public/core/Map.swift @@ -74,7 +74,7 @@ public struct LazyMapSequence /// These elements are computed lazily, each time they're read, by /// calling the transform function on a base element. public struct LazyMapCollection - : LazyCollectionType { + : LazyCollectionProtocol { // FIXME: Should be inferrable. public typealias Index = Base.Index @@ -140,7 +140,7 @@ extension LazySequenceType { } } -extension LazyCollectionType { +extension LazyCollectionProtocol { /// Return a `LazyMapCollection` over this `Collection`. The elements of /// the result are computed lazily, each time they are read, by /// calling `transform` function on a base element. diff --git a/stdlib/public/core/Reverse.swift b/stdlib/public/core/Reverse.swift index 1f7c7dc7f2caf..e887df18d6853 100644 --- a/stdlib/public/core/Reverse.swift +++ b/stdlib/public/core/Reverse.swift @@ -212,7 +212,7 @@ extension Collection where Index : RandomAccessIndexType { } } -extension LazyCollectionType +extension LazyCollectionProtocol where Index : BidirectionalIndexType, Elements.Index : BidirectionalIndexType { /// Return the elements of `self` in reverse order. /// @@ -225,7 +225,7 @@ where Index : BidirectionalIndexType, Elements.Index : BidirectionalIndexType { } } -extension LazyCollectionType +extension LazyCollectionProtocol where Index : RandomAccessIndexType, Elements.Index : RandomAccessIndexType { /// Return the elements of `self` in reverse order. ///