<p dir="ltr">foldMapWithIndex :: Monoid m<br>
     => (Int -> a -> m) -> Seq a -> m</p>
<p dir="ltr">This would match both Data.Map.foldMapWithKey and Control.Lens.Indexed.ifoldMap, filling out the indexed fold menagerie.</p>
<p dir="ltr">Annoyingly, the straightforward implementation I've come up with is rather slow when used with Endo to implement either foldlWithIndex or foldrWithIndex. I suspect the polymorphic recursion inherent in these sequences is blinding GHC's optimizer. Oh well.</p>