Documentation

RoseTree.Defs

structure Rose (A : Type u) :

The type of node-labelled, finitely branching trees.

  • label : A

    The label of the root node.

  • children : List (Rose A)

    The list of child trees.

Instances For
    @[irreducible]
    def Rose.fold {A : Type u_1} {B : Type u_2} (f : AList BB) :
    Rose AB

    The fold operation over trees.

    Equations
    Instances For
      @[irreducible]
      def Rose.bind {A : Type u_1} {B : Type u_2} (f : ARose B) :
      Rose ARose B

      Grafts a tree to every sub-node in a Rose tree.

      Equations
      Instances For
        def Rose.map {A : Type u_1} {B : Type u_2} (f : AB) :
        Rose ARose B

        Applies a function to every label in a Rose tree.

        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          @[irreducible]
          def Rose.encode {A : Type u_1} [Encodable A] :
          Rose A

          An injection into the natural numbers.

          Equations
          Instances For
            @[irreducible]
            def Rose.decode {A : Type u_1} [Encodable A] (n : ) :

            The inverse of encode.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              instance Rose.instLE {A : Type u_1} [LE A] :
              LE (Rose A)
              Equations