Compose a non-indexed function with an
Indexed function.
Mnemonically, the
> points to the indexing we want to
preserve.
This is the same as
(.).
f . g (and
f .> g) gives you the
index of
g unless
g is index-preserving, like a
Prism,
Iso or
Equality, in which case it'll pass
through the index of
f.
>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
>>> nestedMap^..(itraversed.>itraversed).withIndex
[(10,"one,ten"),(20,"one,twenty"),(30,"two,thirty"),(40,"two,forty")]