File: .lake/packages/lean4/src/lean/Lean/Widget/TaggedText.lean

full_name: Lean.Widget.instReprTaggedText
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: {α : Type u_1} → [inst : Repr α] → Repr (Lean.Widget.TaggedText α)

full_name: Lean.Widget.TaggedText.append
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: Array (Lean.Widget.TaggedText α) → Lean.Widget.TaggedText α

full_name: Lean.Widget.instInhabitedTaggedText
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: {a : Type u_1} → Inhabited (Lean.Widget.TaggedText a)

full_name: Lean.Widget.TaggedText
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: Type u

full_name: Lean.Widget.TaggedText.tag
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: α → Lean.Widget.TaggedText α → Lean.Widget.TaggedText α

full_name: Lean.Widget.instBEqTaggedText
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: {α : Type u_1} → [inst : BEq α] → BEq (Lean.Widget.TaggedText α)

full_name: Lean.Widget.TaggedText.text
code: /-- The minimal structure needed to represent "string with interesting (tagged) substrings".
Much like Lean 3 [`sf`](https://github.com/leanprover-community/mathlib/blob/bfa6bbbce69149792cc009ab7f9bc146181dc051/src/tactic/interactive_expr.lean#L38),
but with indentation already stringified. -/
inductive TaggedText (α : Type u) where
  | text   : String → TaggedText α
  /-- Invariants:
  - non-empty
  - no adjacent `text` elements (they should be collapsed)
  - no directly nested `append`s (but `append #[tag _ (append ..)]` is okay) -/
  | append : Array (TaggedText α) → TaggedText α
  | tag    : α → TaggedText α → TaggedText α
  deriving Inhabited, BEq, Repr, FromJson, ToJson
goal: String → Lean.Widget.TaggedText α

full_name: Lean.Widget.instFromJsonTaggedText
code: FromJson
goal: {α : Type} → [inst : Lean.FromJson α] → Lean.FromJson (Lean.Widget.TaggedText α)

full_name: Lean.Widget.instToJsonTaggedText
code: ToJson
goal: {α : Type u_1} → [inst : Lean.ToJson α] → Lean.ToJson (Lean.Widget.TaggedText α)

full_name: Lean.Widget.TaggedText.appendText
code: def appendText (s₀ : String) : TaggedText α → TaggedText α
  
goal: Lean.Widget.TaggedText α → Lean.Widget.TaggedText α

full_name: Lean.Widget.TaggedText.appendTag
code: def appendTag (acc : TaggedText α) (t₀ : α) (a₀ : TaggedText α) : TaggedText α 
goal: Lean.Widget.TaggedText α

full_name: Lean.Widget.TaggedText.map
code: partial def map : TaggedText α → TaggedText β
  
goal: Lean.Widget.TaggedText α → Lean.Widget.TaggedText β

full_name: Lean.Widget.TaggedText.mapM
code: partial def mapM : TaggedText α → m (TaggedText β)
  
goal: Lean.Widget.TaggedText α → m (Lean.Widget.TaggedText β)

full_name: Lean.Widget.TaggedText.rewrite
code: partial def rewrite : TaggedText α → TaggedText β
  
goal: Lean.Widget.TaggedText α → Lean.Widget.TaggedText β

full_name: Lean.Widget.TaggedText.rewriteM
code: /-- Like `mapM` but allows rewriting the whole subtree at `tag` nodes. -/
partial def rewriteM : TaggedText α → m (TaggedText β)
  
goal: Lean.Widget.TaggedText α → m (Lean.Widget.TaggedText β)

full_name: Lean.Widget.TaggedText.instRpcEncodable
code: instance [RpcEncodable α] : RpcEncodable (TaggedText α) 
goal: Lean.Server.RpcEncodable (Lean.Widget.TaggedText α)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Widget.TaggedText.0.Lean.Widget.TaggedText.TaggedState.tagStack
code: private structure TaggedState where
  out      : TaggedText (Nat × Nat)              := TaggedText.text ""
  tagStack : List (Nat × Nat × TaggedText (Nat × Nat)) := []
  column   : Nat                                 := 0
  deriving Inhabited
goal: List (Nat × Nat × Lean.Widget.TaggedText (Nat × Nat))

full_name: Lean.Widget.TaggedText.instInhabitedTaggedState
code: private structure TaggedState where
  out      : TaggedText (Nat × Nat)              := TaggedText.text ""
  tagStack : List (Nat × Nat × TaggedText (Nat × Nat)) := []
  column   : Nat                                 := 0
  deriving Inhabited
goal: Inhabited Lean.Widget.TaggedText.TaggedState

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Widget.TaggedText.0.Lean.Widget.TaggedText.TaggedState.column
code: private structure TaggedState where
  out      : TaggedText (Nat × Nat)              := TaggedText.text ""
  tagStack : List (Nat × Nat × TaggedText (Nat × Nat)) := []
  column   : Nat                                 := 0
  deriving Inhabited
goal: Nat

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Widget.TaggedText.0.Lean.Widget.TaggedText.TaggedState
code: private structure TaggedState where
  out      : TaggedText (Nat × Nat)              := TaggedText.text ""
  tagStack : List (Nat × Nat × TaggedText (Nat × Nat)) := []
  column   : Nat                                 := 0
  deriving Inhabited
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Widget.TaggedText.0.Lean.Widget.TaggedText.TaggedState.out
code: private structure TaggedState where
  out      : TaggedText (Nat × Nat)              := TaggedText.text ""
  tagStack : List (Nat × Nat × TaggedText (Nat × Nat)) := []
  column   : Nat                                 := 0
  deriving Inhabited
goal: Lean.Widget.TaggedText (Nat × Nat)

full_name: Lean.Widget.TaggedText.instMonadPrettyFormatStateMTaggedState
code: instance : Std.Format.MonadPrettyFormat (StateM TaggedState) 
goal: Std.Format.MonadPrettyFormat (StateM Lean.Widget.TaggedText.TaggedState)

full_name: Lean.Widget.TaggedText.prettyTagged
code: /-- 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. -/
def prettyTagged (f : Format) (indent := 0) (w : Nat := Std.Format.defWidth) : TaggedText (Nat × Nat) 
goal: Lean.Widget.TaggedText (Nat × Nat)

full_name: Lean.Widget.TaggedText.stripTags.go
code: /-- Remove tags, leaving just the pretty-printed string. -/
partial def stripTags (tt : TaggedText α) : String 
goal: Array (Lean.Widget.TaggedText α) → String

full_name: Lean.Widget.TaggedText.stripTags
code: /-- Remove tags, leaving just the pretty-printed string. -/
partial def stripTags (tt : TaggedText α) : String 
goal: String