Given a structure S
, Lean automatically creates an auxiliary definition (projection function)
for each field. This structure caches information about these auxiliary definitions.
- ctorName : Lean.Name
Constructor associated with the auxiliary projection function.
- numParams : Nat
Number of parameters in the structure
- i : Nat
The field index associated with the auxiliary projection function.
- fromClass : Bool
true
if the structure is a class.
Instances For
Equations
- Lean.instInhabitedProjectionFunctionInfo = { default := { ctorName := default, numParams := default, i := default, fromClass := default } }
Equations
- Lean.instReprProjectionFunctionInfo = { reprPrec := Lean.reprProjectionFunctionInfo✝ }
@[export lean_mk_projection_info]
Instances For
@[export lean_add_projection_info]
def
Lean.addProjectionFnInfo
(env : Lean.Environment)
(projName ctorName : Lean.Name)
(numParams i : Nat)
(fromClass : Bool)
:
Instances For
@[export lean_get_projection_info]
Equations
- env.getProjectionFnInfo? projName = Lean.projectionFnInfoExt.find? env projName
Instances For
Equations
- env.isProjectionFn declName = Lean.projectionFnInfoExt.contains env declName
Instances For
If projName
is the name of a projection function, return the associated structure name
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.isProjectionFn
{m : Type → Type}
[Lean.MonadEnv m]
[Monad m]
(declName : Lean.Name)
:
m Bool
Equations
- Lean.isProjectionFn declName = do let __do_lift ← Lean.getEnv pure (__do_lift.isProjectionFn declName)
Instances For
def
Lean.getProjectionFnInfo?
{m : Type → Type}
[Lean.MonadEnv m]
[Monad m]
(declName : Lean.Name)
: