123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262(* This module is included in [Import]. It is aimed at modules that define the standard
combinators for [sexp_of], [of_sexp], [compare] and [hash] and are included in
[Import]. *)include(Shadow_stdlib:moduletypeofstructincludeShadow_stdlibendwithtype('a:value_or_null)ref:='arefwithtype('a,'b,'c)format:=('a,'b,'c)formatwithtype('a,'b,'c,'d)format4:=('a,'b,'c,'d)format4withtype('a,'b,'c,'d,'e,'f)format6:=('a,'b,'c,'d,'e,'f)format6(* These modules are redefined in Base *)withmoduleArray:=Shadow_stdlib.ArraywithmoduleAtomic:=Shadow_stdlib.AtomicwithmoduleBool:=Shadow_stdlib.BoolwithmoduleBuffer:=Shadow_stdlib.BufferwithmoduleBytes:=Shadow_stdlib.ByteswithmoduleChar:=Shadow_stdlib.CharwithmoduleEither:=Shadow_stdlib.EitherwithmoduleFloat:=Shadow_stdlib.FloatwithmoduleHashtbl:=Shadow_stdlib.HashtblwithmoduleInt:=Shadow_stdlib.IntwithmoduleInt32:=Shadow_stdlib.Int32withmoduleInt64:=Shadow_stdlib.Int64withmoduleLazy:=Shadow_stdlib.LazywithmoduleList:=Shadow_stdlib.ListwithmoduleMap:=Shadow_stdlib.MapwithmoduleModes:=Shadow_stdlib.ModeswithmoduleNativeint:=Shadow_stdlib.NativeintwithmoduleObj:=Shadow_stdlib.ObjwithmoduleOption:=Shadow_stdlib.OptionwithmodulePrintf:=Shadow_stdlib.PrintfwithmoduleQueue:=Shadow_stdlib.QueuewithmoduleRandom:=Shadow_stdlib.RandomwithmoduleResult:=Shadow_stdlib.ResultwithmoduleSet:=Shadow_stdlib.SetwithmoduleStack:=Shadow_stdlib.StackwithmoduleString:=Shadow_stdlib.StringwithmoduleSys:=Shadow_stdlib.SyswithmoduleUchar:=Shadow_stdlib.UcharwithmoduleUnit:=Shadow_stdlib.Unit)[@ocaml.warning"-3"]type('a:value_or_null)ref='aStdlib.ref={mutablecontents:'a}type('a:anymodseparable)iarray='aBasement.Stdlib_iarray_labels.tincludeBasement.Or_null_shim.ExportmoduleStdlib=structincludeStdlib(* Reshuffle [Stdlib] so that we choose the modules using labels when available. *)includeStdlib.StdLabelsincludeStdlib.MoreLabels(* Shadow unsafe [Stdlib] functions with their safe versions from
[Basement.Stdlib_shim]. *)moduleAtomic=structincludeStdlib.AtomicincludeBasement.Stdlib_shim.AtomicincludeBasement.Stdlib_shim.Atomic.LocalendmoduleDomain=structincludeStdlib.DomainincludeBasement.Stdlib_shim.Domain.SafeendmoduleFormat=structincludeStdlib.FormatincludeBasement.Stdlib_shim.Format.SafeendmoduleObj=structincludeStdlib.ObjincludeBasement.Stdlib_shim.ObjmoduleExtension_constructor=structincludeStdlib.Obj.Extension_constructorincludeBasement.Stdlib_shim.Obj.Extension_constructorendendmodulePrintexc=structincludeStdlib.PrintexcincludeBasement.Stdlib_shim.Printexc.SafeendendmodulePortability_hacks=Basement.Portability_hacksexternal(|>):'a->(('a->'b)[@local_opt])->'b@@portable="%revapply"(* These need to be declared as an external to get the lazy behavior *)external(&&):(bool[@local_opt])->(bool[@local_opt])->bool@@portable="%sequand"external(||):(bool[@local_opt])->(bool[@local_opt])->bool@@portable="%sequor"externalnot:(bool[@local_opt])->bool@@portable="%boolnot"(* We use a binding to [%identity] here because [Obj.magic] is an optimization barrier. *)externalbool_to_int:bool->int@@portable="%identity"(* This needs to be declared as an external for the warnings to work properly *)externalignore:_->unit@@portable="%ignore"externalignore_contended:_@contended->unit@@portable="%ignore"let(!=)=Stdlib.(!=)let(*)=Stdlib.(*)external(**):(float[@local_opt])->(float[@local_opt])->float@@portable="caml_power_float""pow"[@@unboxed][@@noalloc]external(*.):(float[@local_opt])->(float[@local_opt])->(float[@local_opt])@@portable="%mulfloat"let(+)=Stdlib.(+)external(+.):(float[@local_opt])->(float[@local_opt])->(float[@local_opt])@@portable="%addfloat"let(-)=Stdlib.(-)external(-.):(float[@local_opt])->(float[@local_opt])->(float[@local_opt])@@portable="%subfloat"let(/)=Stdlib.(/)external(/.):(float[@local_opt])->(float[@local_opt])->(float[@local_opt])@@portable="%divfloat"moduleHash=Ppx_hash_lib.Std.HashmodulePoly=Poly0(** @canonical Base.Poly *)includeReplace_polymorphic_compareincludeInt_replace_polymorphic_compare(* This needs to be defined as an external so that the compiler can specialize it as a
direct set or caml_modify. *)external(:=):('a:value_or_null).('aref[@local_opt])->'a->unit@@portable="%setfield0"(* These need to be defined as an external otherwise the compiler won't unbox references. *)external(!):('a:value_or_null).('aref[@local_opt])->'a@@portable="%field0"externalref:('a:value_or_null).'a->('aref[@local_opt])@@portable="%makemutable"let(@)=Stdlib.(@)let(^)=Stdlib.(^)let(~-)=Stdlib.(~-)external(.:()):('aiarray[@local_opt])->int->('a[@local_opt])@@portable="%array_safe_get"external(~-.):(float[@local_opt])->(float[@local_opt])@@portable="%negfloat"let(asr)=Stdlib.(asr)external(land):local_int->local_int->int@@portable="%andint"letlnot=Stdlib.lnotlet(lor)=Stdlib.(lor)let(lsl)=Stdlib.(lsl)let(lsr)=Stdlib.(lsr)let(lxor)=Stdlib.(lxor)let(mod)=Stdlib.(mod)letabs=Stdlib.absletfailwith=Stdlib.failwithletinvalid_arg=Stdlib.invalid_argexternalfst:('a:value_or_null)('b:value_or_null).('a*'b[@local_opt])->('a[@local_opt])@@portable="%field0_immut"externalsnd:('a:value_or_null)('b:value_or_null).('a*'b[@local_opt])->('b[@local_opt])@@portable="%field1_immut"(* [raise] needs to be defined as an external as the compiler automatically replaces
'%raise' by '%reraise' when appropriate. *)external%templateraise:('a:value_or_null).exn->'a@portableunique@@portable="%reraise"[%%template[@@@kindkr1=(value&value)][@@@kindkr2=(value&value&value)][@@@kindkr3=(value&value&value&value)]letraise:('a:k).(exn->'a@portableunique)@portable=funexn->match(raiseexn:Nothing0.t)with|_->.[@@kindk=(base_non_value,value_or_null&(base_or_null,kr1,kr2,kr3),bits32&bits32)];;]externalphys_equal:('a:value_or_null).('a[@local_opt])->('a[@local_opt])->bool@@portable="%eq"externaldecr:(intref[@local_opt])->unit@@portable="%decr"externalincr:(intref[@local_opt])->unit@@portable="%incr"(* Used by sexp_conv, which float0 depends on through option. *)letfloat_of_string=Stdlib.float_of_string(* [am_testing] is used in a few places to behave differently when in testing mode, such
as in [random.ml]. [am_testing] is implemented using [Base_am_testing], a weak C/js
primitive that returns [false], but when linking an inline-test-runner executable, is
overridden by another primitive that returns [true]. *)externalam_testing:unit->bool@@portable="Base_am_testing"letam_testing=am_testing()