Equations
Equations
Equations
- instToStringString = { toString := fun (s : String) => s }
Equations
- instToStringSubstring = { toString := fun (s : Substring) => Substring.Internal.toString s }
Equations
- instToStringBool = { toString := fun (b : Bool) => bif b then "true" else "false" }
Converts a list into a string, using ToString.toString
to convert its elements.
The resulting string resembles list literal syntax, with the elements separated by ", "
and
enclosed in square brackets.
The resulting string may not be valid Lean syntax, because there's no such expectation for
ToString
instances.
Examples:
[1, 2, 3].toString = "[1, 2, 3]"
["cat", "dog"].toString = "[cat, dog]"
["cat", "dog", ""].toString = "[cat, dog, ]"
Equations
Instances For
Equations
- instToStringList = { toString := List.toString }
Equations
- instToStringPUnit = { toString := fun (x : PUnit) => "()" }
Equations
- instToStringUnit = { toString := fun (x : Unit) => "()" }
Equations
- instToStringPos = { toString := fun (p : String.Pos) => p.byteIdx.repr }
Equations
- instToStringInt = { toString := fun (x : Int) => match x with | Int.ofNat m => toString m | Int.negSucc m => String.Internal.append "-" (toString m.succ) }
Equations
- instToStringFormat = { toString := fun (f : Std.Format) => f.pretty }
Equations
- One or more equations did not get rendered due to their size.