So _find is not really Traversal :
> [1..10] & over (_find odd) succ . over (_find odd) succ [2,2,4,4,5,6,7,8,9,10] > [1..10] & over (_find odd) (succ . succ) [3,2,3,4,5,6,7,8,9,10]
The same feeling filtered not a workaround.
Getting the part can be mimicked with filtered (this is normal, as Fold has no laws):
> [1..10] ^? _find even Just 2 > [1..10] ^? _find (> 20) Nothing > [1..10] ^? folded . filtered even Just 2 > [1..10] ^? folded . filtered (> 20) Nothing
Now, assuming that the βmore direct pathβ is the smart Traversal : no, which is impossible, Traversal cannot change the structure of the thing passed.
Matvey aksenov
source share