Filter result(s) of a traversal that don't satisfy a predicate.
Note: This is
not a legal
Traversal, unless you
are very careful not to invalidate the predicate on the target.
As a counter example, consider that given
evens =
unsafeFiltered even the second
Traversal law
is violated:
over evens succ . over evens succ /= over evens (succ . succ)
So, in order for this to qualify as a legal
Traversal you can
only use it for actions that preserve the result of the predicate!
For a safe variant see
indices (or
filtered for
read-only optics).