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.

defmax_depth#
pub def max_depth : I64
defmax_elements#
pub def max_elements : I64
defformat_type#
pub def format_type (scope : Scope) (typ : Term) : String

The : Type half. show_term renders source-shaped types; the outer parentheses it puts on an application are left alone (v1).

defformat_value#
pub def format_value (scope : Scope) (typ : Term) (v : Value) : String