Documentation

Lean.Attributes

@[inline]
abbrev Lean.AttrM (α : Type) :
Type
Equations
Equations
structure Lean.AttributeImplCore:
Type
Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
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.
Equations
  • One or more equations did not get rendered due to their size.
structure Lean.TagAttribute:
Type

Tag attributes are simple and efficient. They are useful for marking declarations in the modules where they were defined.

The startup cost for this kind of attribute is very small since addImportedFn is a constant function.

They provide the predicate tagAttr.hasTag env decl which returns true iff declaration decl is tagged in the environment env.

Equations
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.
structure Lean.ParametricAttribute (α : Type) :
Type

A TagAttribute variant where we can attach parameters to attributes. It is slightly more expensive and consumes a little bit more memory than TagAttribute.

They provide the function pAttr.getParam env decl which returns some p iff declaration decl contains the attribute pAttr with parameter p.

Equations
  • Lean.instInhabitedParametricAttribute = { default := { attr := default, ext := default } }
structure Lean.ParametricAttributeImpl (α : Type) extends Lean.AttributeImplCore :
Type
Equations
  • One or more equations did not get rendered due to their size.
def Lean.ParametricAttribute.getParam {α : Type} [inst : Inhabited α] (attr : Lean.ParametricAttribute α) (env : Lean.Environment) (decl : Lean.Name) :
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
  • Lean.instInhabitedEnumAttributes = { default := { attrs := default, ext := default } }
def Lean.registerEnumAttributes {α : Type} [inst : Inhabited α] (extName : Lean.Name) (attrDescrs : List (Lean.Name × String × α)) (validate : optParam (Lean.NameαLean.AttrM Unit) fun x x => pure ()) (applicationTime : optParam Lean.AttributeApplicationTime Lean.AttributeApplicationTime.afterTypeChecking) :
Equations
  • One or more equations did not get rendered due to their size.
def Lean.EnumAttributes.getValue {α : Type} [inst : Inhabited α] (attr : Lean.EnumAttributes α) (env : Lean.Environment) (decl : Lean.Name) :
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.
@[implementedBy Lean.mkAttributeImplOfConstantUnsafe]
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.
@[export lean_attribute_application_time]
Equations
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
def Lean.Attribute.erase (declName : Lean.Name) (attrName : Lean.Name) :
Equations
@[export lean_update_env_attributes]

updateEnvAttributes implementation

Equations
  • One or more equations did not get rendered due to their size.
@[export lean_get_num_attributes]

getNumBuiltinAttributes implementation

Equations