Shallow[expr]
prints as a shallow form of expr.
Shallow[expr,depth]
prints with all parts of expr below the specified depth given in skeleton form.
Shallow[expr,{depth,length}]
also gives parts whose lengths are above the specified limit in skeleton form.
Shallow[expr,{depth,length},form]
uses skeleton form for any parts that match the pattern form.
Shallow
Shallow[expr]
prints as a shallow form of expr.
Shallow[expr,depth]
prints with all parts of expr below the specified depth given in skeleton form.
Shallow[expr,{depth,length}]
also gives parts whose lengths are above the specified limit in skeleton form.
Shallow[expr,{depth,length},form]
uses skeleton form for any parts that match the pattern form.
Details
- Omitted sequences of elements are given as Skeleton objects, which print in the form k.
- In StandardForm, the characters used for this output are \[LeftSkeleton] and .
- Depth and length can be specified as Infinity. »
- Shallow[expr] is equivalent to Shallow[expr,{4,10}]. »
- When an input evaluates to Shallow[expr], Shallow does not appear in the output. »
- Trying to feed k as obtained from Shallow back as input to the Wolfram Language in StandardForm will generate an error. »
Examples
open all close allBasic Examples (2)
Scope (7)
Shallow[expr] formats as expr truncated to depth 4:
Shallow[{1, {2, {3, {4}}}}]Depth[{1, {2, {rest}}}]Shallow[expr] prints parts of expr after the 10
part in skeleton form:
Shallow[Range[15]]Truncate expr to an effective depth of 3:
Shallow[{a, {b, c}, d, {e, f, g}}, 3]Print parts of expr after the 5
part in skeleton form:
Shallow[Range[15], {4, 5}]Print parts of expr below depth 3 or after the 5
part in skeleton form:
Shallow[{1, {2}, 3, {{4}}, 5, {6, {7}}, 8}, {3, 5}]Print all lists in expr in skeleton form:
Shallow[f[Range[15], g[Range[100]]], {Infinity, Infinity}, _List]Shallow[expr,{d,l},form] prints parts below depth d, after the part l or matching form in skeleton form:
Shallow[{"abcdef", {1}, b, {{2}}, "uvwxyz", {3, {4}}, d}, {3, 5}, _String]Properties & Relations (4)
Shortened outputs contain Skeleton objects:
Shallow[Range[100]]Skeleton[90]Shallow[expr] is equivalent to Shallow[expr,{4,10}]:
Shallow[Join[NestList[f, a, 5], Range[6]], {4, 10}]Shallow[%]Short displays with long expressions shortened from within:
Short[Range[100]]Shallow shortens from the end:
Shallow[Range[100]]When an input evaluates to Shallow[expr], Shallow does not appear in the output:
Shallow[Range[50]]Out is assigned the result Range[50], not Short[Range[50]]:
%Possible Issues (2)
The output of Shallow cannot be used as input if k appears in the result:
Shallow[Range[100]]Copy the output and paste it into an input cell. The 90 will cause an error:
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, «90»}Even when an output omits Shallow from the top level, it is not stripped from subexpressions:
e = Shallow[Range[50, 100]]The output does not have Shallow in it:
%However, the variable e does have Shallow in it, which may affect subsequent evaluations:
FullForm[e]This Join is not evaluated due to the intervening Shallow:
Join[e, {101}]Assign variables first and then apply Shallow to the result to maintain computability:
(f = Range[50, 100])//ShallowJoin[f, {101}]See Also
$OutputSizeLimit Short Iconize OpenerView Format Skeleton StringSkeleton
Function Repository: ExpandableForm ShortInputForm
Tech Notes
Related Guides
Related Workflows
- Shorten Long Outputs
History
Introduced in 1991 (2.0) | Updated in 1996 (3.0)
Text
Wolfram Research (1991), Shallow, Wolfram Language function, https://reference.wolfram.com/language/ref/Shallow.html (updated 1996).
CMS
Wolfram Language. 1991. "Shallow." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Shallow.html.
APA
Wolfram Language. (1991). Shallow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Shallow.html
BibTeX
@misc{reference.wolfram_2026_shallow, author="Wolfram Research", title="{Shallow}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Shallow.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_shallow, organization={Wolfram Research}, title={Shallow}, year={1996}, url={https://reference.wolfram.com/language/ref/Shallow.html}, note=[Accessed: 13-June-2026]}