package catala
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=42196e9a9c5e12839b38cb3da935f10c
sha512=ede2d8c17dcb936c1c8c596f1453bf89370a2f824a190efe74e438d7d7f7f83875c1ecbc18219c6a8a3e98b3ab4da1c3a6cc4e534687dbc90f3dca8230f43f7b
doc/catala.catala_utils/Catala_utils/Hash/index.html
Module Catala_utils.HashSource
Hashes for the identification of modules.
In contrast with OCaml's basic `Hashtbl.hash`, they process the full depth of terms. Any meaningful interface change in a module should only be in hash collision with a 1/2^30 probability.
Native Hasthbl.hash hashes, value is truncated to 30 bits whatever the architecture (positive 31-bit integers)
A "full" hash includes the Catala version and compilation flags, alongside the module interface
Hashtbl.hash. Do not use on deep types (it has a bounded depth), use specific hashing functions.
map fold_f key_hash_f value_hash_f map computes the hash of a map. The first argument is expected to be a Foo.Map.fold function. The result is independent of the ordering of the map.
Turns a raw interface hash into a full hash, ready for printing
It's inconvenient to need hash updates on external modules. This string is uses as a hash instead for those cases.
NOTE: This is a temporary solution A future approach could be to have Catala generate a module loader (with the proper hash), relieving the user implementation from having to do the registration.