arrow-core-data / arrow.typeclasses / TraverseFilter


interface TraverseFilter<F> : Traverse<F>, FunctorFilter<F>


filter Apply a filter to a structure such that the output structure contains all A elements in the input structure that satisfy the predicate f but none that don’ fun <A> Kind<F, A>.filter(f: (A) -> Boolean): Kind<F, A>
filterA open fun <G, A> Kind<F, A>.filterA(f: (A) -> Kind<G, Boolean>, GA: Applicative<G>): Kind<G, Kind<F, A>>
filterMap A combined map and filter. Filtering is handled via Option instead of Boolean such that the output type B can be different than the input type fun <A, B> Kind<F, A>.filterMap(f: (A) -> Option<B>): Kind<F, B>
traverseFilter abstract fun <G, A, B> Kind<F, A>.traverseFilter(AP: Applicative<G>, f: (A) -> Kind<G, Option<B>>): Kind<G, Kind<F, B>>

Type Class Hierarchy

Do you like Arrow?

Arrow Org