1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950moduletypeS=Set_intf.SmoduleMake(Elt:Comparable.S):Swithtypeelt=Elt.t=structmoduleM=MoreLabels.Set.Make(structtypet=Elt.tletcompareab=Ordering.to_int(Elt.compareab)end)includestruct[@@@warning"-32"](* [map] is only available since 4.04 *)letmap~ft=M.elementst|>List.map~f|>M.of_list(* Since 4.05 *)letto_optft=matchftwith|x->Somex|exceptionNot_found->Noneletchoose_opt=to_optM.chooseletmin_elt_opt=to_optM.min_eltletmax_elt_opt=to_optM.max_eltendincludeMletto_list=elementsletmemtx=memxtletaddtx=addxtletremovetx=removextletcompareab=Ordering.of_int(compareab)letis_subsett~of_=subsettof_letitert~f=itert~fletmapt~f=mapt~fletfoldt~init~f=foldt~init~fletfor_allt~f=for_allt~fletexistst~f=existst~fletfiltert~f=filtert~fletpartitiont~f=partitiont~fletmin_elt=min_elt_optletmax_elt=max_elt_optletchoose=choose_optletsplitxt=splittxendletto_sexpto_listft=Sexp.Encoder.listf(to_listt)