Details and Options
ResourceFunction["MapSlice"] is a variant of
MapIndexed that gives the part specifications as a sequence of arguments rather than a single
List argument.
ResourceFunction["MapSlice"] uses standard level specifications just like
MapIndexed.
The default value for levelspec in ResourceFunction["MapSlice"] is {1}.
A positive level n consists of all parts of expr specified by n indices.
A negative level -n consists of all parts of expr with depth n.
Level –1 consists of numbers, symbols and other objects that do not have subparts.
Level 0 corresponds to the whole expression.
ResourceFunction["MapSlice"] traverses the parts of
expr in a depth-first order, with leaves visited before roots.
ResourceFunction["MapSlice"] always effectively constructs a complete new expression and then evaluates it.
ResourceFunction["MapSlice"] works on SparseArray objects, effectively by applying Normal to them.
ResourceFunction["MapSlice"] works on Association objects, giving part specifications in the form Key[k].
ResourceFunction["MapSlice"][f][expr] is equivalent to ResourceFunction["MapSlice"][f,expr,{1}].