Cache.purge_loop: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend as Cache Lines 252-260 of bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&start_line=252&end_line=260 import Base import bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/types/model.bend as T # No accumulated event log is stored in the cache itself. def purge_loop(-K: Data, -V: Data, fuel: Nat, c: Cache) -> Step: match fuel: case 0n: Out{clear_metrics(K, V, c), None{}, False{}, Nil{}} case 1n+p: +step = remove_oldest(K, V, c, False{}) +rest = purge_loop(K, V, p, step_cache(K, V, step)) Out{step_cache(K, V, rest), None{}, False{}, List.append(&2, T.LruEvent, step_events(K, V, step), step_events(K, V, rest))} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=Cache https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=Step https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=clear_metrics https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=remove_oldest https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=step_cache https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/src/cache.bend&name=step_events https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/lemmas/types/model.bend&name=LruEvent