1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduletypeS=sigtypet[@@derivingirmin](** The type for keys. *)typehashvalto_hash:t->hashendmoduletypeHash_like=sigincludeSvalof_hash:hash->tendmoduleStore_spec=structmoduletypeS=sigtype('h,'v)contents_keytype'hnode_keytype'hcommit_keyendmoduletypeHash_keyed=Swithtype('h,_)contents_key='handtype'hnode_key='handtype'hcommit_key='hmodulerecHash_keyed:Hash_keyed=Hash_keyedendmoduletypeSigs=sigmoduletypeS=SmoduletypeHash_like=Hash_like(** The simplest possible [Key] implementation is just a hash of the
corresponding value, attaching no additional metadata about the value. *)moduleOf_hash(H:Type.S):Hash_likewithtypet=H.tandtypehash=H.tmoduleStore_spec:sigmoduletypeS=Store_spec.SmoduletypeHash_keyed=Store_spec.Hash_keyedmoduleHash_keyed:Hash_keyedendend