filter

fun <S, A> Traversal<S, A>.filter(predicate: (A) -> Boolean): Traversal<S, A>

Focuses on those values for which the predicate is true.

See Optional.filter for further description of the caution one should be with this optic.


fun <S, A> Optional<S, A>.filter(predicate: (A) -> Boolean): Optional<S, A>

Focuses on the value only if the predicate is true.

See Optional.filter for further description of the caution one should be with this optic.