TraverseFilter
public protocol TraverseFilter : FunctorFilter, Traverse
TraverseFilter represents array-like structures that can be traversed and filtered as a single combined operation. It provides the same capabilities as Traverse and FunctorFilter together.
-
A combined traverse and filter operation. Filtering is handled using
Optioninstead of Bool so that the output can be different than the input type.Declaration
Parameters
faA value in the context implementing this instance.
fA function to traverse and filter each value.
Return Value
Result of traversing this structure and filter values using the provided function.
-
filterA(_:_:)Extension methodFilters values in a different context.
Declaration
Swift
static func filterA<A, G: Applicative>( _ fa: Kind<Self, A>, _ f: @escaping (A) -> Kind<G, Bool>) -> Kind<G, Kind<Self, A>>Parameters
faA value in the context implementing this instance.
fA function to filter each value.
Return Value
Result of traversing this structure and filter values using the provided function.
-
filter(_:_:)Extension methodFilters values using a predicate.
Declaration
Parameters
faA value in the context implementing this instance.
fA boolean predicate.
Return Value
Result of traversing this structure and filter values using the provided function.
Install in Dash
TraverseFilter Protocol Reference