Types that can be converted into a string for display.
There is no expectation that the resulting string can be parsed back to the original data (see
Repr for a similar class with this expectation).
- toString : α → String
Converts a value into a string.
Instances
- Aesop.BuilderName.instToString
- Aesop.DisplayRuleName.instToString
- Aesop.ForwardRule.instToString
- Aesop.ForwardRulePriority.instToString
- Aesop.Frontend.DBuilderName.instToString
- Aesop.Frontend.Priority.instToString
- Aesop.GoalId.instToString
- Aesop.GoalState.instToString
- Aesop.Iteration.instToString
- Aesop.NodeState.instToString
- Aesop.Percent.instToString
- Aesop.PhaseName.instToString
- Aesop.RappId.instToString
- Aesop.RuleName.instToString
- Aesop.RuleStats.instToString
- Aesop.Safety.instToString
- Aesop.ScopeName.instToString
- Aesop.UnorderedArraySet.instToString
- Aesop.UnsafeQueueEntry.instToString
- Aesop.instToStringLevelIndex
- Aesop.instToStringNormRule
- Aesop.instToStringPINF
- Aesop.instToStringPINFRaw
- Aesop.instToStringPremiseIndex
- Aesop.instToStringSafeRule
- Aesop.instToStringSlotIndex
- Aesop.instToStringUnsafeRule
- Array.instToString
- BitVec.instToString
- EStateM.instToStringResult
- IO.Error.instToString
- IO.instToStringTaskState
- Lake.BuildKey.instToString
- Lake.CliError.instToString
- Lake.Date.instToString
- Lake.Glob.instToString
- Lake.Hash.instToString
- Lake.Log.instToString
- Lake.Toml.DateTime.instToString
- Lake.Toml.Time.instToString
- Lake.Toml.instToStringKeyTy
- Lake.Toml.instToStringValue
- Lake.instToStringBackend
- Lake.instToStringBuildInfo
- Lake.instToStringBuildType
- Lake.instToStringGitRepo
- Lake.instToStringLogEntry
- Lake.instToStringLogLevel
- Lake.instToStringOptDataKind
- Lake.instToStringPartialBuildKey
- Lake.instToStringSemVerCore
- Lake.instToStringStdVer
- Lake.instToStringTarget
- Lake.instToStringTextFilePath
- Lake.instToStringToolchainVer
- Lean.Compiler.LCNF.instToStringPhase
- Lean.Data.Trie.instToString
- Lean.Diff.instToStringAction
- Lean.Elab.Tactic.Omega.Fact.instToString
- Lean.Elab.Tactic.Omega.Justification.instToString
- Lean.Elab.Tactic.Omega.Problem.instToString
- Lean.Elab.Tactic.Omega.Problem.instToStringFourierMotzkinData
- Lean.Elab.Term.instToStringArg
- Lean.Elab.Term.instToStringLVal
- Lean.Elab.Term.instToStringMVarErrorKind
- Lean.Elab.Term.instToStringNamedArg
- Lean.Elab.Term.instToStringSyntheticMVarKind
- Lean.Elab.WF.GuessLex.instToStringGuessLexRel
- Lean.Elab.instToStringModifiers
- Lean.Elab.instToStringVisibility
- Lean.Expr.instToString
- Lean.ExprStructEq.instToString
- Lean.IR.Borrow.instToStringParamMap
- Lean.IR.EmitLLVM.instToStringRefcountKind
- Lean.IR.UnreachableBranches.Value.instToString
- Lean.IR.UnreachableBranches.instToStringValue
- Lean.IR.instToStringDecl
- Lean.IR.instToStringExpr
- Lean.IR.instToStringFnBody
- Lean.IR.instToStringIRType
- Lean.IR.instToStringJoinPointId
- Lean.IR.instToStringVarId
- Lean.Json.instToString
- Lean.JsonNumber.instToString
- Lean.JsonRpc.instToStringRequestID
- Lean.KVMap.instToString
- Lean.LBool.instToString
- Lean.Level.instToString
- Lean.Lsp.instToStringPosition
- Lean.Lsp.instToStringRpcRef
- Lean.Lsp.instToStringTextDocumentPositionParams
- Lean.Meta.RecursorInfo.instToString
- Lean.Meta.instToStringRecursorUnivLevelPos
- Lean.MetavarContext.MkBinding.instToStringException
- Lean.Name.instToString
- Lean.Omega.Constraint.instToString
- Lean.Omega.LinearCombo.instToString
- Lean.OpenDecl.instToString
- Lean.Parser.Error.instToString
- Lean.Parser.FirstTokens.instToString
- Lean.PersistentArray.instToStringStats
- Lean.PersistentHashMap.instToStringStats
- Lean.Position.instToString
- Lean.SerialMessage.instToString
- Lean.SubExpr.Pos.instToString
- Lean.Syntax.instToString
- Lean.Syntax.instToStringTSyntax
- Lean.Widget.instToStringExprDiff
- Lean.Widget.instToStringExprDiffTag
- Lean.Xml.instToStringAttributes
- Lean.Xml.instToStringContent
- Lean.Xml.instToStringElement
- Lean.instModuleIdxToString
- Lean.instToStringAttributeKind
- Lean.instToStringDataValue
- Lean.instToStringImport
- Lean.instToStringLOption
- Lean.instToStringNamePart
- Lean.instToStringOptions
- Plausible.TestResult.instToString
- Qq.instToStringQuoted
- Std.CloseableChannel.instToStringError
- Std.Internal.instToStringRat
- Std.Net.IPAddr.instToString
- Std.Net.IPv4Addr.instToString
- Std.Net.IPv6Addr.instToString
- Std.Tactic.BVDecide.BVBinOp.instToString
- Std.Tactic.BVDecide.BVBinPred.instToString
- Std.Tactic.BVDecide.BVExpr.instToString
- Std.Tactic.BVDecide.BVPred.instToString
- Std.Tactic.BVDecide.BVUnOp.instToString
- Std.Tactic.BVDecide.BoolExpr.instToString
- Std.Tactic.BVDecide.LRAT.Internal.Assignment.instToString
- Std.Tactic.BVDecide.LRAT.Internal.instToStringDefaultClause
- Std.Tactic.BVDecide.LRAT.Internal.instToStringPosFin
- Std.Tactic.BVDecide.LRAT.Internal.instToStringResult
- Std.Tactic.BVDecide.LRAT.instToStringAction
- Std.Tactic.BVDecide.instToStringBVBit
- Std.Time.DateTime.instToString
- Std.Time.Day.Ordinal.instToStringOfYear
- Std.Time.Day.instOffsetToString
- Std.Time.Hour.instOffsetToString
- Std.Time.Internal.UnitVal.instToString
- Std.Time.Millisecond.instOffsetToString
- Std.Time.Minute.instOffsetToString
- Std.Time.Month.instOffsetToString
- Std.Time.Nanosecond.instOffsetToString
- Std.Time.PlainDate.instToString
- Std.Time.PlainDateTime.instToString
- Std.Time.PlainTime.instToString
- Std.Time.Second.instOffsetToString
- Std.Time.Second.instToStringOrdinal
- Std.Time.Week.instOffsetToString
- Std.Time.Year.instOffsetToString
- Std.Time.Year.instToStringEra
- Std.Time.ZonedDateTime.instToString
- Std.Time.instToStringDuration
- Std.Time.instToStringTimestamp
- System.instToStringFilePath
- instToStringBool
- instToStringByteArray
- instToStringChar
- instToStringDecidable
- instToStringExcept
- instToStringFin
- instToStringFloat
- instToStringFloat32
- instToStringFloatArray
- instToStringFormat
- instToStringISize
- instToStringId
- instToStringId_1
- instToStringInt
- instToStringInt16
- instToStringInt32
- instToStringInt64
- instToStringInt8
- instToStringIterator
- instToStringList
- instToStringNat
- instToStringOption
- instToStringPUnit
- instToStringPos
- instToStringProd
- instToStringRat
- instToStringSigma
- instToStringString
- instToStringSubarray
- instToStringSubstring
- instToStringSubtype
- instToStringSum
- instToStringUInt16
- instToStringUInt32
- instToStringUInt64
- instToStringUInt8
- instToStringULift
- instToStringUSize
- instToStringUnit
Equations
Equations
Equations
- instToStringString = { toString := fun (s : String) => s }
Equations
- instToStringIterator = { toString := fun (it : String.Iterator) => it.remainingToString }
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:
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
- instToStringFormat = { toString := fun (f : Std.Format) => f.pretty }
Equations
- addParenHeuristic s = if ("(".isPrefixOf s || "[".isPrefixOf s || "{".isPrefixOf s || "#[".isPrefixOf s) = true then s else if (!s.any Char.isWhitespace) = true then s else "(" ++ s ++ ")"
Interprets a string as the decimal representation of an integer, returning it. Returns none if
the string does not contain a decimal integer.
A string can be interpreted as a decimal integer if it only consists of at least one decimal digit
and optionally - in front. Leading + characters are not allowed.
Use String.isInt to check whether String.toInt? would return some. String.toInt! is an
alternative that panics instead of returning none when the string is not an integer.
Examples:
Checks whether the string can be interpreted as the decimal representation of an integer.
A string can be interpreted as a decimal integer if it only consists of at least one decimal digit
and optionally - in front. Leading + characters are not allowed.
Use String.toInt? or String.toInt! to convert such a string to an integer.
Examples:
Interprets a string as the decimal representation of an integer, returning it. Panics if the string does not contain a decimal integer.
A string can be interpreted as a decimal integer if it only consists of at least one decimal digit
and optionally - in front. Leading + characters are not allowed.
Use String.isInt to check whether String.toInt! would return a value. String.toInt? is a safer
alternative that returns none instead of panicking when the string is not an integer.
Examples: