@[class]
- to_string : α → string
Convert the object into a string for tracing/display purposes.
Similar to Haskell's show
.
See also has_repr
, which is used to output a string which is a valid lean code.
See also has_to_format
and has_to_tactic_format
, format
has additional support for colours and pretty printing multilines.
Instances
- string.has_to_string
- bool.has_to_string
- decidable.has_to_string
- list.has_to_string
- unit.has_to_string
- nat.has_to_string
- char.has_to_string
- fin.has_to_string
- unsigned.has_to_string
- option.has_to_string
- sum.has_to_string
- prod.has_to_string
- sigma.has_to_string
- subtype.has_to_string
- name.has_to_string
- format.has_to_string
- exceptional.has_to_string
- level.has_to_string
- native.rb_map.has_to_string
- expr.has_to_string
- interaction_monad.result_has_string
- tactic_state.has_to_string
- tactic.interactive.case_tag.has_to_string
- module_info.has_to_string
- expr.coord.has_to_string
- expr.address.has_to_string
- int.has_to_string
- native.float.has_to_string
- json.has_to_string
- widget.interactive_expression.sf.has_to_string
- feature_search.feature.has_to_string
- feature_search.feature_vec.has_to_string
- feature_search.feature_stats.has_to_string
- tactic_doc_entry.has_to_string
- binder.has_to_string
- widget_override.interactive_expression.sf.has_to_string
- norm_cast.label.has_to_string
- tactic.tactic_script.has_to_string
- tactic.tactic_script_unit_has_to_string
- tactic.simp_arg_type.has_to_string
- expr_lens.dir.has_to_string
- rat.has_to_string
- linarith.ineq.has_to_string
- composition.has_to_string
Equations
@[protected, instance]
Equations
- string.has_to_string = {to_string := λ (s : string), s}
@[protected, instance]
@[protected, instance]
@[protected]
Equations
- list.to_string_aux tt (x :: xs) = to_string x ++ list.to_string_aux ff xs
- list.to_string_aux tt list.nil = ""
- list.to_string_aux ff (x :: xs) = ", " ++ to_string x ++ list.to_string_aux ff xs
- list.to_string_aux ff list.nil = ""
@[protected, instance]
Equations
- list.has_to_string = {to_string := list.to_string _inst_1}
@[protected, instance]
Equations
- unit.has_to_string = {to_string := λ (u : unit), "star"}
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
def
sum.has_to_string
{α : Type u}
{β : Type v}
[has_to_string α]
[has_to_string β] :
has_to_string (α ⊕ β)
@[protected, instance]
def
prod.has_to_string
{α : Type u}
{β : Type v}
[has_to_string α]
[has_to_string β] :
has_to_string (α × β)
@[protected, instance]
def
sigma.has_to_string
{α : Type u}
{β : α → Type v}
[has_to_string α]
[s : Π (x : α), has_to_string (β x)] :
has_to_string (sigma β)
@[protected, instance]