layout | title | permalink |
---|---|---|
docs-core |
TraverseFilter |
/arrow/typeclasses/traversefilter/ |
TraverseFilter
is helpful when you want to combine Traverse
and FunctorFilter
as one combined operation.
This doc focuses on the methods provided by the typeclass.
TraverseFilter
includes all combinators present in [Traverse
]({{ '/arrow/typeclasses/traverse/' | relative_url }})
and [FunctorFilter
]({{ '/arrow/typeclasses/functorfilter/' | relative_url }}).
Returns F<B>
in G
context by applying AP
on a selector function f
, which returns Option
of B
in G
context.
Returns F<A>
in G
context by applying GA
on a selector function f
in G
context.
Filter out instances of a specific type and traverse a context.
Arrow provides TraverseFilterLaws
{:target="_blank"} in the form of test cases for internal verification of lawful instances and third party apps creating their own TraverseFilter
instances.
Arrow already provides TraverseFilter
instances for most common datatypes both in Arrow and the Kotlin stdlib.
Oftentimes, you may find the need to provide your own for unsupported datatypes.
See [Deriving and creating custom typeclass]({{ '/patterns/glossary' | relative_url }})