package patricia-tree
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=e0fe66ab7da5b2ad240b64430d605f4064bc704bf487acc6314fd868e98ec279
sha512=72d267a727bdda2b3254a8459f6ab3b78ac539456dca8d026520a3a1537369d553d4008c17956d465ea40aa0fdca5a4df1d658fd28af68f73754904a0350d421
doc/patricia-tree/PatriciaTree/MakeHashconsedHeterogeneousMapWithMutex/argument-1-Key/index.html
Parameter MakeHashconsedHeterogeneousMapWithMutex.Key
The type of generic/heterogeneous keys.
It is recommended to use immutable keys. If keys are mutable, any mutations to keys must preserve to_int. Failing to do so will break the patricia trees' invariants.
val to_int : 'key t -> intA unique identifier for values of the type. Usually, we use a fresh counter that is increased to give a unique id to each object. Correctness of the operations requires that different values in a tree correspond to different integers.
Must be injective, and ideally fast. hash-consing keys is a good way to generate such unique identifiers.
Note that since Patricia Trees use unsigned order, negative keys are seen as bigger than positive keys. Be wary of this when using negative keys combined with functions like unsigned_max_binding and pop_unsigned_maximum.