- 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
- 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
- Lean.Lsp.instToStringPosition
- Lean.Syntax.instToStringSyntax
- 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
- Lean.Elab.Term.instToStringPatternVar
- instToStringExcept
- 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 => cond b "true" "false" }
Equations
- List.toStringAux x [] = ""
- List.toStringAux true (x_2 :: xs) = toString x_2 ++ List.toStringAux false xs
- List.toStringAux false (x_2 :: xs) = ", " ++ toString x_2 ++ List.toStringAux false xs
Equations
- List.toString x = match x with | [] => "[]" | x :: xs => "[" ++ List.toStringAux true (x :: xs) ++ "]"
Equations
- instToStringPUnit = { toString := fun x => "()" }
Equations
- instToStringUnit = { toString := fun u => "()" }
Equations
- instToStringNat = { toString := fun n => Nat.repr n }
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
- addParenHeuristic s = if (String.isPrefixOf "(" s || String.isPrefixOf "[" s || String.isPrefixOf "{" s || String.isPrefixOf "#[" s) = true then s else if (!String.any s Char.isWhitespace) = true then s else "(" ++ s ++ ")"
Equations
- String.toInt? s = OptionM.run (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"
Equations
- instReprExcept = { reprPrec := fun x x_1 => match x, x_1 with | Except.error e, prec => Repr.addAppParen (Std.Format.text "Except.error " ++ reprArg e) prec | Except.ok a, prec => Repr.addAppParen (Std.Format.text "Except.ok " ++ reprArg a) prec }