- allOrNone: Std.Format.FlattenBehavior
- fill: Std.Format.FlattenBehavior
Equations
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
Equations
- Std.Format.appendEx a b = Std.Format.append a b
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 x = match x 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
- Std.Format.instMonadPrettyFormatStateMState = { pushOutput := fun s => modify fun x => match x with | { out := out, column := col } => { out := out ++ s, column := col + String.length s }, pushNewline := fun indent => modify fun x => match x with | { out := out, column := col } => { out := out ++ String.pushn "\n" (Char.ofNat 32) indent, column := indent }, currColumn := do let a ← get pure a.column, startTag := fun n => pure (), endTags := fun n => pure () }
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.Elab.Term.StructInst.instToFormatFieldStruct
- Lean.Position.instToFormatPosition
- Lean.Json.instToFormatJson
- Lean.IR.instToFormatExpr
- Lean.Meta.instToFormatUnificationHints
- 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.Meta.instToFormatSimpLemma
- instToFormatArray
- Lean.Meta.DiscrTree.instToFormatTrie
- Lean.IR.instToFormatDecl
- Lean.IR.instToFormatCtorInfo
- instToFormatProd
- Lean.instToFormatProdNameDataValue
- Lean.IR.CtorFieldInfo.instToFormatCtorFieldInfo
- Lean.Elab.Term.StructInst.instToFormatStruct
- 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 [] x = Lean.Format.nil
- Lean.Format.joinSep [a] x = Lean.format a
- Lean.Format.joinSep (a :: as) x = Lean.format a ++ x ++ Lean.Format.joinSep as x
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
def
Std.Format.joinSuffix
{α : Type u}
[inst : Lean.ToFormat α]
:
List α → Lean.Format → Lean.Format
Equations
- Std.Format.joinSuffix [] x = Lean.Format.nil
- Std.Format.joinSuffix (a :: as) x = Lean.format a ++ x ++ Std.Format.joinSuffix as x