The implementation uses get on the key and then calls Digest.string on the data. get will return Error `Value_expected if the key is a dictionary.
(** [digest t k] is the unique digest of the value bound to [k] in
[t].
When the value bound to [k] is a dictionary, the digest is a
unique and deterministic digest of its entries. *)
This suggests we need to compute a digest recursively from the children of the dictionary. I don't like this much. It is good however to document the divergence from the interface.
The implementation uses
get
on the key and then callsDigest.string
on the data.get
will returnError `Value_expected
if the key is a dictionary.https://github.com/mirage/mirage-kv/blob/main/src/mirage_kv.mli#L167-L172
This suggests we need to compute a digest recursively from the children of the dictionary. I don't like this much. It is good however to document the divergence from the interface.