ShellRender
ShellRender: the combinators march --shell renders a result with.
The shell (bin/shell_cmd.ml, bin/shell_render_gen.ml) compiles each input into a fragment that returns its result as a String. It generates, from the result's static type, a renderer built from these functions: one per record, tuple and ADT the type reaches, each passing the element limit down. The rules (R5.7 of specs/plans/2026-09-28-observe-recon-shell-plan.md):
- A collection (List, Array, Map, Set, and the other stdlib containers:
HashMap, OrderedMap, SortedSet, Deque, Queue, RRB.Vec, NativeArray) shows
at most `limit` elements and then `… n more`. A string shows at most `limit` characters (codepoints),
quoted and escaped, then `… n more chars`. The limit applies at every
depth; `limit <= 0` means no limit.- Records, tuples and constructors render field by field, in derive Show's
form.- A hand-written Show impl's string is cut at 16 KiB (
show_cut).
Functions
An anonymous record: { a: 1, b: 2 }. Each field arrives rendered as a: 1.
An Array: Array[1, 2, … n more], as list.
A constructor with arguments: Name(a, b).
A Deque: Deque[1, 2, … n more], as list, front to back.
A HashMap: HashMap{k => v, … n more}, as map, in the map's hash order.
A list, each element rendered by f: [1, 2, … 98 more] at most limit elements (all when limit <= 0).
A Map: Map{k => v, … n more}, keys by fk and values by fv, at most limit entries, in the map's iteration order.
A NativeArray, given as the list of its elements (its family's to_list_*): NativeArray[1, 2, … n more], as list.
An OrderedMap: OrderedMap{k => v, … n more}, as map, in key order.
A Queue: Queue[1, 2, … n more], as list, front to back.
s as a March string literal: quoted, with double quotes, backslashes, control bytes and an interpolation opener escaped.
s unquoted, cut after limit codepoints with … n more chars (limit <= 0 keeps all of it): the shell prints a string at the top of a result this way, and the payload of a top-level one-field constructor (Ok("…"), as Actor.inspect_state returns its already rendered state).
A named record, in derive Show's form: Name { a = 1, b = 2 }. Each field arrives rendered as a = 1.
An RRB vector: RRB.Vec[1, 2, … n more], as list, in index order.
A Set: Set{1, 2, … n more}, as list, in the set's iteration order.
The most bytes show_cut keeps of a hand-written Show impl's string: 16 KiB.
A hand-written Show impl's string, cut at 16 KiB (on a codepoint boundary) with … (n more bytes); it cannot take an element limit.
A SortedSet: SortedSet{1, 2, … n more}, as list, in order.
s quoted (see quote), cut after limit codepoints with … n more chars. limit <= 0 keeps all of it.
A tuple: (a, b).