# FreeBSD Manual Pages

Weak.Make(3) OCamldoc Weak.Make(3)NAMEWeak.Make - Functor building an implementation of the weak hash set structure.ModuleModule Weak.MakeDocumentationModuleMake:functor(H:Hashtbl.HashedType)->sigendFunctor building an implementation of the weak hash set structure.H.equalcan't be the physical equality, since only shallow copies of the elements in the set are given to it.Parameters:"H"Hashtbl.HashedTypetypedataThe type of the elements stored in the table.typetThe type of tables that contain elements of typedata. Note that weak hash sets cannot be marshaled usingPervasives.output_valueor the functions of theMarshalmodule.valcreate:int->tcreatencreates a new empty weak hash set, of initial sizen. The table will grow as needed.valclear:t->unitRemove all elements from the table.valmerge:t->data->datamergetxreturns an instance ofxfound intif any, or else addsxtotand returnx.valadd:t->data->unitaddtxaddsxtot. If there is already an instance ofxint, it is unspecified which one will be returned by subsequent calls tofindandmerge.valremove:t->data->unitremovetxremoves fromtone instance ofx. Does nothing if there is no instance ofxint.valfind:t->data->datafindtxreturns an instance ofxfound int. RaiseNot_foundif there is no such element.valfind_opt:t->data->dataoptionfind_opttxreturns an instance ofxfound intorNoneif there is no such element.Since4.05valfind_all:t->data->datalistfind_alltxreturns a list of all the instances ofxfound int.valmem:t->data->boolmemtxreturnstrueif there is at least one instance ofxint, false otherwise.valiter:(data->unit)->t->unititerftcallsfon each element oft, in some unspecified order. It is not specified what happens ifftries to changetitself.valfold:(data->'a->'a)->t->'a->'afoldftinitcomputes(fd1(...(fdNinit)))whered1...dNare the elements oftin some unspecified order. It is not specified what hap- pens ifftries to changetitself.valcount:t->intCount the number of elements in the table.counttgives the same re- sult asfold(fun_n->n+1)t0but does not delay the deallocation of the dead elements.valstats:t->int*int*int*int*int*intReturn statistics on the table. The numbers are, in order: table length, number of entries, sum of bucket lengths, smallest bucket length, median bucket length, biggest bucket length. 2020-08-11 source: Weak.Make(3)

NAME | Module | Documentation

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=Weak.Make&sektion=3o&manpath=FreeBSD+12.2-RELEASE+and+Ports>