World.sums.ok: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/lock/world.bend as World Lines 151-163 of ezx@1.11.0.0/src/lock/world.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/lock/world.bend&start_line=151&end_line=163 import Base import ezx@1.11.0.0/src/pkg/pkg.bend as K import ezx@1.11.0.0/src/share/sha.bend as Sha # whether every text hashes to the sum its file is recorded with. A list of # texts that is longer or shorter than the files is not the package. def sums.ok(fs: List<&2, K.Item>, ss: List<&2, String>) -> Bool: match fs ss: case Nil{} Nil{}: True{} case Nil{} Con{_h, _t}: False{} case Con{_f, _g} Nil{}: False{} case Con{f, g} Con{s, t}: +rest = sums.ok(g, t) Bool.and(String.eq(Sha.hex(s), K.file.sum(f)), rest) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/pkg.bend&name=Item https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/pkg.bend&name=file.sum https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/sha.bend&name=hex