diff --git a/Sources/AsyncAlgorithms/AsyncJoinedBySeparatorSequence.swift b/Sources/AsyncAlgorithms/AsyncJoinedBySeparatorSequence.swift index 3697155..22395da 100644 --- a/Sources/AsyncAlgorithms/AsyncJoinedBySeparatorSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncJoinedBySeparatorSequence.swift @@ -10,14 +10,14 @@ //===----------------------------------------------------------------------===// extension AsyncSequence where Element: AsyncSequence { - /// Concatenate an `AsyncSequence` of `AsyncSequence` elements with a seperator. + /// Concatenate an `AsyncSequence` of `AsyncSequence` elements with a separator. @inlinable public func joined(separator: Separator) -> AsyncJoinedBySeparatorSequence { return AsyncJoinedBySeparatorSequence(self, separator: separator) } } -/// An `AsyncSequence` that concatenates`AsyncSequence` elements with a seperator. +/// An `AsyncSequence` that concatenates `AsyncSequence` elements with a separator. public struct AsyncJoinedBySeparatorSequence: AsyncSequence where Base.Element: AsyncSequence, Separator.Element == Base.Element.Element { public typealias Element = Base.Element.Element public typealias AsyncIterator = Iterator diff --git a/Sources/AsyncAlgorithms/AsyncRemoveDuplicatesSequence.swift b/Sources/AsyncAlgorithms/AsyncRemoveDuplicatesSequence.swift index 8367e63..90ac51f 100644 --- a/Sources/AsyncAlgorithms/AsyncRemoveDuplicatesSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncRemoveDuplicatesSequence.swift @@ -24,7 +24,7 @@ extension AsyncSequence { return AsyncRemoveDuplicatesSequence(self, predicate: predicate) } - /// Creates an asynchronous sequence that omits repeated elements by testing them with a predicate. + /// Creates an asynchronous sequence that omits repeated elements by testing them with an error-throwing predicate. public func removeDuplicates(by predicate: @escaping @Sendable (Element, Element) async throws -> Bool) -> AsyncThrowingRemoveDuplicatesSequence { return AsyncThrowingRemoveDuplicatesSequence(self, predicate: predicate) } @@ -89,7 +89,7 @@ extension AsyncRemoveDuplicatesSequence: Sendable where Base: Sendable, Base.Ele extension AsyncRemoveDuplicatesSequence.Iterator: Sendable where Base: Sendable, Base.Element: Sendable, Base.AsyncIterator: Sendable { } -/// An asynchronous sequence that omits repeated elements by testing them with a predicate. +/// An asynchronous sequence that omits repeated elements by testing them with an error-throwing predicate. public struct AsyncThrowingRemoveDuplicatesSequence: AsyncSequence { public typealias Element = Base.Element diff --git a/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift b/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift index c1a7956..c8894eb 100644 --- a/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift @@ -10,19 +10,19 @@ //===----------------------------------------------------------------------===// extension AsyncSequence { - /// Create a rate limited `AsyncSequence` by emitting values at most every specified interval. + /// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public func throttle(for interval: C.Instant.Duration, clock: C, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence { AsyncThrottleSequence(self, interval: interval, clock: clock, reducing: reducing) } - /// Create a rate limited `AsyncSequence` by emitting values at most every specified interval. + /// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public func throttle(for interval: Duration, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence { throttle(for: interval, clock: .continuous, reducing: reducing) } - /// Create a rate limited `AsyncSequence` by emitting values at most every specified interval. + /// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public func throttle(for interval: C.Instant.Duration, clock: C, latest: Bool = true) -> AsyncThrottleSequence { throttle(for: interval, clock: clock) { previous, element in @@ -34,14 +34,14 @@ extension AsyncSequence { } } - /// Create a rate limited `AsyncSequence` by emitting values at most every specified interval. + /// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public func throttle(for interval: Duration, latest: Bool = true) -> AsyncThrottleSequence { throttle(for: interval, clock: .continuous, latest: latest) } } -/// A rate limited `AsyncSequence` by emitting values at most every specified interval. +/// A rate-limited `AsyncSequence` by emitting values at most every specified interval. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public struct AsyncThrottleSequence { let base: Base diff --git a/Sources/AsyncAlgorithms/AsyncThrowingChannel.swift b/Sources/AsyncAlgorithms/AsyncThrowingChannel.swift index 2c90eb3..a0d545e 100644 --- a/Sources/AsyncAlgorithms/AsyncThrowingChannel.swift +++ b/Sources/AsyncAlgorithms/AsyncThrowingChannel.swift @@ -9,9 +9,9 @@ // //===----------------------------------------------------------------------===// -/// A throwing channel for sending elements from on task to another with back pressure. +/// An error-throwing channel for sending elements from on task to another with back pressure. /// -/// The `AsyncThrowingChannel` class is intended to be used as a communication types between tasks., particularly when one task produces values and another task consumes those values. The back pressure applied by `send(_:)`, `fail(_:)` and `finish()` via the suspension/resume ensure that the production of values does not exceed the consumption of values from iteration. Each of these methods suspends after enqueuing the event and is resumed when the next call to `next()` on the `Iterator` is made. +/// The `AsyncThrowingChannel` class is intended to be used as a communication types between tasks, particularly when one task produces values and another task consumes those values. The back pressure applied by `send(_:)`, `fail(_:)` and `finish()` via suspension/resume ensures that the production of values does not exceed the consumption of values from iteration. Each of these methods suspends after enqueuing the event and is resumed when the next call to `next()` on the `Iterator` is made. public final class AsyncThrowingChannel: AsyncSequence, Sendable { /// The iterator for an `AsyncThrowingChannel` instance. public struct Iterator: AsyncIteratorProtocol, Sendable { diff --git a/Sources/AsyncAlgorithms/AsyncZip2Sequence.swift b/Sources/AsyncAlgorithms/AsyncZip2Sequence.swift index 7bdc203..0b91fe4 100644 --- a/Sources/AsyncAlgorithms/AsyncZip2Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncZip2Sequence.swift @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// /// Creates an asynchronous sequence that concurrently awaits values from two `AsyncSequence` types -/// by emitting a tuple of the values. +/// and emits a tuple of the values. public func zip(_ base1: Base1, _ base2: Base2) -> AsyncZip2Sequence where Base1: Sendable, Base2: Sendable, @@ -22,7 +22,7 @@ public func zip(_ base1: Base1, _ ba } /// An asynchronous sequence that concurrently awaits values from two `AsyncSequence` types -/// by emitting a tuple of the values. +/// and emits a tuple of the values. public struct AsyncZip2Sequence: Sendable where Base1: Sendable, Base2: Sendable, diff --git a/Sources/AsyncAlgorithms/AsyncZip3Sequence.swift b/Sources/AsyncAlgorithms/AsyncZip3Sequence.swift index ee726e3..b66a3f7 100644 --- a/Sources/AsyncAlgorithms/AsyncZip3Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncZip3Sequence.swift @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// /// Creates an asynchronous sequence that concurrently awaits values from three `AsyncSequence` types -/// by emitting a tuple of the values. +/// and emits a tuple of the values. public func zip(_ base1: Base1, _ base2: Base2, _ base3: Base3) -> AsyncZip3Sequence where Base1: Sendable, Base2: Sendable, @@ -25,7 +25,7 @@ public func zip: Sendable where Base1: Sendable, Base2: Sendable,