types is:exact package:generic-optics

Traverse all types in the given structure. For example, to update all Strings in a WTree (Maybe String) String, we can write
>>> myTree = WithWeight (Fork (Leaf (Just "hello")) (Leaf Nothing)) "world"

>>> over (types @String) (++ "!") myTree
WithWeight (Fork (Leaf (Just "hello!")) (Leaf Nothing)) "world!"
The traversal is deep, which means that not just the immediate children are visited, but all nested values too.