- afterTypeChecking: Lean.AttributeApplicationTime
- afterCompilation: Lean.AttributeApplicationTime
- beforeElaboration: Lean.AttributeApplicationTime
Equations
- Lean.instBEqAttributeApplicationTime = { beq := [anonymous] }
Equations
- Lean.instMonadLiftImportMAttrM = { monadLift := fun {α} x => do let a ← Lean.getEnv let a_1 ← Lean.getOptions liftM (x { env := a, opts := a_1 }) }
- name : Lean.Name
- descr : String
- applicationTime : Lean.AttributeApplicationTime
Equations
- Lean.instInhabitedAttributeImplCore = { default := { name := default, descr := default, applicationTime := default } }
- global: Lean.AttributeKind
- local: Lean.AttributeKind
- scoped: Lean.AttributeKind
Equations
- Lean.instBEqAttributeKind = { beq := [anonymous] }
Equations
- Lean.instInhabitedAttributeKind = { default := Lean.AttributeKind.global }
Equations
- One or more equations did not get rendered due to their size.
This is run when the attribute is applied to a declaration
decl.stxis the syntax of the attribute including arguments.add : Lean.Name → Lean.Syntax → Lean.AttributeKind → Lean.AttrM Unit- erase : Lean.Name → Lean.AttrM Unit
Equations
- Lean.instInhabitedAttributeImpl = { default := { toAttributeImplCore := default, add := default, erase := default } }
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
- Lean.Attribute.Builtin.getId? stx = do let ident? ← Lean.Attribute.Builtin.getIdent? stx pure (Lean.Syntax.getId <$> ident?)
Equations
- Lean.Attribute.Builtin.getId stx = do let a ← Lean.Attribute.Builtin.getIdent stx pure (Lean.Syntax.getId a)
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.
- attr : Lean.AttributeImpl
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
- Lean.instInhabitedTagAttribute = { default := { attr := default, ext := default } }
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.
- attr : Lean.AttributeImpl
- ext : Lean.PersistentEnvExtension (Lean.Name × α) (Lean.Name × α) (Lean.NameMap α)
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 } }
- getParam : Lean.Name → Lean.Syntax → Lean.AttrM α
- afterSet : Lean.Name → α → Lean.AttrM Unit
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.
- attrs : List Lean.AttributeImpl
- ext : Lean.PersistentEnvExtension (Lean.Name × α) (Lean.Name × α) (Lean.NameMap α)
Equations
- Lean.instInhabitedEnumAttributes = { default := { attrs := default, ext := default } }
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
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.
- newEntries : List Lean.AttributeExtensionOLeanEntry
Equations
- Lean.instInhabitedAttributeExtensionState = { default := { newEntries := default, map := default } }
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.isBuiltinAttribute n = do let m ← ST.Ref.get Lean.attributeMapRef pure (Std.PersistentHashMap.contains m n)
Equations
- Lean.getBuiltinAttributeNames = do let a ← ST.Ref.get Lean.attributeMapRef pure (Std.PersistentHashMap.foldl a (fun r n x => n :: r) [])
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.getBuiltinAttributeApplicationTime n = do let attr ← Lean.getBuiltinAttributeImpl n pure attr.toAttributeImplCore.applicationTime
Equations
- Lean.isAttribute env attrName = Std.PersistentHashMap.contains (Lean.PersistentEnvExtension.getState Lean.attributeExtension env).map attrName
Equations
- Lean.getAttributeNames env = let m := (Lean.PersistentEnvExtension.getState Lean.attributeExtension env).map; Std.PersistentHashMap.foldl m (fun r n x => n :: r) []
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
- Lean.Attribute.add declName attrName stx kind = do let a ← Lean.getEnv let attr ← Lean.ofExcept (Lean.getAttributeImpl a attrName) Lean.AttributeImpl.add attr declName stx kind
Equations
- Lean.Attribute.erase declName attrName = do let a ← Lean.getEnv let attr ← Lean.ofExcept (Lean.getAttributeImpl a attrName) Lean.AttributeImpl.erase attr declName
updateEnvAttributes implementation
Equations
- One or more equations did not get rendered due to their size.
getNumBuiltinAttributes implementation
Equations
- Lean.getNumBuiltiAttributesImpl = do let a ← ST.Ref.get Lean.attributeMapRef pure a.size