RefinementSequence
struct RefinementSequence : IteratorProtocol, Sequence, Sendable
The traits of a refinement closure sorted in topological order w.r.t. to their refinements.
The sequence is ordered such that a trait t always occur after the traits which it
refines. Hence the last element of the sequence is the most refined trait of the closure.
-
A stack of vertices left to visit with the indices of their currently visited neighbors.
Declaration
Swift
private typealias VisitList = [(TraitType, RefinementClosure.Refinements.OutgoingEdges.Index)] -
The closure from which traits are returned.
Declaration
Swift
let closure: RefinementClosure -
The current state of the iterator.
Declaration
Swift
private var state: VisitList -
The traits that have been returned already.
Declaration
Swift
private var visited: Set<TraitType> -
Creates an instance returning the traits in
closure.Declaration
Swift
init(_ closure: RefinementClosure) -
The number of traits in
closure.Declaration
Swift
var underestimatedCount: Int { get } -
Returns the next trait, or
nilif all traits have been returned already.Declaration
Swift
mutating func next() -> TraitType?
View on GitHub