- allOrNone: Std.Format.FlattenBehavior
- fill: Std.Format.FlattenBehavior
Equations
- Std.Format.instBEqFlattenBehavior = { beq := [anonymous] }
- nil: Lean.Format
- line: Lean.Format
- text: String → Lean.Format
- nest: Int → Lean.Format → Lean.Format
- append: Lean.Format → Lean.Format → Lean.Format
- group: Lean.Format → optParam Std.Format.FlattenBehavior Std.Format.FlattenBehavior.allOrNone → Lean.Format
- tag: Nat → Lean.Format → Lean.Format
Equations
- Std.instInhabitedFormat = { default := Lean.Format.nil }
Equations
- Std.Format.isEmpty Lean.Format.nil = true
- Std.Format.isEmpty Lean.Format.line = false
- Std.Format.isEmpty (Std.Format.text msg) = (msg == "")
- Std.Format.isEmpty (Lean.Format.nest indent f) = Std.Format.isEmpty f
- Std.Format.isEmpty (Std.Format.append f₁ f₂) = (Std.Format.isEmpty f₁ && Std.Format.isEmpty f₂)
- Std.Format.isEmpty (Lean.Format.group f behavior) = Std.Format.isEmpty f
- Std.Format.isEmpty (Lean.Format.tag a f) = Std.Format.isEmpty f
@[export lean_format_append]
Equations
- Std.Format.appendEx a b = Std.Format.append a b
@[export lean_format_group]
Equations
Equations
- Std.Format.instAppendFormat = { append := Std.Format.append }
Equations
- Std.Format.instCoeStringFormat = { coe := Std.Format.text }
Equations
- Lean.Format.join xs = List.foldl (fun a a_1 => a ++ a_1) (Std.Format.text "") xs
Equations
- Std.Format.isNil _fun_discr = match _fun_discr with | Lean.Format.nil => true | x => false
Equations
- Std.Format.instInhabitedSpaceResult = { default := { foundLine := default, foundFlattenedHardLine := default, space := default } }
def
Std.Format.prettyM
{m : Type → Type}
(f : Lean.Format)
(w : Nat)
(indent : optParam Nat 0)
[inst : Monad m]
[inst : Std.Format.MonadPrettyFormat m]
:
m Unit
Equations
- Std.Format.prettyM f w indent = Std.Format.be w [{ flatten := false, flb := Std.Format.FlattenBehavior.allOrNone, items := [{ f := f, indent := Int.ofNat indent, activeTags := 0 }] }]
@[inline]
Equations
- Lean.Format.bracket l f r = Lean.Format.group (Lean.Format.nest (Int.ofNat (String.length l)) (Std.Format.text l ++ f ++ Std.Format.text r))
@[inline]
Equations
- Lean.Format.paren f = Lean.Format.bracket "(" f ")"
@[inline]
Equations
- Lean.Format.sbracket f = Lean.Format.bracket "[" f "]"
@[inline]
Equations
- Std.Format.bracketFill l f r = Lean.Format.fill (Lean.Format.nest (Int.ofNat (String.length l)) (Std.Format.text l ++ f ++ Std.Format.text r))
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
@[export lean_format_pretty]
Pretty-print a Format
object as a string with expected width w
.
Equations
- Lean.Format.pretty f w = let act := Std.Format.prettyM f w 0; (act { out := "", column := 0 }).snd.out
- format : α → Lean.Format
Instances
- instToFormat
- Lean.instToFormatDataValue
- Lean.IR.LogEntry.instToFormatLogEntry
- Lean.Meta.instToFormatSimpTheorem
- Lean.Elab.Term.StructInst.instToFormatFieldStruct
- Lean.Position.instToFormatPosition
- Lean.Json.instToFormatJson
- Lean.IR.instToFormatExpr
- Lean.Meta.instToFormatUnificationHints
- Lean.Syntax.instToFormatTSyntax
- Lean.Meta.DiscrTree.instToFormatKey
- Std.instToFormatFormat
- Lean.IR.Borrow.instToFormatParamMap
- Lean.IR.instToFormatLitVal
- Lean.IR.UnreachableBranches.instToFormatValue
- Lean.IR.UnreachableBranches.Value.instToFormatValue
- Lean.IR.instToFormatVarId
- Lean.Elab.instToFormatModifiers
- Lean.IR.instToFormatParam
- Lean.instToFormatKVMap
- instToFormatOption
- Lean.Meta.instToFormatInstanceEntry
- Lean.Syntax.instToFormatSyntax
- Lean.IR.instToFormatIRType
- Lean.Meta.DiscrTree.instToFormatDiscrTree
- instToFormatList
- Lean.Elab.instToFormatAttribute
- Lean.IR.instToFormatArg
- Lean.Elab.instToFormatCustomInfo
- instToFormatArray
- Lean.Meta.DiscrTree.instToFormatTrie
- Lean.IR.instToFormatDecl
- Lean.IR.instToFormatCtorInfo
- instToFormatProd
- Lean.instToFormatProdNameDataValue
- Lean.IR.CtorFieldInfo.instToFormatCtorFieldInfo
- Lean.Elab.Term.StructInst.instToFormatStruct
- instToFormatPos
- Lean.instToFormatName
- Std.instToFormatString
- Lean.Elab.Term.StructInst.instToFormatFieldLHS
- Lean.IR.instToFormatJoinPointId
- Lean.Level.instToFormatLevel
- Lean.IR.instToFormatFnBody
Equations
- Std.instToFormatFormat = { format := fun f => f }
Equations
- Std.instToFormatString = { format := fun s => Std.Format.text s }
Equations
- Lean.Format.joinSep [] _fun_discr = Lean.Format.nil
- Lean.Format.joinSep [a] _fun_discr = Lean.format a
- Lean.Format.joinSep (a :: as) _fun_discr = Lean.format a ++ _fun_discr ++ Lean.Format.joinSep as _fun_discr
def
Std.Format.prefixJoin
{α : Type u}
[inst : Lean.ToFormat α]
(pre : Lean.Format)
:
List α → Lean.Format
Equations
- Std.Format.prefixJoin pre [] = Lean.Format.nil
- Std.Format.prefixJoin pre (a :: as) = pre ++ Lean.format a ++ Std.Format.prefixJoin pre as
Equations
- Std.Format.joinSuffix [] _fun_discr = Lean.Format.nil
- Std.Format.joinSuffix (a :: as) _fun_discr = Lean.format a ++ _fun_discr ++ Std.Format.joinSuffix as _fun_discr