arrow-core-data / arrow.typeclasses / FunctorFilter


interface FunctorFilter<F> : Functor<F>

A Functor with the ability to filterMap.


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>
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 A.abstract fun <A, B> Kind<F, A>.filterMap(f: (A) -> Option<B>): Kind<F, B>
flattenOption “Flatten” out a structure by collapsing fun <A> Kind<F, Option<A>>.flattenOption(): Kind<F, A>


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

Type Class Hierarchy

Do you like Arrow?

Arrow Org