Skip to content

Commit

Permalink
LazyCollectionType => LazyCollectionProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Moiseev committed Dec 10, 2015
1 parent faf25c3 commit 01e1a7b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions stdlib/public/core/Filter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public func == <Base : Collection>(
/// documented complexity.
public struct LazyFilterCollection<
Base : Collection
> : LazyCollectionType {
> : LazyCollectionProtocol {

/// A type that represents a valid position in the collection.
///
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/FlatMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension LazySequenceType {
}
}

extension LazyCollectionType {
extension LazyCollectionProtocol {
/// Returns the concatenated results of mapping `transform` over
/// `self`. Equivalent to
///
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Flatten.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ extension Collection where ${constraints % {'Base': ''}} {
}
}

extension LazyCollectionType
extension LazyCollectionProtocol
where ${constraints % {'Base': ''}},
${constraints % {'Base': 'Elements.'}},
Iterator.Element == Elements.Iterator.Element {
Expand Down
14 changes: 7 additions & 7 deletions stdlib/public/core/LazyCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 }
}
Expand All @@ -44,7 +44,7 @@ extension LazyCollectionType where Elements == Self {
///
/// - See also: `LazySequenceType`, `LazyCollection`
public struct LazyCollection<Base : Collection>
: LazyCollectionType {
: LazyCollectionProtocol {

/// The type of the underlying collection
public typealias Elements = Base
Expand Down Expand Up @@ -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<Self> {
return LazyCollection(self)
}
}

extension LazyCollectionType {
extension LazyCollectionProtocol {
/// Identical to `self`.
public var lazy: Self { // Don't re-wrap already-lazy collections
return self
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/LazySequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public struct LazyMapSequence<Base : SequenceType, Element>
/// These elements are computed lazily, each time they're read, by
/// calling the transform function on a base element.
public struct LazyMapCollection<Base : Collection, Element>
: LazyCollectionType {
: LazyCollectionProtocol {

// FIXME: Should be inferrable.
public typealias Index = Base.Index
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Reverse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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.
///
Expand Down

0 comments on commit 01e1a7b

Please sign in to comment.