A typeclass that specifies the standard way of turning values of some type into Format.
When rendered this Format should be as close as possible to something that can be parsed as the
input value.
- reprPrec : α → Nat → Std.Format
Turn a value of type
αintoFormatat a given precedence. The precedence value can be used to avoid parentheses if they are not necessary.
Instances
- Aesop.instReprGoalWithMVars
- Aesop.instReprOptions
- Aesop.instReprStrategy
- Array.instRepr
- Batteries.BinomialHeap.Imp.instReprHeap
- Batteries.BinomialHeap.Imp.instReprHeapNode
- Batteries.PairingHeapImp.instReprHeap
- Batteries.RBMap.instRepr
- Batteries.RBSet.instRepr
- Batteries.Tactic.Lint.instReprLintVerbosity
- Batteries.instReprRBColor
- Batteries.instReprRBNode
- BitVec.instRepr
- BitVec.instReprLiteral
- EStateM.instReprResult
- Fin.instReprValue
- IO.FS.instReprDirEntry
- IO.FS.instReprFileType
- IO.FS.instReprMetadata
- IO.FS.instReprSystemTime
- IO.instReprTaskState
- Int.Linear.instReprExpr_lean
- Int.Linear.instReprPoly_lean
- Lake.DRBMap.instReprOfSigma
- Lake.MTime.instRepr
- Lake.instReprBackend
- Lake.instReprBinderSyntaxView
- Lake.instReprBuildKey
- Lake.instReprBuildTrace
- Lake.instReprBuildType
- Lake.instReprCliError
- Lake.instReprDate
- Lake.instReprDependencySrc
- Lake.instReprDynlib
- Lake.instReprElanInstall
- Lake.instReprGlob
- Lake.instReprHash
- Lake.instReprJobAction
- Lake.instReprLakeInstall
- Lake.instReprLeanConfig
- Lake.instReprLeanInstall
- Lake.instReprLeanOption
- Lake.instReprLogLevel
- Lake.instReprModuleDeps
- Lake.instReprModuleFacet
- Lake.instReprPartialBuildKey
- Lake.instReprSemVerCore
- Lake.instReprStdVer
- Lake.instReprTarget
- Lake.instReprToolchainVer
- Lake.instReprVerbosity
- Lake.instReprWorkspaceConfig
- Lean.Compiler.LCNF.FloatLetIn.instReprDecision
- Lean.Compiler.LCNF.Simp.instReprFunDeclInfo
- Lean.Compiler.LCNF.UnreachableBranches.instReprValue
- Lean.Compiler.LCNF.instReprSpecParamInfo
- Lean.Compiler.LCNF.instReprTrivialStructureInfo
- Lean.Data.AC.instReprExpr
- Lean.Diff.instReprAction
- Lean.Elab.Command.Structure.instReprStructFieldDefault
- Lean.Elab.Command.Structure.instReprStructFieldKind
- Lean.Elab.Structural.instReprIndGroupInfo
- Lean.Elab.Structural.instReprIndGroupInst
- Lean.Elab.Structural.instReprRecArgInfo
- Lean.Elab.Tactic.BVDecide.Frontend.Normalize.instReprOp
- Lean.Elab.Tactic.RCases.instReprRCasesPatt
- Lean.Elab.Tactic.Simpa.instReprUseImplicitLambdaResult
- Lean.Elab.Term.Quotation.instReprMatchResult
- Lean.Elab.Term.instReprElabElimInfo
- Lean.Elab.Term.instReprPostponeBehavior
- Lean.Elab.WF.GuessLex.instReprGuessLexRel
- Lean.Elab.instReprFixedParamPerms
- Lean.Grind.CommRing.instReprMon
- Lean.Grind.CommRing.instReprPower
- Lean.IR.UnreachableBranches.instReprValue
- Lean.IR.instReprCtorInfo
- Lean.IR.instReprIRType
- Lean.IR.instReprJoinPointId
- Lean.IR.instReprParam
- Lean.IR.instReprVarId
- Lean.JsonNumber.instRepr
- Lean.Lsp.instReprCompletionItemKind
- Lean.Lsp.instReprCompletionItemTag
- Lean.Lsp.instReprLineRange
- Lean.Lsp.instReprPosition
- Lean.Lsp.instReprRange
- Lean.Meta.DiscrTree.instReprKey
- Lean.Meta.Ext.instReprExtTheorem
- Lean.Meta.Grind.Arith.CommRing.instReprMon_lean
- Lean.Meta.Grind.Arith.CommRing.instReprPoly_lean
- Lean.Meta.Grind.Arith.CommRing.instReprPower_lean
- Lean.Meta.Grind.Canon.instReprShouldCanonResult
- Lean.Meta.Grind.instReprEMatchTheoremKind
- Lean.Meta.Grind.instReprENode
- Lean.Meta.Grind.instReprOrigin
- Lean.Meta.Grind.instReprSplitStatus
- Lean.Meta.LazyDiscrTree.instReprKey
- Lean.Meta.Match.instReprMatchEqns
- Lean.Meta.NormCast.instReprLabel
- Lean.Meta.Simp.Arith.Nat.instReprExprCnstr_lean
- Lean.Meta.Simp.Arith.Nat.instReprExpr_lean
- Lean.Meta.Simp.Arith.Nat.instReprPolyCnstr_lean
- Lean.Meta.Simp.instReprSimpLetCase
- Lean.Meta.instReprCoeFnInfo
- Lean.Meta.instReprCoeFnType
- Lean.Meta.instReprConfig
- Lean.Meta.instReprConfig_1
- Lean.Meta.instReprConfig_2
- Lean.Meta.instReprCongrArgKind
- Lean.Meta.instReprCustomEliminator
- Lean.Meta.instReprCustomEliminators
- Lean.Meta.instReprElimAltInfo
- Lean.Meta.instReprElimInfo
- Lean.Meta.instReprEtaStructMode
- Lean.Meta.instReprFunIndInfo
- Lean.Meta.instReprFunIndParamKind
- Lean.Meta.instReprOrigin
- Lean.Meta.instReprProjReductionKind
- Lean.Meta.instReprSimpCongrTheorem
- Lean.Meta.instReprSimpCongrTheorems
- Lean.Meta.instReprTransparencyMode
- Lean.Name.instRepr
- Lean.Omega.instReprConstraint
- Lean.Omega.instReprLinearCombo
- Lean.Parser.instReprLeadingIdentBehavior
- Lean.Parser.instReprRecoveryContext
- Lean.RBMap.instRepr
- Lean.RBTree.instRepr
- Lean.Server.Test.Runner.Client.instReprHyp
- Lean.Server.Test.Runner.Client.instReprInteractiveGoal
- Lean.Server.Test.Runner.Client.instReprInteractiveGoals
- Lean.Server.Test.Runner.Client.instReprSubexprInfo
- Lean.SubExpr.Pos.instRepr
- Lean.Syntax.instRepr
- Lean.Syntax.instReprPreresolved
- Lean.Syntax.instReprTSyntax
- Lean.Widget.instReprTaggedText
- Lean.instReprBinderInfo
- Lean.instReprConstantKind
- Lean.instReprData
- Lean.instReprDataValue
- Lean.instReprData_1
- Lean.instReprDeclarationLocation
- Lean.instReprDeclarationRange
- Lean.instReprDeclarationRanges
- Lean.instReprDefinitionSafety
- Lean.instReprExpr
- Lean.instReprFVarId
- Lean.instReprHeadIndex
- Lean.instReprImport
- Lean.instReprKVMap
- Lean.instReprLMVarId
- Lean.instReprLeanOptionValue
- Lean.instReprLeanOptions
- Lean.instReprLevel
- Lean.instReprLevelMVarId
- Lean.instReprLiteral
- Lean.instReprLocalDeclKind
- Lean.instReprMVarId
- Lean.instReprMVarId_1
- Lean.instReprMetavarKind
- Lean.instReprPosition
- Lean.instReprProjectionFunctionInfo
- Lean.instReprReducibilityStatus
- Lean.instReprSMap
- Lean.instReprStructureFieldInfo
- Lean.instReprTransformStep
- LeanSearchClient.instReprLoogleMatch
- LeanSearchClient.instReprLoogleResult
- LeanSearchClient.instReprSearchResult
- Plausible.NoShrink.repr
- Plausible.TotalFunction.instRepr
- Qq.instReprMaybeDefEq
- Qq.instReprMaybeLevelDefEq
- Qq.instReprQuoted
- Std.CloseableChannel.instReprError
- Std.DHashMap.Raw.instRepr
- Std.DHashMap.instRepr
- Std.DTreeMap.Raw.instRepr
- Std.DTreeMap.instRepr
- Std.HashMap.Raw.instRepr
- Std.HashMap.instRepr
- Std.HashSet.Raw.instRepr
- Std.HashSet.instRepr
- Std.Internal.Parsec.instReprParseResult
- Std.Internal.instReprRat
- Std.Sat.AIG.instReprDecl
- Std.Sat.AIG.instReprFanin
- Std.Tactic.BVDecide.LRAT.instReprAction
- Std.Tactic.BVDecide.instReprBVBit
- Std.Time.DateTime.instRepr
- Std.Time.Day.Ordinal.instReprOfYear
- Std.Time.Day.instOffsetRepr
- Std.Time.Day.instOrdinalRepr
- Std.Time.Hour.instOffsetRepr
- Std.Time.Hour.instOrdinalRepr
- Std.Time.Internal.Bounded.instRepr
- Std.Time.Internal.UnitVal.instRepr
- Std.Time.Millisecond.instOffsetRepr
- Std.Time.Millisecond.instOrdinalRepr
- Std.Time.Minute.instOffsetRepr
- Std.Time.Minute.instOrdinalRepr
- Std.Time.Month.instOffsetRepr
- Std.Time.Month.instOrdinalRepr
- Std.Time.Month.instQuarterRepr
- Std.Time.Nanosecond.Ordinal.instOfDayRepr
- Std.Time.Nanosecond.instOffsetRepr
- Std.Time.Nanosecond.instOrdinalRepr
- Std.Time.Nanosecond.instSpanRepr
- Std.Time.PlainDate.instRepr
- Std.Time.PlainDateTime.instRepr
- Std.Time.PlainTime.instRepr
- Std.Time.Second.instOffsetRepr
- Std.Time.Second.instReprOrdinal
- Std.Time.TimeZone.TZif.instReprHeader
- Std.Time.TimeZone.TZif.instReprLeapSecond
- Std.Time.TimeZone.TZif.instReprLocalTimeType
- Std.Time.TimeZone.TZif.instReprTZif
- Std.Time.TimeZone.TZif.instReprTZifV1
- Std.Time.TimeZone.TZif.instReprTZifV2
- Std.Time.TimeZone.instReprLocalTimeType
- Std.Time.TimeZone.instReprOffset
- Std.Time.TimeZone.instReprStdWall
- Std.Time.TimeZone.instReprTransition
- Std.Time.TimeZone.instReprUTLocal
- Std.Time.TimeZone.instReprZoneRules
- Std.Time.Week.Ordinal.instOfMonthRepr
- Std.Time.Week.instOffsetRepr
- Std.Time.Week.instOrdinalRepr
- Std.Time.Weekday.instOrdinalRepr
- Std.Time.Year.instOffsetRepr
- Std.Time.Year.instReprEra
- Std.Time.ZonedDateTime.instRepr
- Std.Time.instReprDuration
- Std.Time.instReprDuration_1
- Std.Time.instReprFormatConfig
- Std.Time.instReprFormatPart
- Std.Time.instReprFraction
- Std.Time.instReprGenericFormat
- Std.Time.instReprHourMarker
- Std.Time.instReprModifier
- Std.Time.instReprNumber
- Std.Time.instReprOffsetO
- Std.Time.instReprOffsetX
- Std.Time.instReprOffsetZ
- Std.Time.instReprPlainDate
- Std.Time.instReprPlainDateTime
- Std.Time.instReprPlainTime
- Std.Time.instReprText
- Std.Time.instReprTimeZone
- Std.Time.instReprTimestamp
- Std.Time.instReprTimestamp_1
- Std.Time.instReprWeekday
- Std.Time.instReprYear
- Std.Time.instReprZoneId
- Std.Time.instReprZoneName
- Std.TreeMap.Raw.instRepr
- Std.TreeMap.instRepr
- Std.TreeSet.Raw.instRepr
- Std.TreeSet.instRepr
- String.instReprRange
- System.instReprFilePath
- instReprBool
- instReprChar
- instReprDecidable
- instReprEmpty
- instReprExcept
- instReprFin
- instReprFloat
- instReprFloat32
- instReprISize
- instReprId
- instReprId_1
- instReprInt
- instReprInt16
- instReprInt32
- instReprInt64
- instReprInt8
- instReprIterator
- instReprList
- instReprListOfReprAtom
- instReprNat
- instReprOption
- instReprPUnit
- instReprPos
- instReprProdOfReprTuple
- instReprRat
- instReprSSet
- instReprSigma
- instReprSourceInfo
- instReprStdGen
- instReprString
- instReprSubarray
- instReprSubstring
- instReprSubtype
- instReprSum
- instReprUInt16
- instReprUInt32
- instReprUInt64
- instReprUInt8
- instReprULift
- instReprUSize
- instReprUnit
- instReprVector
Equations
Equations
Equations
- true.repr x✝ = Std.Format.text "true"
- false.repr x✝ = Std.Format.text "false"
Equations
- (isTrue h).repr x✝ = Repr.addAppParen (Std.Format.text "isTrue _") x✝
- (isFalse h).repr x✝ = Repr.addAppParen (Std.Format.text "isFalse _") x✝
Equations
- instReprDecidable = { reprPrec := Decidable.repr }
Equations
- instReprPUnit = { reprPrec := fun (x : PUnit) (x : Nat) => Std.Format.text "PUnit.unit" }
Equations
- instReprULift = { reprPrec := fun (v : ULift α) (prec : Nat) => Repr.addAppParen (Std.Format.text "ULift.up " ++ reprArg v.down) prec }
Equations
- instReprUnit = { reprPrec := fun (x : Unit) (x : Nat) => Std.Format.text "()" }
Returns a representation of an optional value that should be able to be parsed as an equivalent optional value.
This function is typically accessed through the Repr (Option α) instance.
Equations
- none.repr x✝ = Std.Format.text "none"
- (some a).repr x✝ = Repr.addAppParen (Std.Format.text "some " ++ reprArg a) x✝
Equations
- instReprOption = { reprPrec := Option.repr }
Equations
- (Sum.inl a).repr x✝ = Repr.addAppParen (Std.Format.text "Sum.inl " ++ reprArg a) x✝
- (Sum.inr b).repr x✝ = Repr.addAppParen (Std.Format.text "Sum.inr " ++ reprArg b) x✝
- reprTuple : α → List Std.Format → List Std.Format
Equations
- instReprTupleOfRepr = { reprTuple := fun (a : α) (xs : List Std.Format) => repr a :: xs }
Equations
- instReprTupleProdOfRepr = { reprTuple := Prod.reprTuple }
Equations
- (a, b).repr x✝ = Std.Format.bracket "(" (Std.Format.joinSep (reprTuple b [repr a]).reverse (Std.Format.text "," ++ Std.Format.line)) ")"
Equations
- ⟨a, b⟩.repr x✝ = Std.Format.bracket "⟨" (repr a ++ Std.Format.text ", " ++ repr b) "⟩"
Equations
- instReprSigma = { reprPrec := Sigma.repr }
Returns a single digit representation of n, which is assumed to be in a base less than or equal to
16. Returns '*' if n > 15.
Examples:
Nat.digitChar 5 = '5'Nat.digitChar 12 = 'c'Nat.digitChar 15 = 'f'Nat.digitChar 16 = '*'Nat.digitChar 85 = '*'
Equations
- One or more equations did not get rendered due to their size.
Returns the decimal representation of a natural number as a list of digit characters in the given
base. If the base is greater than 16 then '*' is returned for digits greater than 0xf.
Examples:
Nat.toDigits 10 0xff = ['2', '5', '5']Nat.toDigits 8 0xc = ['1', '4']Nat.toDigits 16 0xcafe = ['c', 'a', 'f', 'e']Nat.toDigits 80 200 = ['2', '*']
Converts a word-sized unsigned integer into a decimal string.
This function is overridden at runtime with an efficient implementation.
Examples:
USize.repr 0 = "0"USize.repr 28 = "28"USize.repr 307 = "307"
Equations
- n.repr = (Nat.toDigits 10 n.toNat).asString
Converts a natural number less than 10 to the corresponding Unicode superscript digit character.
Returns '*' for other numbers.
Examples:
Nat.superDigitChar 3 = '³'Nat.superDigitChar 7 = '⁷'Nat.superDigitChar 10 = '*'
Equations
- One or more equations did not get rendered due to their size.
Converts a natural number to the list of Unicode superscript digit characters that corresponds to its decimal representation.
Examples:
Nat.toSuperDigits 0 = ['⁰']Nat.toSuperDigits 35 = ['³', '⁵']
Equations
Converts a natural number to a string that contains the its decimal representation as Unicode superscript digit characters.
Examples:
Nat.toSuperscriptString 0 = "⁰"Nat.toSuperscriptString 35 = "³⁵"
Equations
Converts a natural number less than 10 to the corresponding Unicode subscript digit character.
Returns '*' for other numbers.
Examples:
Nat.subDigitChar 3 = '₃'Nat.subDigitChar 7 = '₇'Nat.subDigitChar 10 = '*'
Equations
- One or more equations did not get rendered due to their size.
Converts a natural number to the list of Unicode subscript digit characters that corresponds to its decimal representation.
Examples:
Nat.toSubDigits 0 = ['₀']Nat.toSubDigits 35 = ['₃', '₅']
Equations
- n.toSubDigits = n.toSubDigitsAux []
Converts a natural number to a string that contains the its decimal representation as Unicode subscript digit characters.
Examples:
Nat.toSubscriptString 0 = "₀"Nat.toSubscriptString 35 = "₃₅"
Equations
Equations
- instReprNat = { reprPrec := fun (n x : Nat) => Std.Format.text n.repr }
Equations
- instReprInt = { reprPrec := fun (i : Int) (prec : Nat) => if i < 0 then Repr.addAppParen (Std.Format.text i.repr) prec else Std.Format.text i.repr }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Char.quoteCore.smallCharToHex c = hexDigitRepr (c.toNat / 16) ++ hexDigitRepr (c.toNat % 16)
Equations
- instReprChar = { reprPrec := fun (c : Char) (x : Nat) => Std.Format.text c.quote }
Converts a string to its corresponding Lean string literal syntax. Double quotes are added to each end, and internal characters are escaped as needed.
Examples:
Equations
- instReprString = { reprPrec := fun (s : String) (x : Nat) => Std.Format.text s.quote }
Equations
- instReprPos = { reprPrec := fun (p : String.Pos) (x : Nat) => Std.Format.text "{ byteIdx := " ++ repr p.byteIdx ++ Std.Format.text " }" }
Equations
- instReprSubstring = { reprPrec := fun (s : Substring) (x : Nat) => Std.Format.text (s.toString.quote ++ ".toSubstring") }
Equations
- One or more equations did not get rendered due to their size.
Equations
- [].repr n = Std.Format.text "[]"
- a.repr n = Std.Format.bracket "[" (Std.Format.joinSep a (Std.Format.text "," ++ Std.Format.line)) "]"
Equations
- [].repr' n = Std.Format.text "[]"
- a.repr' n = Std.Format.bracketFill "[" (Std.Format.joinSep a (Std.Format.text "," ++ Std.Format.line)) "]"
Equations
- instReprListOfReprAtom = { reprPrec := List.repr' }
Equations
- instReprSourceInfo = { reprPrec := reprSourceInfo✝ }