mapWithIndex

mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq b
containers Data.Sequence
A generalization of fmap, mapWithIndex takes a mapping function that also depends on the element's index, and applies it to every element in the sequence.