lang::repl::value_format
lang/src/repl/value_format.mo
Human-readable rendering for the browser REPL's result line.
The interpreter's own show_value_debug prints raw tags
(v_con#1/2), which is honest but unreadable. This module is
TYPE-DIRECTED instead: the inferred type of the evaluated expression
selects the constructor names, so some 3, [1, 2], ok "x" and a
user Point { .. } all print as source-shaped values. It lives in
lang because scope_find_inductive is package-private here.
Budgets: depth 64, 200 list elements, 8 KiB of output -- the web
import scratch buffer is 64 KiB, and a runaway List I64 would
otherwise fill it.
pub def max_depth : I64pub def max_elements : I64pub def format_type (scope : Scope) (typ : Term) : StringThe : Type half. show_term renders source-shaped types; the outer
parentheses it puts on an application are left alone (v1).
pub def format_value (scope : Scope) (typ : Term) (v : Value) : String