Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file hash_set_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221open!ImportmoduleKey=Hashtbl_intf.KeymoduletypeAccessors=sigincludeContainer.Generic(** override [Container.Generic.mem] *)valmem:'at->'a->bool(** preserves the equality function *)valcopy:'at->'atvaladd:'at->'a->unit(** [strict_add t x] returns [Ok ()] if the [x] was not in [t], or an [Error] if it
was. *)valstrict_add:'at->'a->unitOr_error.tvalstrict_add_exn:'at->'a->unitvalremove:'at->'a->unit(** [strict_remove t x] returns [Ok ()] if the [x] was in [t], or an [Error] if it
was not. *)valstrict_remove:'at->'a->unitOr_error.tvalstrict_remove_exn:'at->'a->unitvalclear:'at->unitvalequal:'at->'at->boolvalfilter:'at->f:('a->bool)->'atvalfilter_inplace:'at->f:('a->bool)->unit(** [inter t1 t2] computes the set intersection of [t1] and [t2]. Runs in O(min(length
t1, length t2)). Behavior is undefined if [t1] and [t2] don't have the same
equality function. *)valinter:'keyt->'keyt->'keytvalunion:'at->'at->'atvaldiff:'at->'at->'atvalof_hashtbl_keys:('a,_)Hashtbl.t->'atvalto_hashtbl:'keyt->f:('key->'data)->('key,'data)Hashtbl.tendtype('key,'z)create_options=('key,unit,'z)Hashtbl_intf.create_optionstype('key,'z)create_options_without_first_class_module=('key,unit,'z)Hashtbl_intf.create_options_without_first_class_modulemoduletypeCreators=sigtype'atvalcreate:?growth_allowed:bool(** defaults to [true] *)->?size:int(** initial size -- default 0 *)->'aKey.t->'atvalof_list:?growth_allowed:bool(** defaults to [true] *)->?size:int(** initial size -- default 0 *)->'aKey.t->'alist->'atendmoduletypeCreators_generic=sigtype'attype'aelttype('a,'z)create_optionsvalcreate:('a,unit->'at)create_optionsvalof_list:('a,'aeltlist->'at)create_optionsendmoduleCheck=structmoduleMake_creators_check(Type:T.T1)(Elt:T.T1)(Options:T.T2)(M:Creators_genericwithtype'at:='aType.twithtype'aelt:='aElt.twithtype('a,'z)create_options:=('a,'z)Options.t)=structendmoduleCheck_creators_is_specialization_of_creators_generic(M:Creators)=Make_creators_check(structtype'at='aM.tend)(structtype'at='aend)(structtype('a,'z)t=('a,'z)create_optionsend)(structincludeMletcreate?growth_allowed?sizem()=create?growth_allowed?sizemend)endmoduletypeHash_set=sigtype'at[@@deriving_inlinesexp_of]includesig[@@@ocaml.warning"-32"]valsexp_of_t:('a->Ppx_sexp_conv_lib.Sexp.t)->'at->Ppx_sexp_conv_lib.Sexp.tend[@@ocaml.doc"@inline"][@@@end](** We use [[@@deriving_inline sexp_of][@@@end]] but not [[@@deriving sexp]] because we want people to be
explicit about the hash and comparison functions used when creating hashtables. One
can use [Hash_set.Poly.t], which does have [[@@deriving_inline sexp][@@@end]], to use polymorphic
comparison and hashing. *)moduleKey=KeymoduletypeCreators=CreatorsmoduletypeCreators_generic=Creators_generictypenonrec('key,'z)create_options=('key,'z)create_optionsincludeCreatorswithtype'at:='at(** @open *)moduletypeAccessors=AccessorsincludeAccessorswithtype'at:='atwithtype'aelt='a(** @open *)valhashable_s:'keyt->'keyKey.ttypenonrec('key,'z)create_options_without_first_class_module=('key,'z)create_options_without_first_class_module(** A hash set that uses polymorphic comparison *)modulePoly:sigtypenonrec'at='at[@@deriving_inlinesexp]includesig[@@@ocaml.warning"-32"]includePpx_sexp_conv_lib.Sexpable.S1withtype'at:='atend[@@ocaml.doc"@inline"][@@@end]includeCreators_genericwithtype'at:='atwithtype'aelt='awithtype('key,'z)create_options:=('key,'z)create_options_without_first_class_moduleincludeAccessorswithtype'at:='atwithtype'aelt:='aeltend(** [M] is meant to be used in combination with OCaml applicative functor types:
{[
type string_hash_set = Hash_set.M(String).t
]}
which stands for:
{[
type string_hash_set = (String.t, int) Hash_set.t
]}
The point is that [Hash_set.M(String).t] supports deriving, whereas the second
syntax doesn't (because [t_of_sexp] doesn't know what comparison/hash function to
use). *)moduleM(Elt:T.T):sigtypenonrect=Elt.ttendmoduletypeSexp_of_m=sigtypet[@@deriving_inlinesexp_of]includesig[@@@ocaml.warning"-32"]valsexp_of_t:t->Ppx_sexp_conv_lib.Sexp.tend[@@ocaml.doc"@inline"][@@@end]endmoduletypeM_of_sexp=sigtypet[@@deriving_inlineof_sexp]includesig[@@@ocaml.warning"-32"]valt_of_sexp:Ppx_sexp_conv_lib.Sexp.t->tend[@@ocaml.doc"@inline"][@@@end]includeHashtbl_intf.Key.Swithtypet:=tendvalsexp_of_m__t:(moduleSexp_of_mwithtypet='elt)->'eltt->Sexp.tvalm__t_of_sexp:(moduleM_of_sexpwithtypet='elt)->Sexp.t->'elttmoduleCreators(Elt:sigtype'atvalhashable:'atHashable.tend):sigtype'at_='aElt.ttvalt_of_sexp:(Sexp.t->'aElt.t)->Sexp.t->'at_includeCreators_genericwithtype'at:='at_withtype'aelt:='aElt.twithtype('elt,'z)create_options:=('elt,'z)create_options_without_first_class_moduleend(**/**)(*_ See the Jane Street Style Guide for an explanation of [Private] submodules:
https://opensource.janestreet.com/standards/#private-submodules *)modulePrivate:sigvalhashable:'at->'aHashable.tendend