eo-phi-normalizer-3.0.0: data/0.49.4/org/eolang/structs/map.phi
{⟦
org() ↦ ⟦
eolang() ↦ ⟦
structs() ↦ ⟦
map(pairs) ↦ ⟦
φ ↦ ξ.auto-named-attr-at-37-6.initialized,
entry(key, value) ↦ ⟦⟧,
initialized(entries) ↦ ⟦
initialized ↦ ξ,
size ↦ ξ.entries.length,
keys() ↦ ⟦
φ ↦ Φ̇.structs.list(ξ.ρ.entries).mapped(
⟦
φ ↦ ξ.entry.key,
entry ↦ ∅
⟧
)
⟧,
values() ↦ ⟦
φ ↦ Φ̇.structs.list(ξ.ρ.entries).mapped(
⟦
φ ↦ ξ.entry.value,
entry ↦ ∅
⟧
)
⟧,
has(key) ↦ ⟦
φ ↦ ξ.ρ.found(ξ.key).exists
⟧,
found(key) ↦ ⟦
hash ↦ Φ̇.dataized(Φ̇.structs.hash-code-of(ξ.key)).as-bytes,
φ ↦ ξ.ρ.size.eq(0).if(ξ.not-found, ξ.rec-key-search(ξ.not-found, 0)),
rec-key-search(found, index) ↦ ⟦
entry ↦ ξ.ρ.ρ.entries.at(ξ.index),
φ ↦ ξ.found.exists.or(ξ.ρ.ρ.size.eq(ξ.index)).if(
ξ.found,
ξ.ρ.rec-key-search(
ξ.ρ.hash.eq(ξ.entry.hash).if(
ξ.auto-named-attr-at-133-54, ξ.found
),
ξ.index.plus(1)
)
),
auto-named-attr-at-133-54() ↦ ⟦
exists ↦ Φ̇.true,
get ↦ ξ.ρ.entry.value
⟧
⟧,
not-found() ↦ ⟦
exists ↦ Φ̇.false,
get ↦ Φ̇.error(
Φ̇.txt.sprintf(
"Object by hash code %d from given key does not exists",
Φ̇.tuple(Φ̇.tuple.empty, ξ.ρ.hash)
)
)
⟧
⟧,
with(key, value) ↦ ⟦
hash ↦ Φ̇.dataized(Φ̇.structs.hash-code-of(ξ.key)).as-bytes,
φ ↦ ξ.ρ.ρ.ρ.map.initialized(
Φ̇.structs.list(ξ.ρ.entries).filtered(
ξ.auto-named-attr-at-153-50
).origin.with(ξ.auto-named-attr-at-154-12)
),
auto-named-attr-at-153-50(entry) ↦ ⟦
φ ↦ ξ.ρ.hash.eq(ξ.entry.hash).not
⟧,
auto-named-attr-at-154-12() ↦ ⟦
key ↦ ξ.ρ.key,
value ↦ ξ.ρ.value,
hash ↦ ξ.ρ.hash
⟧
⟧,
without(key) ↦ ⟦
hash ↦ Φ̇.dataized(Φ̇.structs.hash-code-of(ξ.key)).as-bytes,
φ ↦ ξ.ρ.ρ.ρ.map.initialized(
Φ̇.structs.list(ξ.ρ.entries).filtered(
ξ.auto-named-attr-at-167-48
).origin
),
auto-named-attr-at-167-48(entry) ↦ ⟦
φ ↦ ξ.ρ.hash.eq(ξ.entry.hash).not
⟧
⟧
⟧,
auto-named-attr-at-37-6() ↦ ⟦
pairs-size ↦ Φ̇.dataized(ξ.ρ.pairs.length).as-bytes,
φ ↦ ξ.ρ.initialized(
ξ.pairs-size.eq(0).if(
Φ̇.tuple.empty,
ξ.rec-rebuild(Φ̇.tuple.empty, 0, Φ̇.structs.list(Φ̇.tuple.empty))
)
),
rec-rebuild(accum, index, hashes) ↦ ⟦
entry ↦ ξ.ρ.ρ.pairs.at(ξ.index),
hash ↦ Φ̇.dataized(Φ̇.structs.hash-code-of(ξ.entry.key)).as-bytes,
φ ↦ ξ.ρ.pairs-size.eq(ξ.index).if(
ξ.accum,
ξ.ρ.rec-rebuild(
ξ.hashes.contains(ξ.hash).if(
ξ.accum, ξ.accum.with(ξ.auto-named-attr-at-59-18)
),
ξ.index.plus(1),
ξ.hashes.with(ξ.hash)
)
),
auto-named-attr-at-59-18() ↦ ⟦
key ↦ ξ.ρ.entry.key,
value ↦ ξ.ρ.entry.value,
hash ↦ ξ.ρ.hash
⟧
⟧
⟧
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧
⟧}