1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980(*
* Copyright (c) 2021 Tarides <contact@tarides.com>
* Copyright (c) 2021 Gabriel Belouze <gabriel.belouze@ens.psl.eu>
*
* 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=sigtypettypekeytypevaluetypestoretypeaddressvalinit:store->address->tvalcreate:store->t(* like init but allocates a new page *)valload:store->address->tvalself_address:t->addressvaloverflow:t->boolvalwill_overflow:t->boolvalunderflow:t->boolvalsplit:t->key*t(** [split leaf] allocates a new leaf to split to, splits [leaf], promotes the middle key, and
returns [promoted, allocated] *)valmerge:t->t->[`Partial|`Total]valfind:t->key->valuevalleftmost:t->keyvalmem:t->key->boolvaladd:t->key->value->unitvalremove:t->key->unitvaliter:t->(key->value->unit)->unitvallength:t->int(** [length t] is the number of bindings in [t] *)valmigrate:stringlist->stringvalpp:tFmt.tendmoduletypeMAKER=functor(Params:Params.S)(Store:Store.S)(Key:Data.K)(Value:Data.V)->Swithtypevalue=Value.tandtypekey=Key.tandtypestore=Store.tandtypeaddress=Store.addressmoduletypeLeaf=sigmoduletypeS=SmoduleMake:MAKERend