LazySequenceProtocol (ext)
You’re viewing third-party extensions to LazySequenceProtocol
, a protocol from the Swift standard library.
You can also read the documentation forLazySequenceProtocol
itself.
extension LazySequenceProtocol
You’re viewing third-party extensions to LazySequenceProtocol
, a protocol from the Swift standard library.
You can also read the documentation forLazySequenceProtocol
itself.
extension LazySequenceProtocol
protocol LazySequenceProtocol : Sequence
A sequence on which normally-eager sequence operations are implemented lazily.
import Algorithms
Swift Algorithms is an open-source package of sequence and collection algorithms, along with their related types.
func reductions(_ transform: @escaping (Element, Element) -> Element) -> InclusiveReductionsSequence<Elements>
Returns a sequence containing the accumulated results of combining the elements of the sequence using the given closure.
func reductions<Result>(_ initial: Result, _ transform: @escaping (Result, Element) -> Result) -> ExclusiveReductionsSequence<Elements, Result>
Returns a sequence containing the accumulated results of combining the elements of the sequence using the given closure.
func reductions<Result>(into initial: Result, _ transform: @escaping (inout Result, Element) -> Void) -> ExclusiveReductionsSequence<Elements, Result>
Returns a sequence containing the accumulated results of combining the elements of the sequence using the given closure.
func split(maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true, whereSeparator isSeparator: @escaping (Element) -> Bool) -> SplitSequence<Elements>
Lazily returns the longest possible subsequences of the sequence, in order, that don’t contain elements satisfying the given predicate.
func uniqued<Subject>(on projection: @escaping (Element) -> Subject) -> UniquedSequence<Self, Subject> where Subject : Hashable
Returns a lazy sequence with the unique elements of this sequence (as determined by the given projection), in the order of the first occurrence of each unique element.
func scan(_ transform: @escaping (Element, Element) -> Element) -> InclusiveReductionsSequence<Elements>
func scan<Result>(_ initial: Result, _ transform: @escaping (Result, Element) -> Result) -> ExclusiveReductionsSequence<Elements, Result>
func scan<Result>(into initial: Result, _ transform: @escaping (inout Result, Element) -> Void) -> ExclusiveReductionsSequence<Elements, Result>
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
protocol Equatable
A type that can be compared for value equality.
func split(separator: Element, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> SplitCollection<Elements>
Lazily returns the longest possible subsequences of the collection, in order, around elements equal to the given element.
func chunked(by belongInSameGroup: @escaping (Element, Element) -> Bool) -> ChunkedByCollection<Elements, Element>
Returns a lazy collection of subsequences of this collection, chunked by the given predicate.
func chunked<Subject>(on projection: @escaping (Element) -> Subject) -> ChunkedOnCollection<Elements, Subject> where Subject : Equatable
Returns a lazy collection of subsequences of this collection, chunked by grouping elements that project to equal values.
func split(maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true, whereSeparator isSeparator: @escaping (Element) -> Bool) -> SplitCollection<Elements>
Lazily returns the longest possible subsequences of the collection, in order, that don’t contain elements satisfying the given predicate.
func split(separator: Element, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> SplitSequence<Elements>
Lazily returns the longest possible subsequences of the sequence, in order, around elements equal to the given element.
protocol Sequence<Element>
A type that provides sequential, iterated access to its elements.
func joined<Separator>(by separator: @escaping (Element, Element) -> Separator) -> JoinedByClosureSequence<Elements, Separator> where Separator : Sequence, Separator.Element == Self.Element.Element
Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
func joined(by separator: @escaping (Element, Element) -> Element.Element) -> JoinedByClosureSequence<Elements, CollectionOfOne<Element.Element>>
Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
func joined<Separator>(by separator: @escaping (Element, Element) -> Separator) -> JoinedByClosureCollection<Elements, Separator> where Separator : Collection, Separator.Element == Self.Element.Element
Returns the concatenation of the elements in this collection of collections, inserting the separator produced by the closure between each sequence.
func joined(by separator: @escaping (Element, Element) -> Element.Element) -> JoinedByClosureCollection<Elements, CollectionOfOne<Element.Element>>
Returns the concatenation of the elements in this collection of collections, inserting the separator produced by the closure between each sequence.