File: .lake/packages/lean4/src/lean/Lean/Data/SMap.lean

full_name: Lean.SMap.map₁
code: /-- Staged map for implementing the Environment. The idea is to store
   imported entries into a hashtable and local entries into a persistent hashtable.

   Hypotheses:
   - The number of entries (i.e., declarations) coming from imported files is much bigger than
     the number of entries in the current file.
   - HashMap is faster than PersistentHashMap.
   - When we are reading imported files, we have exclusive access to the map, and efficient
     destructive updates are performed.

   Remarks:
   - We never remove declarations from the Environment. In principle, we could support
     deletion by using `(PHashMap α (Option β))` where the value `none` would indicate
     that an entry was "removed" from the hashtable.
   - We do not need additional bookkeeping for extracting the local entries.
-/
structure SMap (α : Type u) (β : Type v) [BEq α] [Hashable α] where
  stage₁ : Bool         := true
  map₁   : HashMap α β  := {}
  map₂   : PHashMap α β := {}
goal: Lean.HashMap α β

full_name: Lean.SMap.stage₁
code: /-- Staged map for implementing the Environment. The idea is to store
   imported entries into a hashtable and local entries into a persistent hashtable.

   Hypotheses:
   - The number of entries (i.e., declarations) coming from imported files is much bigger than
     the number of entries in the current file.
   - HashMap is faster than PersistentHashMap.
   - When we are reading imported files, we have exclusive access to the map, and efficient
     destructive updates are performed.

   Remarks:
   - We never remove declarations from the Environment. In principle, we could support
     deletion by using `(PHashMap α (Option β))` where the value `none` would indicate
     that an entry was "removed" from the hashtable.
   - We do not need additional bookkeeping for extracting the local entries.
-/
structure SMap (α : Type u) (β : Type v) [BEq α] [Hashable α] where
  stage₁ : Bool         := true
  map₁   : HashMap α β  := {}
  map₂   : PHashMap α β := {}
goal: Bool

full_name: Lean.SMap.map₂
code: /-- Staged map for implementing the Environment. The idea is to store
   imported entries into a hashtable and local entries into a persistent hashtable.

   Hypotheses:
   - The number of entries (i.e., declarations) coming from imported files is much bigger than
     the number of entries in the current file.
   - HashMap is faster than PersistentHashMap.
   - When we are reading imported files, we have exclusive access to the map, and efficient
     destructive updates are performed.

   Remarks:
   - We never remove declarations from the Environment. In principle, we could support
     deletion by using `(PHashMap α (Option β))` where the value `none` would indicate
     that an entry was "removed" from the hashtable.
   - We do not need additional bookkeeping for extracting the local entries.
-/
structure SMap (α : Type u) (β : Type v) [BEq α] [Hashable α] where
  stage₁ : Bool         := true
  map₁   : HashMap α β  := {}
  map₂   : PHashMap α β := {}
goal: Lean.PHashMap α β

full_name: Lean.SMap
code: /-- Staged map for implementing the Environment. The idea is to store
   imported entries into a hashtable and local entries into a persistent hashtable.

   Hypotheses:
   - The number of entries (i.e., declarations) coming from imported files is much bigger than
     the number of entries in the current file.
   - HashMap is faster than PersistentHashMap.
   - When we are reading imported files, we have exclusive access to the map, and efficient
     destructive updates are performed.

   Remarks:
   - We never remove declarations from the Environment. In principle, we could support
     deletion by using `(PHashMap α (Option β))` where the value `none` would indicate
     that an entry was "removed" from the hashtable.
   - We do not need additional bookkeeping for extracting the local entries.
-/
structure SMap (α : Type u) (β : Type v) [BEq α] [Hashable α] where
  stage₁ : Bool         := true
  map₁   : HashMap α β  := {}
  map₂   : PHashMap α β := {}
goal: Type (max u v)

full_name: Lean.SMap.instInhabited
code: instance : Inhabited (SMap α β) 
goal: Inhabited (Lean.SMap α β)

full_name: Lean.SMap.empty
code: def empty : SMap α β 
goal: Lean.SMap α β

full_name: Lean.SMap.fromHashMap
code: @[inline] def fromHashMap (m : HashMap α β) (stage₁ := true) : SMap α β 
goal: Lean.SMap α β

full_name: Lean.SMap.insert
code: @[specialize] def insert : SMap α β → α → β → SMap α β
  
goal: Lean.SMap α β → α → β → Lean.SMap α β

full_name: Lean.SMap.insert'
code: @[specialize] def insert' : SMap α β → α → β → SMap α β
  
goal: Lean.SMap α β → α → β → Lean.SMap α β

full_name: Lean.SMap.find?
code: @[specialize] def find? : SMap α β → α → Option β
  
goal: Lean.SMap α β → α → Option β

full_name: Lean.SMap.findD
code: @[inline] def findD (m : SMap α β) (a : α) (b₀ : β) : β 
goal: β

full_name: Lean.SMap.find!
code: @[inline] def find! [Inhabited β] (m : SMap α β) (a : α) : β 
goal: β

full_name: Lean.SMap.contains
code: @[specialize] def contains : SMap α β → α → Bool
  
goal: Lean.SMap α β → α → Bool

full_name: Lean.SMap.find?'
code: /-- Similar to `find?`, but searches for result in the hashmap first.
   So, the result is correct only if we never "overwrite" `map₁` entries using `map₂`. -/
@[specialize] def find?' : SMap α β → α → Option β
  
goal: Lean.SMap α β → α → Option β

full_name: Lean.SMap.forM
code: def forM [Monad m] (s : SMap α β) (f : α → β → m PUnit) : m PUnit 
goal: m PUnit

full_name: Lean.SMap.instForMProd
code: instance : ForM m (SMap α β) (α × β) 
goal: ForM m (Lean.SMap α β) (α × β)

full_name: Lean.SMap.instForInProd
code: instance : ForIn m (SMap α β) (α × β) 
goal: ForIn m (Lean.SMap α β) (α × β)

full_name: Lean.SMap.switch
code: /-- Move from stage 1 into stage 2. -/
def switch (m : SMap α β) : SMap α β 
goal: Lean.SMap α β

full_name: Lean.SMap.foldStage2
code: @[inline] def foldStage2 {σ : Type w} (f : σ → α → β → σ) (s : σ) (m : SMap α β) : σ 
goal: σ

full_name: Lean.SMap.fold
code: def fold {σ : Type w} (f : σ → α → β → σ) (init : σ) (m : SMap α β) : σ 
goal: σ

full_name: Lean.SMap.numBuckets
code: def numBuckets (m : SMap α β) : Nat 
goal: Nat

full_name: Lean.SMap.toList
code: def toList (m : SMap α β) : List (α × β) 
goal: List (α × β)

full_name: List.toSMap
code: def _root_.List.toSMap [BEq α] [Hashable α] (es : List (α × β)) : SMap α β 
goal: Lean.SMap α β

full_name: Lean.instReprSMap
code: instance {_ : BEq α} {_ : Hashable α} [Repr α] [Repr β] : Repr (SMap α β) 
goal: {x : BEq α} → {x_1 : Hashable α} → [inst : Repr α] → [inst : Repr β] → Repr (Lean.SMap α β)