<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/AsyncThrowingFlatMapSequence/AsyncSequence-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "AsyncSequence Implementations"
}
-->

# AsyncSequence Implementations

## Topics

### Instance Methods

[`func allSatisfy((Self.Element) async throws -> Bool) async rethrows -> Bool`](/documentation/Swift/AsyncThrowingFlatMapSequence/allSatisfy(_:))

Returns a Boolean value that indicates whether all elements produced by the
asynchronous sequence satisfy the given predicate.

[`func compactMap<ElementOfResult>((Self.Element) async -> ElementOfResult?) -> AsyncCompactMapSequence<Self, ElementOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/compactMap(_:)-4299z)

Creates an asynchronous sequence that maps the given closure over the
asynchronous sequence’s elements, omitting results that don’t return a
value.

[`func compactMap<ElementOfResult>((Self.Element) async throws -> ElementOfResult?) -> AsyncThrowingCompactMapSequence<Self, ElementOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/compactMap(_:)-8k2p7)

Creates an asynchronous sequence that maps an error-throwing closure over
the base sequence’s elements, omitting results that don’t return a value.

[`func contains(Self.Element) async rethrows -> Bool`](/documentation/Swift/AsyncThrowingFlatMapSequence/contains(_:))

Returns a Boolean value that indicates whether the asynchronous sequence
contains the given element.

[`func contains(where: (Self.Element) async throws -> Bool) async rethrows -> Bool`](/documentation/Swift/AsyncThrowingFlatMapSequence/contains(where:))

Returns a Boolean value that indicates whether the asynchronous sequence
contains an element that satisfies the given predicate.

[`func drop(while: (Self.Element) async -> Bool) -> AsyncDropWhileSequence<Self>`](/documentation/Swift/AsyncThrowingFlatMapSequence/drop(while:))

Omits elements from the base asynchronous sequence until a given closure
returns false, after which it passes through all remaining elements.

[`func dropFirst(Int) -> AsyncDropFirstSequence<Self>`](/documentation/Swift/AsyncThrowingFlatMapSequence/dropFirst(_:))

Omits a specified number of elements from the base asynchronous sequence,
then passes through all remaining elements.

[`func filter((Self.Element) async -> Bool) -> AsyncFilterSequence<Self>`](/documentation/Swift/AsyncThrowingFlatMapSequence/filter(_:))

Creates an asynchronous sequence that contains, in order, the elements of
the base sequence that satisfy the given predicate.

[`func first(where: (Self.Element) async throws -> Bool) async rethrows -> Self.Element?`](/documentation/Swift/AsyncThrowingFlatMapSequence/first(where:))

Returns the first element of the sequence that satisfies the given
predicate.

[`func flatMap<SegmentOfResult>((Self.Element) async -> SegmentOfResult) -> AsyncFlatMapSequence<Self, SegmentOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/flatMap(_:)-305n4)

Creates an asynchronous sequence that concatenates the results of calling
the given transformation with each element of this sequence.

[`func flatMap<SegmentOfResult>((Self.Element) async throws -> SegmentOfResult) -> AsyncThrowingFlatMapSequence<Self, SegmentOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/flatMap(_:)-39bbv)

Creates an asynchronous sequence that concatenates the results of calling
the given error-throwing transformation with each element of this
sequence.

[`func flatMap<SegmentOfResult>((Self.Element) async -> SegmentOfResult) -> AsyncFlatMapSequence<Self, SegmentOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/flatMap(_:)-6oqyf)

Creates an asynchronous sequence that concatenates the results of calling
the given transformation with each element of this sequence.

[`func flatMap<SegmentOfResult>((Self.Element) async -> SegmentOfResult) -> AsyncFlatMapSequence<Self, SegmentOfResult>`](/documentation/Swift/AsyncThrowingFlatMapSequence/flatMap(_:)-917rm)

Creates an asynchronous sequence that concatenates the results of calling
the given transformation with each element of this sequence.

[`func makeAsyncIterator() -> AsyncThrowingFlatMapSequence<Base, SegmentOfResult>.Iterator`](/documentation/Swift/AsyncThrowingFlatMapSequence/makeAsyncIterator())

Creates the asynchronous iterator that produces elements of this
asynchronous sequence.

[`func map<Transformed>((Self.Element) async throws -> Transformed) -> AsyncThrowingMapSequence<Self, Transformed>`](/documentation/Swift/AsyncThrowingFlatMapSequence/map(_:)-81b46)

Creates an asynchronous sequence that maps the given error-throwing
closure over the asynchronous sequence’s elements.

[`func map<Transformed>((Self.Element) async -> Transformed) -> AsyncMapSequence<Self, Transformed>`](/documentation/Swift/AsyncThrowingFlatMapSequence/map(_:)-p3ci)

Creates an asynchronous sequence that maps the given closure over the
asynchronous sequence’s elements.

[`func max() async rethrows -> Self.Element?`](/documentation/Swift/AsyncThrowingFlatMapSequence/max())

Returns the maximum element in an asynchronous sequence of comparable
elements.

[`func max(by: (Self.Element, Self.Element) async throws -> Bool) async rethrows -> Self.Element?`](/documentation/Swift/AsyncThrowingFlatMapSequence/max(by:))

Returns the maximum element in the asynchronous sequence, using the given
predicate as the comparison between elements.

[`func min() async rethrows -> Self.Element?`](/documentation/Swift/AsyncThrowingFlatMapSequence/min())

Returns the minimum element in an asynchronous sequence of comparable
elements.

[`func min(by: (Self.Element, Self.Element) async throws -> Bool) async rethrows -> Self.Element?`](/documentation/Swift/AsyncThrowingFlatMapSequence/min(by:))

Returns the minimum element in the asynchronous sequence, using the given
predicate as the comparison between elements.

[`func prefix(Int) -> AsyncPrefixSequence<Self>`](/documentation/Swift/AsyncThrowingFlatMapSequence/prefix(_:))

Returns an asynchronous sequence, up to the specified maximum length,
containing the initial elements of the base asynchronous sequence.

[`func prefix(while: (Self.Element) async -> Bool) rethrows -> AsyncPrefixWhileSequence<Self>`](/documentation/Swift/AsyncThrowingFlatMapSequence/prefix(while:))

Returns an asynchronous sequence, containing the initial, consecutive
elements of the base sequence that satisfy the given predicate.

[`func reduce<Result>(Result, (Result, Self.Element) async throws -> Result) async rethrows -> Result`](/documentation/Swift/AsyncThrowingFlatMapSequence/reduce(_:_:))

Returns the result of combining the elements of the asynchronous sequence
using the given closure.

[`func reduce<Result>(into: Result, (inout Result, Self.Element) async throws -> Void) async rethrows -> Result`](/documentation/Swift/AsyncThrowingFlatMapSequence/reduce(into:_:))

Returns the result of combining the elements of the asynchronous sequence
using the given closure, given a mutable initial value.

### Type Aliases

[`typealias AsyncIterator`](/documentation/Swift/AsyncThrowingFlatMapSequence/AsyncIterator)

The type of iterator that produces elements of the sequence.

[`typealias Element`](/documentation/Swift/AsyncThrowingFlatMapSequence/Element)

The type of element produced by this asynchronous sequence.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)