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 → Lean.Format
Turn a value of type
α
intoFormat
at a given precedence. The precedence value can be used to avoid parentheses if they are not necessary.
Instances
- AddUnits.instRepr
- 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.instReprRBColor
- Batteries.instReprRBNode
- BitVec.instRepr
- BitVec.instReprLiteral
- EStateM.instReprResult
- Fin.instReprValue
- Finset.instRepr
- IO.FS.instReprDirEntry
- IO.FS.instReprFileType
- IO.FS.instReprMetadata
- IO.FS.instReprSystemTime
- IO.instReprTaskState
- LO.FirstOrder.Arith.instReprSemiformulaORing_arithmetization
- LO.FirstOrder.Arith.instReprSemitermORing_arithmetization
- LO.FirstOrder.Derivation.instReprDerivationSyntacticFormulaTheory
- LO.FirstOrder.Semiformula.instRepr
- LO.FirstOrder.Semiterm.instRepr
- LO.IntProp.Formula.instRepr
- LO.Modal.Formula.instRepr
- LO.Propositional.Classical.Formula.instRepr
- Lake.DRBMap.instReprOfSigma
- Lake.MTime.instRepr
- Lake.instReprBackend
- Lake.instReprBuildKey
- Lake.instReprBuildTrace
- Lake.instReprBuildType
- Lake.instReprCliError
- Lake.instReprDependencySrc
- Lake.instReprElanInstall
- Lake.instReprGlob
- Lake.instReprHash
- Lake.instReprJobAction
- Lake.instReprLakeInstall
- Lake.instReprLeanConfig
- Lake.instReprLeanInstall
- Lake.instReprLeanOption
- Lake.instReprLogLevel
- Lake.instReprModuleFacet
- Lake.instReprVerbosity
- Lake.instReprWorkspaceConfig
- LazyList.instRepr
- 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.instReprStructFieldInfo
- Lean.Elab.Command.instReprStructFieldKind
- Lean.Elab.Tactic.Ext.instReprExtTheorem
- Lean.Elab.Tactic.RCases.instReprRCasesPatt
- Lean.Elab.Tactic.Simpa.instReprUseImplicitLambdaResult
- Lean.Elab.Term.Quotation.instReprMatchResult
- Lean.Elab.Term.instReprPostponeBehavior
- Lean.Elab.WF.GuessLex.instReprGuessLexRel
- 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.instReprLineRange
- Lean.Meta.DiscrTree.instReprKey
- Lean.Meta.LazyDiscrTree.instReprKey
- Lean.Meta.Linear.Nat.instReprExprCnstr_lean
- Lean.Meta.Linear.Nat.instReprExpr_lean
- Lean.Meta.Linear.Nat.instReprPolyCnstr_lean
- Lean.Meta.Linear.instReprAssumptionId
- Lean.Meta.Linear.instReprCnstr
- Lean.Meta.Linear.instReprCnstrKind
- Lean.Meta.Linear.instReprJustification
- Lean.Meta.Linear.instReprPoly
- Lean.Meta.Linear.instReprVar
- Lean.Meta.Match.instReprMatchEqns
- Lean.Meta.NormCast.instReprLabel
- Lean.Meta.instReprCoeFnInfo
- Lean.Meta.instReprCoeFnType
- Lean.Meta.instReprConfig
- Lean.Meta.instReprConfig_1
- Lean.Meta.instReprCongrArgKind
- Lean.Meta.instReprCustomEliminator
- Lean.Meta.instReprCustomEliminators
- Lean.Meta.instReprElimAltInfo
- Lean.Meta.instReprElimInfo
- Lean.Meta.instReprEtaStructMode
- 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.Parsec.instReprParseResult
- Lean.Parser.instReprLeadingIdentBehavior
- Lean.Parser.instReprRecoveryContext
- Lean.RBMap.instRepr
- Lean.RBTree.instRepr
- Lean.SubExpr.Pos.instRepr
- Lean.Syntax.instRepr
- Lean.Syntax.instReprPreresolved
- Lean.Syntax.instReprTSyntax
- Lean.Widget.instReprTaggedText
- Lean.instReprBinderInfo
- Lean.instReprData
- Lean.instReprDataValue
- Lean.instReprData_1
- 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.instReprRat
- Lean.instReprReducibilityStatus
- Lean.instReprSMap
- Lean.instReprStructureFieldInfo
- Lean.instReprTransformStep
- Linarith.instReprComp
- Linarith.instReprIneq
- Mathlib.Meta.Positivity.instReprStrictness
- Mathlib.Tactic.GCongr.instReprGCongrLemma
- Mathlib.Tactic.RingNF.instReprConfig
- Mathlib.Tactic.RingNF.instReprRingMode
- Multiset.instRepr
- Nat.Primes.instRepr
- PiFin.hasRepr
- Qq.instReprMaybeDefEq
- Qq.instReprQuoted
- Std.Tactic.Lint.instReprLintVerbosity
- String.instReprRange
- System.instReprFilePath
- ToAdditive.instReprConfig
- Units.instRepr
- WithBot.instRepr
- WithOne.instRepr
- WithOne.instReprWithZero
- WithTop.instRepr
- WithZero.instRepr
- instReprBool
- instReprChar
- instReprDecidable
- instReprExcept
- instReprFin
- instReprFloat
- instReprId
- instReprId_1
- instReprInt
- instReprIterator
- instReprList
- instReprListOfReprAtom
- instReprNat
- instReprOption
- instReprOrdering_mathlib
- instReprPNat
- instReprPUnit
- instReprPos
- instReprProdOfReprTuple
- instReprRat
- instReprSSet
- instReprSigma
- instReprSourceInfo
- instReprStdGen
- instReprString
- instReprSubarray
- instReprSubstring
- instReprSubtype
- instReprSum
- instReprTree
- instReprUInt16
- instReprUInt32
- instReprUInt64
- instReprUInt8
- instReprULift
- instReprUSize
- instReprUnit
Equations
- instReprId = inferInstanceAs (Repr α)
Equations
- instReprId_1 = inferInstanceAs (Repr α)
Equations
- instReprBool = { reprPrec := fun (x : Bool) (x_1 : Nat) => match x, x_1 with | true, x => Std.Format.text "true" | false, x => Std.Format.text "false" }
Equations
- Repr.addAppParen f prec = if prec ≥ 1024 then f.paren else f
Equations
- One or more equations did not get rendered due to their size.
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 "()" }
Equations
- x✝.repr x = match x✝, x with | none, x => Std.Format.text "none" | some a, prec => Repr.addAppParen (Std.Format.text "some " ++ reprArg a) prec
- reprTuple : α → List Lean.Format → List Lean.Format
Equations
- instReprTupleOfRepr = { reprTuple := fun (a : α) (xs : List Lean.Format) => repr a :: xs }
Equations
- x✝.repr x = match x✝, x with | (a, b), x => Lean.Format.bracket "(" (Lean.Format.joinSep (reprTuple b [repr a]).reverse (Std.Format.text "," ++ Lean.Format.line)) ")"
Equations
- One or more equations did not get rendered due to their size.
@[extern lean_string_of_usize]
Equations
- n.repr = (Nat.toDigits 10 n.toNat).asString
Equations
- One or more equations did not get rendered due to their size.
Equations
- n.toSuperscriptString = n.toSuperDigits.asString
Equations
- One or more equations did not get rendered due to their size.
Equations
- n.toSubscriptString = n.toSubDigits.asString
Equations
- instReprNat = { reprPrec := fun (n x : Nat) => Std.Format.text n.repr }
Equations
- instReprInt = { reprPrec := fun (i : Int) (x : Nat) => Std.Format.text i.repr }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Char.quoteCore.smallCharToHex c = let n := c.toNat; let d2 := n / 16; let d1 := n % 16; hexDigitRepr d2 ++ hexDigitRepr d1
Equations
- instReprChar = { reprPrec := fun (c : Char) (x : Nat) => Std.Format.text c.quote }
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
- instReprFin n = { reprPrec := fun (f : Fin n) (x : Nat) => repr ↑f }
Equations
- instReprUInt8 = { reprPrec := fun (n : UInt8) (x : Nat) => repr n.toNat }
Equations
- instReprUInt16 = { reprPrec := fun (n : UInt16) (x : Nat) => repr n.toNat }
Equations
- instReprUInt32 = { reprPrec := fun (n : UInt32) (x : Nat) => repr n.toNat }
Equations
- instReprUInt64 = { reprPrec := fun (n : UInt64) (x : Nat) => repr n.toNat }
Equations
- instReprUSize = { reprPrec := fun (n : USize) (x : Nat) => repr n.toNat }
Equations
- One or more equations did not get rendered due to their size.
Equations
- instReprSourceInfo = { reprPrec := reprSourceInfo✝ }