12345678910111213141516171819202122232425262728293031323334353637(** Universal maps *)moduletypeKey=sigtype'attype'ainfovalcreate:'ainfo->'atendmoduletypeS=sig(** A universal map is a map that can store values for arbitrary keys. It is
the the key that conveys the type of the data associated to it. *)typetmoduleKey:sigtype'attype'ainfoendvalempty:tvalis_empty:t->boolvalmem:t->'aKey.t->boolvalset:t->'aKey.t->'a->tvaladd:t->'aKey.t->'a->(t,'a)Result.tvalupdate:t->'aKey.t->f:('aoption->'aoption)->tvalremove:t->'aKey.t->tvalfind:t->'aKey.t->'aoptionvalfind_exn:t->'aKey.t->'avalsingleton:'aKey.t->'a->t(** [superpose a b] is [a] augmented with bindings of [b] that are not in [a]. *)valsuperpose:t->t->ttype'accfold={fold:'a.'aKey.info->'a->'acc->'acc}valfold:t->init:'acc->f:'accfold->'accend