Documentation

Lean.Elab.DeclModifiers

def Lean.Elab.checkNotAlreadyDeclared {m : TypeType} [inst : Monad m] [inst : Lean.MonadEnv m] [inst : Lean.MonadError m] [inst : Lean.Elab.MonadInfoTree m] (declName : Lean.Name) :

Ensure the environment does not contain a declaration with name declName. Recall that a private declaration cannot shadow a non-private one and vice-versa, although they internally have different names.

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

Declaration visibility modifier. That is, whether a declaration is regular, protected or private.

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

    Whether a declaration is default, partial or nonrec.

    Instances For

      Flags and data added to declarations (eg docstrings, attributes, private, unsafe, partial, ...).

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

        Store attr in modifiers

        Equations
        • One or more equations did not get rendered due to their size.
        Equations
        • One or more equations did not get rendered due to their size.
        def Lean.Elab.expandOptDocComment? {m : TypeType} [inst : Monad m] [inst : Lean.MonadError m] (optDocComment : Lean.Syntax) :

        Retrieve doc string from stx of the form (docComment)?.

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

        Elaborate declaration modifiers (i.e., attributes, partial, private, proctected, unsafe, noncomputable, doc string)

        Equations
        • One or more equations did not get rendered due to their size.
        def Lean.Elab.applyVisibility {m : TypeType} [inst : Monad m] [inst : Lean.MonadEnv m] [inst : Lean.MonadError m] [inst : Lean.Elab.MonadInfoTree m] (visibility : Lean.Elab.Visibility) (declName : Lean.Name) :

        Ensure the function has not already been declared, and apply the given visibility setting to declName. If private, return the updated name using our internal encoding for private names. If protected, register declName as protected in the environment.

        Equations
        • One or more equations did not get rendered due to their size.
        def Lean.Elab.checkIfShadowingStructureField {m : TypeType} [inst : Monad m] [inst : Lean.MonadEnv m] [inst : Lean.MonadError m] (declName : Lean.Name) :
        Equations
        • One or more equations did not get rendered due to their size.
        def Lean.Elab.mkDeclName {m : TypeType} [inst : Monad m] [inst : Lean.MonadEnv m] [inst : Lean.MonadError m] [inst : Lean.Elab.MonadInfoTree m] (currNamespace : Lean.Name) (modifiers : Lean.Elab.Modifiers) (shortName : Lean.Name) :
        Equations
        • One or more equations did not get rendered due to their size.

        declId is of the form

        leading_parser ident >> optional (".{" >> sepBy1 ident ", " >> "}")
        

        but we also accept a single identifier to users to make macro writing more convenient .

        Equations
        • One or more equations did not get rendered due to their size.
        • Short name for recursively referring to the declaration.

          shortName : Lean.Name
        • Fully qualified name that will be used to name the declaration in the kernel.

          declName : Lean.Name
        • Universe parameter names provided using the universe command and .{...} notation.

          levelNames : List Lean.Name

        expandDeclId resulting type.

        Instances For
          def Lean.Elab.expandDeclId {m : TypeType} [inst : Monad m] [inst : Lean.MonadEnv m] [inst : Lean.MonadError m] [inst : Lean.Elab.MonadInfoTree m] (currNamespace : Lean.Name) (currLevelNames : List Lean.Name) (declId : Lean.Syntax) (modifiers : Lean.Elab.Modifiers) :

          Given a declaration identifier (e.g., ident (".{" ident,+ "}")?) that may contain explicit universe parameters

          • Ensure the new universe parameters do not shadow universe parameters declared using universe command.
          • Create the fully qualified named for the declaration using the current namespace, and given modifiers
          • Create a short version for recursively referring to the declaration. Recall that the protected modifier affects the generation of the short name.

          The result also contains the universe parameters provided using universe command, and the .{...} notation.

          This commands also stores the doc string stored in modifiers.

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