From 8396f4f3d3a2828c342d44ca08b0c8e37a1f41a0 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Tue, 11 Jan 2022 15:32:30 -0800 Subject: [PATCH] Add documentation for AsyncLazySequence --- Sources/AsyncAlgorithms/AsyncLazySequence.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/AsyncAlgorithms/AsyncLazySequence.swift b/Sources/AsyncAlgorithms/AsyncLazySequence.swift index 2e9ba8f6..2aa01c27 100644 --- a/Sources/AsyncAlgorithms/AsyncLazySequence.swift +++ b/Sources/AsyncAlgorithms/AsyncLazySequence.swift @@ -10,12 +10,23 @@ //===----------------------------------------------------------------------===// extension Sequence { + /// An asynchronous sequence containing the same elements as this sequence, + /// but on which operations, such as `map` and `filter`, are + /// implemented asynchronously. @inlinable public var async: AsyncLazySequence { AsyncLazySequence(self) } } +/// An asynchronous sequence composed from a synchronous sequence. +/// +/// Asynchronous lazy sequences can be used to interface existing or pre-calculated +/// data to interoperate with other asynchronous sequences and algoritms based on +/// asynchronous sequences. +/// +/// This functions similarly to `LazySequence` by accessing elemetns sequentially +/// in the iterators next method. @frozen public struct AsyncLazySequence: AsyncSequence { public typealias Element = Base.Element