def pack.block
import ezx@1.11.0.0/src/lock/lock.bend as Lockimport Base
import ezx@1.11.0.0/src/toml/toml.bend as T
import ezx@1.11.0.0/src/pkg/pkg.bend as K
520# a package's two tables as one block of text, filed under its hash. The lock
521# puts packages in hash order by sorting these blocks with `K.file.sort`,
522# whose order-independence pkg proves; a second sort over packages would need
523# that proof again, and Bend's function values are linear, so one sort by a
524# key function applied at every comparison cannot be written. A block's path
525# is its package's hash, so distinct hashes are distinct paths.
526def pack.block(package: Pack) -> K.Item:
527 Pack{+hash, src, files} = package
528 K.Item{hash, T.render(pack.sects.of(hash, src, K.files_of(files)))}