The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 sf
,
but with indentation already stringified.
- text {α : Type u} : String → TaggedText α
- append {α : Type u} : Array (TaggedText α) → TaggedText α
- tag {α : Type u} : α → TaggedText α → TaggedText α
Instances For
Equations
Equations
Equations
Equations
Equations
Instances For
def
Lean.Widget.TaggedText.appendTag
{α : Type u_1}
(acc : TaggedText α)
(t₀ : α)
(a₀ : TaggedText α)
:
Equations
Instances For
partial def
Lean.Widget.TaggedText.map
{α : Type u_1}
{β : Type u_2}
(f : α → β)
:
TaggedText α → TaggedText β
partial def
Lean.Widget.TaggedText.mapM
{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → m β)
:
TaggedText α → m (TaggedText β)
partial def
Lean.Widget.TaggedText.rewrite
{α : Type u_1}
{β : Type u_2}
(f : α → TaggedText α → TaggedText β)
:
TaggedText α → TaggedText β
partial def
Lean.Widget.TaggedText.rewriteM
{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → TaggedText α → m (TaggedText β))
:
TaggedText α → m (TaggedText β)
Like mapM
but allows rewriting the whole subtree at tag
nodes.
Equations
def
Lean.Widget.TaggedText.prettyTagged
(f : Format)
(indent : Nat := 0)
(w : Nat := Std.Format.defWidth)
:
TaggedText (Nat × Nat)
The output is tagged with (tag, indent)
where tag
is from the input Format
and indent
is the indentation level at this point. The latter is used to print sub-trees accurately by passing
it again as the indent
argument.
Equations
Instances For
Remove tags, leaving just the pretty-printed string.
Equations
Instances For
partial def
Lean.Widget.TaggedText.stripTags.go
{α : Type u_1}
(acc : String)
:
Array (TaggedText α) → String