lang::pretty

lang/src/pretty.mo

defshow_term#
pub def show_term (t : Term) : String
defescape_string#
pub def escape_string (s : String) : String

Escape a string's content for a "..." literal, so that what show_literal prints reads back as the same value. Escapes \ and " (required by the lexer), names the five common control bytes, and spells the rest \u{..}. Bytes from 0x20 up are copied in RUNS rather than one at a time: a lone byte of a multi-byte UTF-8 sequence is not a valid String, so an astral character must stay whole.

defshow_inductive#
pub def show_inductive (ind : Inductive) : String
defshow_struct#
pub def show_struct (s : Struct) : String

A struct declaration as source: struct Name {, one field per line, }.

defshow_class#
pub def show_class (cls : Class) : String
defshow_decls#
pub def show_decls (decl_list : List Decl) : String

Pretty-print a whole decl_list, one show_decl per declaration separated by a blank line — the shape monad pretty's CLI command wants (a readable source-text dump of a file's own declarations, not a Show.show-derived debug dump of the internal LoadedModules structure).