- toString : α → String
Instances
- Lean.Lsp.instToStringRpcRef
- Lean.instToStringRat
- IO.Error.instToStringError
- Lean.instToStringDataValue
- Lean.ExprStructEq.instToStringExprStructEq
- Lean.Xml.instToStringContent
- Lean.Elab.Term.StructInst.instToStringFieldStruct
- instToStringByteArray
- instToStringUInt32
- Lean.Position.instToStringPosition
- instToStringUInt8
- Lean.Json.instToStringJson
- instToStringSubstring
- Lean.Elab.Term.instToStringLVal
- Std.PersistentHashMap.instToStringStats
- Lean.IR.instToStringExpr
- Lean.Parser.Trie.instToStringTrie
- Lean.SubExpr.Pos.instToStringPos
- Lean.Syntax.instToStringTSyntax
- instToStringSigma
- Lean.Parser.Error.instToStringError
- Lean.Elab.Term.instToStringSyntheticMVarKind
- Lean.JsonNumber.instToStringJsonNumber
- Lean.Elab.Term.instToStringNamedArg
- instToStringFormat
- Lean.IR.Borrow.instToStringParamMap
- Lean.instToStringNamePart
- EStateM.instToStringResult
- Lean.IR.UnreachableBranches.instToStringValue
- Lean.IR.UnreachableBranches.Value.instToStringValue
- instToStringId
- Lean.IR.instToStringVarId
- Lean.Elab.instToStringModifiers
- instToStringDecidable
- instToStringSubtype
- Lean.Meta.RecursorInfo.instToStringRecursorInfo
- Lean.KVMap.instToStringKVMap
- instToStringPUnit
- instToStringUnit
- instToStringOption
- Unicode.GeneralCategory.instToStringGeneralCategory
- Lean.Lsp.instToStringPosition
- Lean.Syntax.instToStringSyntax
- Lean.Lsp.instToStringTextDocumentPositionParams
- instToStringUInt64
- Lean.Expr.instToStringExpr
- instToStringUInt16
- Lean.IR.instToStringIRType
- Lean.Xml.instToStringAttributes
- Lean.Meta.instToStringRecursorUnivLevelPos
- Lean.Elab.instToStringVisibility
- instToStringIterator
- instToStringList
- instToStringSubarray
- Lean.instToStringLOption
- Lean.Xml.instToStringElement
- instToStringSum
- Std.PersistentArray.instToStringStats
- Lean.Parser.FirstTokens.instToStringFirstTokens
- instToStringFloat
- instToStringNat
- Lean.LBool.instToStringLBool
- Lean.JsonRpc.instToStringRequestID
- Lean.Elab.Term.instToStringMVarErrorKind
- Array.instToStringArray
- Lean.OpenDecl.instToStringOpenDecl
- Lean.IR.instToStringDecl
- instToStringProd
- System.instToStringFilePath
- instToStringULift
- Lean.instToStringAttributeKind
- Lean.instToStringOptions
- Lean.instToStringImport
- instToStringBool
- instToStringFloatArray
- Lean.MetavarContext.MkBinding.instToStringException
- Lean.Elab.Term.StructInst.instToStringStruct
- Lean.Elab.Term.instToStringArg
- instToStringIdType
- instToStringExcept
- instToStringPos
- Lean.Name.instToStringName
- instToStringString
- instToStringUSize
- Lean.IR.instToStringJoinPointId
- instToStringChar
- instToStringFin
- Lean.Level.instToStringLevel
- Lean.IR.instToStringFnBody
- instToStringInt
Equations
- instToStringIdType = inferInstanceAs (ToString α)
Equations
- instToStringId = inferInstanceAs (ToString α)
Equations
- instToStringString = { toString := fun s => s }
Equations
- instToStringSubstring = { toString := fun s => Substring.toString s }
Equations
- instToStringIterator = { toString := fun it => String.Iterator.remainingToString it }
Equations
- instToStringBool = { toString := fun b => bif b then "true" else "false" }
Equations
- List.toStringAux _fun_discr [] = ""
- List.toStringAux true (x :: xs) = toString x ++ List.toStringAux false xs
- List.toStringAux false (x :: xs) = ", " ++ toString x ++ List.toStringAux false xs
Equations
- List.toString _fun_discr = match _fun_discr with | [] => "[]" | x :: xs => "[" ++ List.toStringAux true (x :: xs) ++ "]"
Equations
- instToStringPUnit = { toString := fun x => "()" }
Equations
- instToStringUnit = { toString := fun x => "()" }
Equations
- instToStringNat = { toString := fun n => Nat.repr n }
Equations
- instToStringPos = { toString := fun p => Nat.repr p.byteIdx }
Equations
- instToStringInt = { toString := fun x => match x with | Int.ofNat m => toString m | Int.negSucc m => "-" ++ toString (Nat.succ m) }
Equations
- instToStringChar = { toString := fun c => Char.toString c }
Equations
- instToStringFin n = { toString := fun f => toString f.val }
Equations
- instToStringUInt8 = { toString := fun n => toString (UInt8.toNat n) }
Equations
- instToStringUInt16 = { toString := fun n => toString (UInt16.toNat n) }
Equations
- instToStringUInt32 = { toString := fun n => toString (UInt32.toNat n) }
Equations
- instToStringUInt64 = { toString := fun n => toString (UInt64.toNat n) }
Equations
- instToStringUSize = { toString := fun n => toString (USize.toNat n) }
Equations
- instToStringFormat = { toString := fun f => Lean.Format.pretty f }
Equations
- One or more equations did not get rendered due to their size.
instance
instToStringSigma
{α : Type u}
{β : α → Type v}
[inst : ToString α]
[inst : (x : α) → ToString (β x)]
:
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
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
Equations
- String.toInt! s = match String.toInt? s with | some v => v | none => panic "Int expected"