arrow-optics / arrow.optics.typeclasses / FilterIndex


interface FilterIndex<S, I, A>

FilterIndex provides a Traversal for a structure S with all its foci A whose index I satisfies a predicate.


S - source of Traversal

I - index that uniquely identifies every focus of the Traversal

A - focus that is supposed to be unique for a given pair S and I


filter Filter the foci A of a Traversal with the predicate p.abstract fun filter(p: Predicate<I>): Traversal<S, A>

Companion Object Functions

fromIso Lift an instance of FilterIndex using an Isofun <S, A, I, B> fromIso(FI: FilterIndex<A, I, B>, iso: Iso<S, A>): FilterIndex<S, I, B>
fromTraverse Create an instance of FilterIndex from a Traverse and a function Kind<S, A>) -> Kind<S, Tuple2<A, Int>>fun <S, A> fromTraverse(zipWithIndex: (Kind<S, A>) -> Kind<S, Tuple2<A, Int>>, traverse: Traverse<S>): FilterIndex<Kind<S, A>, Int, A>


filterMapIndex FilterIndex instance definition for Map.interface filterMapIndex<K, V> : FilterIndex<Map<K, V>, K, V>
ListFilterIndex FilterIndex instance definition for List.interface ListFilterIndex<A> : FilterIndex<List<A>, Int, A>
ListKFilterIndex FilterIndex instance definition for ListK.interface ListKFilterIndex<A> : FilterIndex<ListK<A>, Int, A>
MapKFilterIndex FilterIndex instance definition for Map.interface MapKFilterIndex<K, V> : FilterIndex<MapK<K, V>, K, V>
NonEmptyListFilterIndex FilterIndex instance definition for NonEmptyList.interface NonEmptyListFilterIndex<A> : FilterIndex<NonEmptyList<A>, Int, A>
SequenceKFilterIndex FilterIndex instance definition for SequenceK.interface SequenceKFilterIndex<A> : FilterIndex<SequenceK<A>, Int, A>
StringFilterIndex FilterIndex instance for String. It allows filtering of every Char in a String by its index’s position.interface StringFilterIndex : FilterIndex<String, Int, Char>

Type Class Hierarchy

Do you like Arrow?

Arrow Org