FilterIndex
public protocol FilterIndex
FilterIndex provides a Traversal for this structure with all its foci FilterIndexFoci whose index FilterIndexType satisfies a predicate.
-
Undocumented
Declaration
Swift
associatedtype FilterIndexType -
Undocumented
Declaration
Swift
associatedtype FilterIndexFoci -
Filters the foci of a
Traversalwith a predicate.Declaration
Swift
static func filter(_ predicate: @escaping (FilterIndexType) -> Bool) -> Traversal<Self, FilterIndexFoci>Parameters
predicateA predicate to filter the indices of this structure.
Return Value
A
Traversalbetween this structure and its foci whose indices match the provided predicate.
-
filter(_:iso:)Extension methodPre-composes the
Traversalprovided by thisFilterIndexwith an isomorphism.Declaration
Swift
static func filter<B>(_ predicate: @escaping (FilterIndexType) -> Bool, iso: Iso<B, Self>) -> Traversal<B, FilterIndexFoci>Parameters
predicateA predicate to filter the indices of this structure.
isoAn isomorphism.
Return Value
A
Traversalover a structure that is isomorphic to this one, and has the same foci. -
filter(_:iso:)Extension methodPost-composes the
Traversalprovided by theFilterIndexwith an isomorphism.Declaration
Swift
static func filter<B>(_ predicate: @escaping (FilterIndexType) -> Bool, iso: Iso<FilterIndexFoci, B>) -> Traversal<Self, B>Parameters
predicateA predicate to filter the indices of this structure.
isoAn isomorphism.
Return Value
A
Traversalbetween this structure and new foci that is isomorphic to the original ones. -
filter(_:zipWithIndex:)Extension methodProvides a
Traversalwhen this structure has an instance ofTraverse.Declaration
Swift
static func filter<F: Traverse, A>(_ predicate: @escaping (FilterIndexType) -> Bool, zipWithIndex: @escaping (Kind<F, A>) -> Kind<F, (A, FilterIndexType)>) -> Traversal<Kind<F, A>, A> where Self: Kind<F, A>, A == FilterIndexFociParameters
predicateA predicate to filter the indices of this structure.
zipWithIndexA function that associates an index to each value inside this structure.`
Return Value
A
Traversalover the elements of thisTraversestructure whose indices match the predicate.
Install in Dash
FilterIndex Protocol Reference