MapAll[f,expr]
or f//@expr applies f to every subexpression in expr.
MapAll 
MapAll[f,expr]
or f//@expr applies f to every subexpression in expr.
Details and Options
- MapAll[f,expr] is equivalent to Map[f,expr,{0,Infinity}].
- MapAll[f,expr,Heads->True] applies f to heads in expr, and their parts.
- If expr is an Association object, MapAll[f,expr] applies f only to the values in the association. »
- If expr is a SparseArray object or structured array, MapAll[f,expr] applies f to the values or subarrays just as it would on the corresponding ordinary list. »
Examples
open all close allBasic Examples (2)
Scope (4)
MapAll can be used on expressions with any head:
MapAll[f, a + b + c + d]MapAll[f, x ^ 2 + y ^ 2]The function can be mapped onto the heads as well:
MapAll[f, {a, b, c}, Heads -> True]MapAll can be used on sparse arrays:
SparseArray[{1 -> 1, 3 -> 3}]MapAll[f, %]Use MapAll with structured arrays, such as SymmetrizedArray:
SymmetrizedArray[{{1, 2} -> 1, {1, 3} -> 2, {2, 3} -> 3}, {3, 3}, Antisymmetric[All]]f //@ %Options (1)
Applications (1)
Properties & Relations (2)
MapAll is equivalent to a specific level specification in Map:
Map[f, {{a, b}, {c}, {{d}}}, {0, ∞}]MapAll[f, {{a, b}, {c}, {{d}}}]MapAll maps also around the whole expression; Map[f,expr,∞] does not:
MapAll[f, {{a, b}, {c, d}}]Map[f, {{a, b}, {c, d}}, ∞]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), MapAll, Wolfram Language function, https://reference.wolfram.com/language/ref/MapAll.html.
CMS
Wolfram Language. 1988. "MapAll." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MapAll.html.
APA
Wolfram Language. (1988). MapAll. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MapAll.html
BibTeX
@misc{reference.wolfram_2026_mapall, author="Wolfram Research", title="{MapAll}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/MapAll.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mapall, organization={Wolfram Research}, title={MapAll}, year={1988}, url={https://reference.wolfram.com/language/ref/MapAll.html}, note=[Accessed: 12-June-2026]}