Documentation

Lean.Elab.Structure

Recall that the `structure command syntax is

leading_parser (structureTk <|> classTk) >> declId >> many Term.bracketedBinder >> Term.optType >> optional «extends» >> optional (" := " >> optional structCtor >> structFields)

Represents the data of the syntax of a structure parent.

  • ref : Syntax
  • projRef : Syntax

    Ref to use for the parent projection.

  • name? : Option Name

    The name of the parent projection (without macro scopes).

  • rawName? : Option Name

    The name of the parent projection (with macro scopes). Used for local name during elaboration.

  • type : Syntax
Instances For

    Represents the data of the syntax of a structure field declaration.

    Instances For
      Equations

      Gets the single constructor view from the underlying InductiveView. Recall that structures have exactly one constructor.

      Equations
      Instances For

        Elaborated parent info.

        • ref : Syntax
        • addTermInfo : Bool

          Whether to add term info to the ref. False if there's no user-provided parent projection.

        • fvar? : Option Expr

          A let variable that represents this structure parent.

        • structName : Name
        • name : Name

          Field name for parent.

        • declName : Name

          Name of the projection function.

        • subobject : Bool

          Whether this parent corresponds to a subobject field.

        • type : Expr
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.

          Records the way in which a field is represented in a structure.

          • newField : StructFieldKind

            New field defined by this structure. The field is represented as a constructor argument.

          • copiedField : StructFieldKind

            Field that comes from a parent but will be represented as a new field. The field is represented as a constructor argument. Its default value may be overridden.

          • fromSubobject : StructFieldKind

            Field that comes from a embedded parent field, and is represented within a subobject field. Its default value may be overridden.

          • subobject (structName : Name) : StructFieldKind

            The field is an embedded parent structure.

          Instances For

            Elaborated field info.

            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[reducible, inline]

                  Map from field name to expression representing the field.

                  Equations
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For