# Replace part of list by applying operation to it [closed]

I want to replace, say, list[[i]] by f@list[[i]]. I can use ReplacePart as below, but I would like a more elegant way of doing it.

list = ReplacePart[list, i -> f@list[[i]]];

list = operateOnPart[list, i, f];

• Have you seen MapAt? – Michael E2 Jun 16 at 17:59
• @MichaelE2 Now I have, thanks! – Blrp Jun 16 at 18:01