MapAt¶
Applies a function to the element at a given position.
Any level of the position may be All or a span, selecting a whole row or
column:
Position 0 is the head, and a longer path descends into a compound one:
$ wo '{MapAt[f, g[x], {0}], MapAt[f, g[x][y], {0}], MapAt[f, g[x][y], {0, 1}]}'
{f[g][x], f[g[x]][y], g[f[x]][y]}
Both sides of a rule are addressable:
The result comes back evaluated, so an operator-form head prints as the operator: