From 5c8bd186f48c16af0775972700626f0b74588278 Mon Sep 17 00:00:00 2001 From: Mason Kim <59835351+qwerty3345@users.noreply.github.com> Date: Mon, 2 Sep 2024 21:15:02 +0900 Subject: [PATCH] Fix a few typos (#329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [DOCS] fix typo: precicely → precisely * [DOCS] fix typo: ever → every * [DOCS] fix typo: AsyncBufferSequence, relative --- Evolution/0006-combineLatest.md | 2 +- Evolution/0010-buffer.md | 4 ++-- Evolution/0011-interspersed.md | 6 +++--- Evolution/NNNN-rate-limits.md | 2 +- .../Interspersed/AsyncInterspersedSequence.swift | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Evolution/0006-combineLatest.md b/Evolution/0006-combineLatest.md index 584b068a..bcdf6a84 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 da56def7..e77f6d81 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 cfc99737..27e5dbc1 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 94bf6e89..e78c60d1 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 9932e77e..78ef20d3 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