123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169open!ImportincludeHash_set_intfincludeBase.Hash_setmoduletypeS_plain=S_plainwithtype'ahash_set:='atmoduletypeS=Swithtype'ahash_set:='atmoduletypeS_binable=S_binablewithtype'ahash_set:='atmoduletypeS_stable=S_stablewithtype'ahash_set:='atmoduletypeElt_plain=Hashtbl.Key_plainmoduletypeElt=Hashtbl.KeymoduletypeElt_binable=Hashtbl.Key_binablemoduletypeElt_stable=Hashtbl.Key_stablemoduleMake_plain_with_hashable(T:sigmoduleElt:Elt_plainvalhashable:Elt.tHashtbl.Hashable.tend)=structtypeelt=T.Elt.ttypenonrect=elttletequal=equalincludeCreators(structtype'at=T.Elt.tlethashable=T.hashableend)letsexp_of_tt=Poly.sexp_of_tT.Elt.sexp_of_ttmoduleProvide_of_sexp(X:sigtypet[@@derivingof_sexp]endwithtypet:=elt)=structlett_of_sexpsexp=t_of_sexpX.t_of_sexpsexpendmoduleProvide_bin_io(X:sigtypet[@@derivingbin_io]endwithtypet:=elt)=Bin_prot.Utils.Make_iterable_binable(structmoduleElt=structincludeT.EltincludeXendtypenonrect=ttypeel=Elt.t[@@derivingbin_io]let_=bin_elletcaller_identity=Bin_prot.Shape.Uuid.of_string"ad381672-4992-11e6-9e36-b76dc8cd466f";;letmodule_name=Some"Core.Hash_set"letlength=lengthletiter=iterletinit~len~next=lett=create~size:len()infor_i=0tolen-1doletv=next()inaddtvdone;t;;end)moduleProvide_stable_witness(X:sigtypet[@@derivingstable_witness]endwithtypet:=elt)=struct(* The binary representation of hash_set is used in the stable modules below, so it's
assumed to be stable (if the elt is stable) . *)letstable_witness:tStable_witness.t=let(_:eltStable_witness.t)=X.stable_witnessinStable_witness.assert_stable;;endendmoduleMake_with_hashable(T:sigmoduleElt:Eltvalhashable:Elt.tHashtbl.Hashable.tend)=structincludeMake_plain_with_hashable(T)includeProvide_of_sexp(T.Elt)endmoduleMake_binable_with_hashable(T:sigmoduleElt:Elt_binablevalhashable:Elt.tHashtbl.Hashable.tend)=structincludeMake_with_hashable(T)includeProvide_bin_io(T.Elt)endmoduleMake_stable_with_hashable(T:sigmoduleElt:Elt_stablevalhashable:Elt.tHashtbl.Hashable.tend)=structincludeMake_binable_with_hashable(T)includeProvide_stable_witness(T.Elt)endmoduleMake_plain(Elt:Elt_plain)=Make_plain_with_hashable(structmoduleElt=Eltlethashable=Hashtbl.Hashable.of_key(moduleElt)end)moduleMake(Elt:Elt)=structincludeMake_plain(Elt)includeProvide_of_sexp(Elt)endmoduleMake_binable(Elt:Elt_binable)=structincludeMake(Elt)includeProvide_bin_io(Elt)endmoduleMake_stable(Elt:Elt_stable)=structincludeMake_binable(Elt)includeProvide_stable_witness(Elt)endmoduleUsing_hashable=structtype'aelt='aletcreate?growth_allowed?size~hashable()=create?growth_allowed?size(Base.Hashable.to_keyhashable);;letof_list?growth_allowed?size~hashablel=of_list?growth_allowed?size(Base.Hashable.to_keyhashable)l;;endlethashable=Private.hashableletcreate?growth_allowed?sizem=create?growth_allowed?sizemletquickcheck_generator_m__t(typekey)(moduleKey:M_quickcheckwithtypet=key)=[%quickcheck.generator:Key.tList0.t]|>Quickcheck.Generator.map~f:(of_list(moduleKey));;letquickcheck_observer_m__t(typekey)(moduleKey:M_quickcheckwithtypet=key)=[%quickcheck.observer:Key.tList0.t]|>Quickcheck.Observer.unmap~f:to_list;;letquickcheck_shrinker_m__t(typekey)(moduleKey:M_quickcheckwithtypet=key)=[%quickcheck.shrinker:Key.tList0.t]|>Quickcheck.Shrinker.map~f:(of_list(moduleKey))~f_inverse:to_list;;