An entry for the persistent environment extension for declared type classes
- name : Name
Class name.
Instances For
Instances For
Equations
Equations
- Lean.instInhabitedClassState.default = { outParamMap := default }
Instances For
Instances For
Switch the state into persistent mode. We switch to this mode after
we read all imported .olean files.
Recall that we use a SMap for implementing the state of the type class environment extension.
Instances For
Type class environment extension
Return true if n is the name of type class in the given environment.
Equations
- Lean.isClass env n = (Lean.classExtension.getState env).outParamMap.contains n
Instances For
If declName is a class, return the position of its outParams.
Equations
- Lean.getOutParamPositions? env declName = (Lean.classExtension.getState env).outParamMap.find? declName
Instances For
Return true if the given declName is a type class with output parameters.
Equations
- Lean.hasOutParams env declName = match Lean.getOutParamPositions? env declName with | some outParams => !outParams.isEmpty | none => false
Instances For
Mark outParams in type as implicit. Note that it also marks instance implicit arguments that depend on outParams as implicit.
Remark: this function consumes the outParam annotations.
This function uses the same logic used as checkOutParam.
See issue #1901
Equations
- Lean.mkOutParamArgsImplicit type = Lean.mkOutParamArgsImplicit.go✝ type type #[]
Instances For
Add a new type class with the given name to the environment.
declName must not be the name of an existing type class,
and it must be the name of constant in env.
declName must be a inductive datatype or axiom.
Recall that all structures are inductive datatypes.
Equations
- One or more equations did not get rendered due to their size.