diff --git a/Evolution/0006-combineLatest.md b/Evolution/0006-combineLatest.md index 584b068..bcdf6a8 100644 --- a/Evolution/0006-combineLatest.md +++ b/Evolution/0006-combineLatest.md @@ -13,7 +13,7 @@ ## Introduction -Similar to the `zip` algorithm there is a need to combine the latest values from multiple input asynchronous sequences. Since `AsyncSequence` augments the concept of sequence with the characteristic of time it means that the composition of elements may not just be pairwise emissions but instead be temporal composition. This means that it is useful to emit a new tuple _when_ a value is produced. The `combineLatest` algorithm provides precicely that. +Similar to the `zip` algorithm there is a need to combine the latest values from multiple input asynchronous sequences. Since `AsyncSequence` augments the concept of sequence with the characteristic of time it means that the composition of elements may not just be pairwise emissions but instead be temporal composition. This means that it is useful to emit a new tuple _when_ a value is produced. The `combineLatest` algorithm provides precisely that. ## Detailed Design diff --git a/Evolution/0010-buffer.md b/Evolution/0010-buffer.md index da56def..e77f6d8 100644 --- a/Evolution/0010-buffer.md +++ b/Evolution/0010-buffer.md @@ -28,7 +28,7 @@ By applying the buffer operator to the previous example, the file can be read as ## Proposed Solution -We propose to extend `AsyncSequence` with a `buffer()` operator. This operator will return an `AsyncBuffereSequence` that wraps the source `AsyncSequence` and handle the buffering mechanism. +We propose to extend `AsyncSequence` with a `buffer()` operator. This operator will return an `AsyncBufferSequence` that wraps the source `AsyncSequence` and handle the buffering mechanism. This operator will accept an `AsyncBufferSequencePolicy`. The policy will dictate the behaviour in case of a buffer overflow. @@ -43,7 +43,7 @@ public struct AsyncBufferSequencePolicy: Sendable { } ``` -And the public API of `AsyncBuffereSequence` will be: +And the public API of `AsyncBufferSequence` will be: ```swift extension AsyncSequence where Self: Sendable { diff --git a/Evolution/0011-interspersed.md b/Evolution/0011-interspersed.md index cfc9973..27e5dbc 100644 --- a/Evolution/0011-interspersed.md +++ b/Evolution/0011-interspersed.md @@ -178,7 +178,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .element(separator) self.every = every @@ -186,7 +186,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -194,7 +194,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every diff --git a/Evolution/NNNN-rate-limits.md b/Evolution/NNNN-rate-limits.md index 94bf6e8..e78c60d 100644 --- a/Evolution/NNNN-rate-limits.md +++ b/Evolution/NNNN-rate-limits.md @@ -18,7 +18,7 @@ ## Introduction -When events can potentially happen faster than the desired consumption rate, there are multiple ways to handle the situation. One approach is to only emit values after a given period of time of inactivity, or "quiescence", has elapsed. This algorithm is commonly referred to as debouncing. A very close reelativee is an apporach to emit values after a given period has elapsed. These emitted values can be reduced from the values encountered during the waiting period. This algorithm is commonly referred to as throttling. +When events can potentially happen faster than the desired consumption rate, there are multiple ways to handle the situation. One approach is to only emit values after a given period of time of inactivity, or "quiescence", has elapsed. This algorithm is commonly referred to as debouncing. A very close relative is an approach to emit values after a given period has elapsed. These emitted values can be reduced from the values encountered during the waiting period. This algorithm is commonly referred to as throttling. ## Proposed Solution diff --git a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift index 9932e77..78ef20d 100644 --- a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift +++ b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift @@ -157,7 +157,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .element(separator) self.every = every @@ -165,7 +165,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -173,7 +173,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every @@ -310,7 +310,7 @@ public struct AsyncThrowingInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () throws -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -318,7 +318,7 @@ public struct AsyncThrowingInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async throws -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every