arrow-core-data / arrow.typeclasses / FunctorFilter

FunctorFilter

interface FunctorFilter<F> : Functor<F>

A Functor with the ability to filterMap.

Functions

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’t.open 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 Options.open fun <A> Kind<F, Option<A>>.flattenOption(): Kind<F, A>

Inheritors

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
<