unsafe -package:base package:optics-core

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).
Obtain a potentially empty IxAffineTraversal by taking the element from another AffineFold and using it as an index.
  • - Note: This is not a legal IxTraversal, unless you are very careful not to invalidate the predicate on the target (see unsafeFiltered for more details).