Does imapMOf work? You would use it as imapMOf someIndexedTraversal actionWithIndex dataStructure
I think.
If you just need to perform an action, there's also imapMOf_ in Control.Lens.Fold
.
I haven't used indexed traversals much, but I find the API a bit confusing. Most of the time I use lenses with either ^.
or ^!
, but for indexed traversals it seems the usual way is to use one of the special index-aware functions, which seems a bit different.