Skip to content

Fix typos for clarity #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Evolution/0006-combineLatest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Evolution/0010-buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions Evolution/0011-interspersed.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,23 +178,23 @@ public struct AsyncInterspersedSequence<Base: AsyncSequence> {

@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
}

@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
}

@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
Expand Down
2 changes: 1 addition & 1 deletion Evolution/NNNN-rate-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,23 @@ public struct AsyncInterspersedSequence<Base: AsyncSequence> {

@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
}

@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
}

@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
Expand Down Expand Up @@ -310,15 +310,15 @@ public struct AsyncThrowingInterspersedSequence<Base: AsyncSequence> {

@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
}

@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
Expand Down