2
$\begingroup$

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];
$\endgroup$
2
  • 4
    $\begingroup$ Have you seen MapAt? $\endgroup$ – Michael E2 Jun 16 at 17:59
  • $\begingroup$ @MichaelE2 Now I have, thanks! $\endgroup$ – Blrp Jun 16 at 18:01