@[inline]
findExtraEntryCached? for constants.map₁.
Equations
Instances For
@[inline]
findExtraEntryCached? for constants.map₁.
Equations
- t.findConstCached? n = Option.map (fun (x : Lean.ConstantInfo × Nat) => x.fst) (t.findConstEntryCached? n)
Instances For
@[inline]
findExtraEntryCached? for constants.map₁.
Equations
- t.findConstModIdxCached? n = match Lean.ImportedConsts.findConstModIdxCachedImpl✝ t.cache? t n with | 0 => none | i.succ => some i
Instances For
The constants of an environment: the imported constants merged from the per-olean prefix trees plus the constants declared in the current module.
- map₁ : ImportedConsts ConstantInfo
Constants from imported modules.
- map₂ : PHashMap Name ConstantInfo
Constants declared in the current module.
Instances For
@[instance_reducible]
Equations
- m.find? n = (Lean.PersistentHashMap.find? m.map₂ n <|> m.map₁.findConstCached? n)
Instances For
Similar to find?, but searches the imported constants first. So, the result is correct only if
imported constants are never overwritten.
Equations
- m.find?' n = (m.map₁.findConstCached? n <|> Lean.PersistentHashMap.find? m.map₂ n)
Instances For
Equations
- m.contains n = (Lean.PersistentHashMap.contains m.map₂ n || (m.map₁.findConstCached? n).isSome)
Instances For
Instances For
@[inline]
def Lean.ConstMap.foldStage2 {σ : Type u_1} (f : σ → Name → ConstantInfo → σ) (s : σ) (m : ConstMap) :
σ
Folds over the constants declared in the current module.
Equations
- Lean.ConstMap.foldStage2 f s m = Lean.PersistentHashMap.foldl m.map₂ f s
Instances For
def Lean.ConstMap.foldM {σ : Type} {m : Type → Type} [Monad m] (f : σ → Name → ConstantInfo → m σ) (init : σ) (map : ConstMap) :
m σ
Equations
- Lean.ConstMap.foldM f init map = do let __do_lift ← map.map₁.foldlM f init Lean.PersistentHashMap.foldlM map.map₂ f __do_lift
Instances For
def Lean.ConstMap.fold {σ : Type u_1} (f : σ → Name → ConstantInfo → σ) (init : σ) (m : ConstMap) :
σ
Equations
- Lean.ConstMap.fold f init m = Lean.PersistentHashMap.foldl m.map₂ f (m.map₁.foldl f init)
Instances For
@[instance_reducible]
instance Lean.ConstMap.instForMProdNameConstantInfoOfMonad {m : Type → Type} [Monad m] :
ForM m ConstMap (Name × ConstantInfo)
Equations
- One or more equations did not get rendered due to their size.
@[instance_reducible]
instance Lean.ConstMap.instForInProdNameConstantInfoOfMonad {m : Type → Type} [Monad m] :
ForIn m ConstMap (Name × ConstantInfo)
Equations
- Lean.ConstMap.instForInProdNameConstantInfoOfMonad = { forIn := fun {β : Type} => ForM.forIn }
Equations
- m.toList = Lean.ConstMap.fold (fun (es : List (Lean.Name × Lean.ConstantInfo)) (n : Lean.Name) (v : Lean.ConstantInfo) => (n, v) :: es) [] m