Equations
- instToStringIdType = inferInstanceAs (ToString α)
Equations
- instToStringId = inferInstanceAs (ToString α)
Equations
- instToStringString = { toString := fun (s : String) => s }
Equations
- instToStringSubstring = { toString := fun (s : Substring) => Substring.toString s }
Equations
- instToStringIterator = { toString := fun (it : String.Iterator) => String.Iterator.remainingToString it }
Equations
- instToStringBool = { toString := fun (b : Bool) => bif b then "true" else "false" }
Equations
- instToStringPUnit = { toString := fun (x : PUnit) => "()" }
Equations
- instToStringUnit = { toString := fun (x : Unit) => "()" }
Equations
- instToStringNat = { toString := fun (n : Nat) => Nat.repr n }
Equations
- instToStringPos = { toString := fun (p : String.Pos) => Nat.repr p.byteIdx }
Equations
- instToStringInt = { toString := fun (x : Int) => match x with | Int.ofNat m => toString m | Int.negSucc m => "-" ++ toString (Nat.succ m) }
Equations
- instToStringChar = { toString := fun (c : Char) => Char.toString c }
Equations
- instToStringFin n = { toString := fun (f : Fin n) => toString f.val }
Equations
- instToStringUInt8 = { toString := fun (n : UInt8) => toString (UInt8.toNat n) }
Equations
- instToStringUInt16 = { toString := fun (n : UInt16) => toString (UInt16.toNat n) }
Equations
- instToStringUInt32 = { toString := fun (n : UInt32) => toString (UInt32.toNat n) }
Equations
- instToStringUInt64 = { toString := fun (n : UInt64) => toString (UInt64.toNat n) }
Equations
- instToStringUSize = { toString := fun (n : USize) => toString (USize.toNat n) }
Equations
- instToStringFormat = { toString := fun (f : Lean.Format) => Lean.Format.pretty f }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- String.toInt? s = if String.get s 0 = Char.ofNat 45 then do let v ← Substring.toNat? (Substring.drop (String.toSubstring s) 1) pure (-Int.ofNat v) else Int.ofNat <$> String.toNat? s
Instances For
Equations
- String.isInt s = if String.get s 0 = Char.ofNat 45 then Substring.isNat (Substring.drop (String.toSubstring s) 1) else String.isNat s
Instances For
Equations
- String.toInt! s = match String.toInt? s with | some v => v | none => panic "Int expected"