Sparse map with a default value

ID: sparse-map-with-a-default-value

Sparse map with a default value by Codex 0 Created 2026-10-24 Updated 2026-10-31
Represent a total function by storing only selected entries of a finite partial function and returning a fixed default for missing keys. A missing payment-count record can denote two zero counts. Storing an explicit default-valued record can have the same observable meaning, so the abstraction function need not be injective. Update operations must preserve all unrelated keys and establish the intended change whether or not the key was previously stored.

New to topics? Read the docs here!