This is an internal implementation file of the hash map. Users of the hash map should not rely on the contents of this file.
File contents: Operations on associative lists
AssocList α β
is "the same as" List (α × β)
, but flattening the structure
leads to one fewer pointer indirection (in the current code generator).
- nil: {α : Type u} → {β : α → Type v} → Std.DHashMap.Internal.AssocList α β
Internal implementation detail of the hash map
- cons: {α : Type u} →
{β : α → Type v} → (key : α) → β key → Std.DHashMap.Internal.AssocList α β → Std.DHashMap.Internal.AssocList α β
Internal implementation detail of the hash map
Instances For
Equations
- Std.DHashMap.Internal.instInhabitedAssocList = { default := Std.DHashMap.Internal.AssocList.nil }
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.foldlM f x Std.DHashMap.Internal.AssocList.nil = pure x
- Std.DHashMap.Internal.AssocList.foldlM f x (Std.DHashMap.Internal.AssocList.cons a b es) = do let d ← f x a b Std.DHashMap.Internal.AssocList.foldlM f d es
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.foldl f init as = (Std.DHashMap.Internal.AssocList.foldlM f init as).run
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.forM f as = Std.DHashMap.Internal.AssocList.foldlM (fun (x : PUnit) => f) PUnit.unit as
Instances For
Internal implementation detail of the hash map
Equations
- as.forInStep init f = Std.DHashMap.Internal.AssocList.forInStep.go f as init
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.forInStep.go f Std.DHashMap.Internal.AssocList.nil x = pure (ForInStep.yield x)
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.nil.toList = []
- (Std.DHashMap.Internal.AssocList.cons a b es).toList = ⟨a, b⟩ :: es.toList
Instances For
Internal implementation detail of the hash map
Equations
- l.length = Std.DHashMap.Internal.AssocList.foldl (fun (n : Nat) (x : α) (x : β x) => n + 1) 0 l
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.get? a Std.DHashMap.Internal.AssocList.nil = none
- Std.DHashMap.Internal.AssocList.get? a (Std.DHashMap.Internal.AssocList.cons k v es) = bif k == a then some v else Std.DHashMap.Internal.AssocList.get? a es
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.getCast? a Std.DHashMap.Internal.AssocList.nil = none
- Std.DHashMap.Internal.AssocList.getCast? a (Std.DHashMap.Internal.AssocList.cons a_1 b es) = if h : (a_1 == a) = true then some (cast ⋯ b) else Std.DHashMap.Internal.AssocList.getCast? a es
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.contains a Std.DHashMap.Internal.AssocList.nil = false
- Std.DHashMap.Internal.AssocList.contains a (Std.DHashMap.Internal.AssocList.cons a_1 b es) = (a_1 == a || Std.DHashMap.Internal.AssocList.contains a es)
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.get a (Std.DHashMap.Internal.AssocList.cons k v es) h = if hka : (k == a) = true then v else Std.DHashMap.Internal.AssocList.get a es ⋯
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.getCast a (Std.DHashMap.Internal.AssocList.cons k v es) h = if hka : (k == a) = true then cast ⋯ v else Std.DHashMap.Internal.AssocList.getCast a es ⋯
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.getCast! a (Std.DHashMap.Internal.AssocList.cons a_1 b es) = if h : (a_1 == a) = true then cast ⋯ b else Std.DHashMap.Internal.AssocList.getCast! a es
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.get! a (Std.DHashMap.Internal.AssocList.cons k v es) = bif k == a then v else Std.DHashMap.Internal.AssocList.get! a es
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.getCastD a fallback Std.DHashMap.Internal.AssocList.nil = fallback
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.getD a fallback Std.DHashMap.Internal.AssocList.nil = fallback
- Std.DHashMap.Internal.AssocList.getD a fallback (Std.DHashMap.Internal.AssocList.cons k v es) = bif k == a then v else Std.DHashMap.Internal.AssocList.getD a fallback es
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.replace a b Std.DHashMap.Internal.AssocList.nil = Std.DHashMap.Internal.AssocList.nil
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.erase a Std.DHashMap.Internal.AssocList.nil = Std.DHashMap.Internal.AssocList.nil
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.filterMap f = Std.DHashMap.Internal.AssocList.filterMap.go f Std.DHashMap.Internal.AssocList.nil
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.filterMap.go f acc Std.DHashMap.Internal.AssocList.nil = acc
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.map f = Std.DHashMap.Internal.AssocList.map.go f Std.DHashMap.Internal.AssocList.nil
Instances For
Equations
- Std.DHashMap.Internal.AssocList.map.go f acc Std.DHashMap.Internal.AssocList.nil = acc
- Std.DHashMap.Internal.AssocList.map.go f acc (Std.DHashMap.Internal.AssocList.cons a b es) = Std.DHashMap.Internal.AssocList.map.go f (Std.DHashMap.Internal.AssocList.cons a (f a b) acc) es
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.AssocList.filter f = Std.DHashMap.Internal.AssocList.filter.go f Std.DHashMap.Internal.AssocList.nil
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Std.DHashMap.Internal.AssocList.filter.go f acc Std.DHashMap.Internal.AssocList.nil = acc