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
- Aesop.instReprGoalWithMVars
- Aesop.instReprOptions
- Aesop.instReprStrategy
- Array.instRepr
- Batteries.BinomialHeap.Imp.instReprHeap
- Batteries.BinomialHeap.Imp.instReprHeapNode
- 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
- 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.instReprSemVerCore
- Lake.instReprStdVer
- 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.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.instReprElabElimInfo
- 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.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.instReprProjectionFunctionInfo
- Lean.instReprRat
- Lean.instReprReducibilityStatus
- Lean.instReprSMap
- Lean.instReprStructureFieldInfo
- Lean.instReprTransformStep
- LeanSearchClient.instReprLoogleMatch
- LeanSearchClient.instReprLoogleResult
- LeanSearchClient.instReprSearchResult
- Qq.instReprMaybeDefEq
- Qq.instReprQuoted
- Std.DHashMap.Raw.instRepr
- Std.DHashMap.instRepr
- Std.HashMap.Raw.instRepr
- Std.HashMap.instRepr
- Std.HashSet.Raw.instRepr
- Std.HashSet.instRepr
- Std.Internal.Parsec.instReprParseResult
- Std.Sat.AIG.instReprDecl
- Std.Tactic.BVDecide.LRAT.instReprAction
- Std.Tactic.BVDecide.instReprBVBit
- String.instReprRange
- System.instReprFilePath
- instReprBool
- instReprChar
- instReprDecidable
- instReprEmpty
- instReprExcept
- instReprFin
- instReprFloat
- instReprId
- instReprId_1
- instReprInt
- 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
Equations
- instReprId = inferInstanceAs (Repr α)
Equations
- instReprId_1 = inferInstanceAs (Repr α)
Equations
- instReprEmpty = { reprPrec := fun (a : Empty) (a_1 : Nat) => nomatch a, a_1 }
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
- none.repr x = Std.Format.text "none"
- (some a).repr x = Repr.addAppParen (Std.Format.text "some " ++ reprArg a) x
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 Lean.Format → List Lean.Format
Equations
- instReprTupleOfRepr = { reprTuple := fun (a : α) (xs : List Lean.Format) => repr a :: xs }
Equations
- (a, b).repr 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) (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 }
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
- [].repr n = Std.Format.text "[]"
- a.repr n = Lean.Format.bracket "[" (Lean.Format.joinSep a (Std.Format.text "," ++ Lean.Format.line)) "]"
Equations
- [].repr' n = Std.Format.text "[]"
- a.repr' n = Std.Format.bracketFill "[" (Lean.Format.joinSep a (Std.Format.text "," ++ Lean.Format.line)) "]"
Equations
- instReprSourceInfo = { reprPrec := reprSourceInfo✝ }