123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712(** This module is the toplevel of the Base library; it's what you get when you write
[open Base].
The goal of Base is both to be a more complete standard library, with richer APIs,
and to be more consistent in its design. For instance, in the standard library
some things have modules and others don't; in Base, everything is a module.
Base extends some modules and data structures from the standard library, like [Array],
[Buffer], [Bytes], [Char], [Hashtbl], [Int32], [Int64], [Lazy], [List], [Map],
[Nativeint], [Printf], [Random], [Set], [String], [Sys], and [Uchar]. One key
difference is that Base doesn't use exceptions as much as the standard library and
instead makes heavy use of the [Result] type, as in:
{[ type ('a,'b) result = Ok of 'a | Error of 'b ]}
Base also adds entirely new modules, most notably:
- [Comparable], [Comparator], and [Comparisons] in lieu of polymorphic compare.
- [Container], which provides a consistent interface across container-like data
structures (arrays, lists, strings).
- [Result], [Error], and [Or_error], supporting the or-error pattern.
*)(*_ We hide this from the web docs because the line wrapping is bad, making it
pretty much inscrutable. *)(**/**)(* The intent is to shadow all of INRIA's standard library. Modules below would cause
compilation errors without being removed from [Shadow_stdlib] before inclusion. *)include(Shadow_stdlib:moduletypeofstructincludeShadow_stdlibend(* Modules defined in Base *)withmoduleArray:=Shadow_stdlib.ArraywithmoduleAtomic:=Shadow_stdlib.AtomicwithmoduleBool:=Shadow_stdlib.BoolwithmoduleBuffer:=Shadow_stdlib.BufferwithmoduleBytes:=Shadow_stdlib.ByteswithmoduleChar:=Shadow_stdlib.CharwithmoduleCondition:=Shadow_stdlib.ConditionwithmoduleEither:=Shadow_stdlib.EitherwithmoduleFloat:=Shadow_stdlib.FloatwithmoduleHashtbl:=Shadow_stdlib.HashtblwithmoduleIn_channel:=Shadow_stdlib.In_channelwithmoduleInt:=Shadow_stdlib.IntwithmoduleInt32:=Shadow_stdlib.Int32withmoduleInt64:=Shadow_stdlib.Int64withmoduleLazy:=Shadow_stdlib.LazywithmoduleList:=Shadow_stdlib.ListwithmoduleMap:=Shadow_stdlib.MapwithmoduleNativeint:=Shadow_stdlib.NativeintwithmoduleOption:=Shadow_stdlib.OptionwithmoduleOut_channel:=Shadow_stdlib.Out_channelwithmodulePrintf:=Shadow_stdlib.PrintfwithmoduleQueue:=Shadow_stdlib.QueuewithmoduleRandom:=Shadow_stdlib.RandomwithmoduleResult:=Shadow_stdlib.ResultwithmoduleSet:=Shadow_stdlib.SetwithmoduleSemaphore:=Shadow_stdlib.SemaphorewithmoduleStack:=Shadow_stdlib.StackwithmoduleString:=Shadow_stdlib.StringwithmoduleSys:=Shadow_stdlib.SyswithmoduleUchar:=Shadow_stdlib.UcharwithmoduleUnit:=Shadow_stdlib.Unit(* OCaml 5-related modules we don't want to start shadowing yet. *)withmoduleDomain:=Shadow_stdlib.DomainwithmoduleType:=Shadow_stdlib.Type(* Support for generated lexers *)withmoduleLexing:=Shadow_stdlib.Lexingwithtype('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)format6withtype'aref:='aref)[@ocaml.warning"-3"](**/**)open!ImportmoduleApplicative=ApplicativemoduleArray=ArraymoduleAvltree=AvltreemoduleBacktrace=BacktracemoduleBinary_search=Binary_searchmoduleBinary_searchable=Binary_searchablemoduleBlit=BlitmoduleBool=BoolmoduleBuffer=BuffermoduleBytes=BytesmoduleChar=CharmoduleComparable=ComparablemoduleComparator=ComparatormoduleComparisons=ComparisonsmoduleContainer=ContainermoduleEither=EithermoduleEqual=EqualmoduleError=ErrormoduleExn=ExnmoduleField=FieldmoduleFloat=FloatmoduleFloatable=FloatablemoduleFn=FnmoduleFormatter=FormattermoduleHash=HashmoduleHash_set=Hash_setmoduleHashable=HashablemoduleHasher=HashermoduleHashtbl=HashtblmoduleIdentifiable=IdentifiablemoduleIndexed_container=Indexed_containermoduleInfo=InfomoduleInt=IntmoduleInt32=Int32moduleInt63=Int63moduleInt64=Int64moduleIntable=IntablemoduleInt_math=Int_mathmoduleInvariant=InvariantmoduleDictionary_immutable=Dictionary_immutablemoduleDictionary_mutable=Dictionary_mutablemoduleLazy=LazymoduleList=ListmoduleMap=MapmoduleMaybe_bound=Maybe_boundmoduleMonad=MonadmoduleNativeint=NativeintmoduleNothing=NothingmoduleOption=OptionmoduleOption_array=Option_arraymoduleOr_error=Or_errormoduleOrdered_collection_common=Ordered_collection_commonmoduleOrdering=OrderingmodulePoly=PolymodulePretty_printer=Pretty_printermodulePrintf=PrintfmoduleLinked_queue=Linked_queuemoduleQueue=QueuemoduleRandom=RandommoduleRef=RefmoduleResult=ResultmoduleSequence=SequencemoduleSet=SetmoduleSexpable=SexpablemoduleSign=SignmoduleSign_or_nan=Sign_or_nanmoduleSource_code_position=Source_code_positionmoduleStack=StackmoduleStaged=StagedmoduleString=StringmoduleStringable=StringablemoduleSys=SysmoduleT=TmoduleType_equal=Type_equalmoduleUniform_array=Uniform_arraymoduleUnit=UnitmoduleUchar=UcharmoduleVariant=VariantmoduleWith_return=With_returnmoduleWord_size=Word_size(* Avoid a level of indirection for uses of the signatures defined in [T]. *)includeT(* This is a hack so that odoc creates better documentation. *)moduleSexp=structincludeSexp_with_comparable(** @inline *)end(* [Int_string_conversions] is separated from [Int_conversions] for dependency reasons,
but this separation is not important for clients. *)moduleInt_conversions=structincludeInt_conversionsincludeInt_string_conversionsend(**/**)moduleExported_for_specific_uses=structmoduleFieldslib=FieldslibmoduleGlobalize=GlobalizemoduleObj_local=Obj_localmodulePpx_compare_lib=Ppx_compare_libmodulePpx_enumerate_lib=Ppx_enumerate_libmodulePpx_hash_lib=Ppx_hash_libmoduleVariantslib=Variantslibletam_testing=am_testingend(**/**)moduleExport=struct(* [deriving hash] is missing for [array] and [ref] since these types are mutable. *)type'aarray='aArray.t[@@deriving_inlinecompare~localize,equal~localize,globalize,sexp,sexp_grammar]letcompare_array__local:'a.('a->'a->int)->'aarray->'aarray->int=Array.compare__local;;letcompare_array:'a.('a->'a->int)->'aarray->'aarray->int=Array.compareletequal_array__local:'a.('a->'a->bool)->'aarray->'aarray->bool=Array.equal__local;;letequal_array:'a.('a->'a->bool)->'aarray->'aarray->bool=Array.equalletglobalize_array:'a.('a->'a)->'aarray->'aarray=fun(typea__017_):((a__017_->a__017_)->a__017_array->a__017_array)->Array.globalize;;letarray_of_sexp:'a.(Sexplib0.Sexp.t->'a)->Sexplib0.Sexp.t->'aarray=Array.t_of_sexp;;letsexp_of_array:'a.('a->Sexplib0.Sexp.t)->'aarray->Sexplib0.Sexp.t=Array.sexp_of_t;;letarray_sexp_grammar:'a.'aSexplib0.Sexp_grammar.t->'aarraySexplib0.Sexp_grammar.t=fun_'a_sexp_grammar->Array.t_sexp_grammar_'a_sexp_grammar;;[@@@end]typebool=Bool.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_bool__local=(Bool.compare__local:bool->bool->int)letcompare_bool=(funab->compare_bool__localab:bool->bool->int)letequal_bool__local=(Bool.equal__local:bool->bool->bool)letequal_bool=(funab->equal_bool__localab:bool->bool->bool)let(globalize_bool:bool->bool)=(Bool.globalize:bool->bool)let(hash_fold_bool:Ppx_hash_lib.Std.Hash.state->bool->Ppx_hash_lib.Std.Hash.state)=Bool.hash_fold_tand(hash_bool:bool->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Bool.hashinfunx->funcx;;letbool_of_sexp=(Bool.t_of_sexp:Sexplib0.Sexp.t->bool)letsexp_of_bool=(Bool.sexp_of_t:bool->Sexplib0.Sexp.t)let(bool_sexp_grammar:boolSexplib0.Sexp_grammar.t)=Bool.t_sexp_grammar[@@@end]typechar=Char.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_char__local=(Char.compare__local:char->char->int)letcompare_char=(funab->compare_char__localab:char->char->int)letequal_char__local=(Char.equal__local:char->char->bool)letequal_char=(funab->equal_char__localab:char->char->bool)let(globalize_char:char->char)=(Char.globalize:char->char)let(hash_fold_char:Ppx_hash_lib.Std.Hash.state->char->Ppx_hash_lib.Std.Hash.state)=Char.hash_fold_tand(hash_char:char->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Char.hashinfunx->funcx;;letchar_of_sexp=(Char.t_of_sexp:Sexplib0.Sexp.t->char)letsexp_of_char=(Char.sexp_of_t:char->Sexplib0.Sexp.t)let(char_sexp_grammar:charSexplib0.Sexp_grammar.t)=Char.t_sexp_grammar[@@@end]typeexn=Exn.t[@@deriving_inlinesexp_of]letsexp_of_exn=(Exn.sexp_of_t:exn->Sexplib0.Sexp.t)[@@@end]typefloat=Float.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_float__local=(Float.compare__local:float->float->int)letcompare_float=(funab->compare_float__localab:float->float->int)letequal_float__local=(Float.equal__local:float->float->bool)letequal_float=(funab->equal_float__localab:float->float->bool)let(globalize_float:float->float)=(Float.globalize:float->float)let(hash_fold_float:Ppx_hash_lib.Std.Hash.state->float->Ppx_hash_lib.Std.Hash.state)=Float.hash_fold_tand(hash_float:float->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Float.hashinfunx->funcx;;letfloat_of_sexp=(Float.t_of_sexp:Sexplib0.Sexp.t->float)letsexp_of_float=(Float.sexp_of_t:float->Sexplib0.Sexp.t)let(float_sexp_grammar:floatSexplib0.Sexp_grammar.t)=Float.t_sexp_grammar[@@@end]typeint=Int.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_int__local=(Int.compare__local:int->int->int)letcompare_int=(funab->compare_int__localab:int->int->int)letequal_int__local=(Int.equal__local:int->int->bool)letequal_int=(funab->equal_int__localab:int->int->bool)let(globalize_int:int->int)=(Int.globalize:int->int)let(hash_fold_int:Ppx_hash_lib.Std.Hash.state->int->Ppx_hash_lib.Std.Hash.state)=Int.hash_fold_tand(hash_int:int->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Int.hashinfunx->funcx;;letint_of_sexp=(Int.t_of_sexp:Sexplib0.Sexp.t->int)letsexp_of_int=(Int.sexp_of_t:int->Sexplib0.Sexp.t)let(int_sexp_grammar:intSexplib0.Sexp_grammar.t)=Int.t_sexp_grammar[@@@end]typeint32=Int32.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_int32__local=(Int32.compare__local:int32->int32->int)letcompare_int32=(funab->compare_int32__localab:int32->int32->int)letequal_int32__local=(Int32.equal__local:int32->int32->bool)letequal_int32=(funab->equal_int32__localab:int32->int32->bool)let(globalize_int32:int32->int32)=(Int32.globalize:int32->int32)let(hash_fold_int32:Ppx_hash_lib.Std.Hash.state->int32->Ppx_hash_lib.Std.Hash.state)=Int32.hash_fold_tand(hash_int32:int32->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Int32.hashinfunx->funcx;;letint32_of_sexp=(Int32.t_of_sexp:Sexplib0.Sexp.t->int32)letsexp_of_int32=(Int32.sexp_of_t:int32->Sexplib0.Sexp.t)let(int32_sexp_grammar:int32Sexplib0.Sexp_grammar.t)=Int32.t_sexp_grammar[@@@end]typeint64=Int64.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_int64__local=(Int64.compare__local:int64->int64->int)letcompare_int64=(funab->compare_int64__localab:int64->int64->int)letequal_int64__local=(Int64.equal__local:int64->int64->bool)letequal_int64=(funab->equal_int64__localab:int64->int64->bool)let(globalize_int64:int64->int64)=(Int64.globalize:int64->int64)let(hash_fold_int64:Ppx_hash_lib.Std.Hash.state->int64->Ppx_hash_lib.Std.Hash.state)=Int64.hash_fold_tand(hash_int64:int64->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Int64.hashinfunx->funcx;;letint64_of_sexp=(Int64.t_of_sexp:Sexplib0.Sexp.t->int64)letsexp_of_int64=(Int64.sexp_of_t:int64->Sexplib0.Sexp.t)let(int64_sexp_grammar:int64Sexplib0.Sexp_grammar.t)=Int64.t_sexp_grammar[@@@end]type'alist='aList.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_list__local:'a.('a->'a->int)->'alist->'alist->int=List.compare__local;;letcompare_list:'a.('a->'a->int)->'alist->'alist->int=List.compareletequal_list__local:'a.('a->'a->bool)->'alist->'alist->bool=List.equal__local;;letequal_list:'a.('a->'a->bool)->'alist->'alist->bool=List.equalletglobalize_list:'a.('a->'a)->'alist->'alist=fun(typea__078_):((a__078_->a__078_)->a__078_list->a__078_list)->List.globalize;;lethash_fold_list:'a.(Ppx_hash_lib.Std.Hash.state->'a->Ppx_hash_lib.Std.Hash.state)->Ppx_hash_lib.Std.Hash.state->'alist->Ppx_hash_lib.Std.Hash.state=List.hash_fold_t;;letlist_of_sexp:'a.(Sexplib0.Sexp.t->'a)->Sexplib0.Sexp.t->'alist=List.t_of_sexp;;letsexp_of_list:'a.('a->Sexplib0.Sexp.t)->'alist->Sexplib0.Sexp.t=List.sexp_of_t;;letlist_sexp_grammar:'a.'aSexplib0.Sexp_grammar.t->'alistSexplib0.Sexp_grammar.t=fun_'a_sexp_grammar->List.t_sexp_grammar_'a_sexp_grammar;;[@@@end]typenativeint=Nativeint.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_nativeint__local=(Nativeint.compare__local:nativeint->nativeint->int);;letcompare_nativeint=(funab->compare_nativeint__localab:nativeint->nativeint->int);;letequal_nativeint__local=(Nativeint.equal__local:nativeint->nativeint->bool)letequal_nativeint=(funab->equal_nativeint__localab:nativeint->nativeint->bool);;let(globalize_nativeint:nativeint->nativeint)=(Nativeint.globalize:nativeint->nativeint);;let(hash_fold_nativeint:Ppx_hash_lib.Std.Hash.state->nativeint->Ppx_hash_lib.Std.Hash.state)=Nativeint.hash_fold_tand(hash_nativeint:nativeint->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Nativeint.hashinfunx->funcx;;letnativeint_of_sexp=(Nativeint.t_of_sexp:Sexplib0.Sexp.t->nativeint)letsexp_of_nativeint=(Nativeint.sexp_of_t:nativeint->Sexplib0.Sexp.t)let(nativeint_sexp_grammar:nativeintSexplib0.Sexp_grammar.t)=Nativeint.t_sexp_grammar;;[@@@end]type'aoption='aOption.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_option__local:'a.('a->'a->int)->'aoption->'aoption->int=Option.compare__local;;letcompare_option:'a.('a->'a->int)->'aoption->'aoption->int=Option.compare;;letequal_option__local:'a.('a->'a->bool)->'aoption->'aoption->bool=Option.equal__local;;letequal_option:'a.('a->'a->bool)->'aoption->'aoption->bool=Option.equal;;letglobalize_option:'a.('a->'a)->'aoption->'aoption=fun(typea__109_):((a__109_->a__109_)->a__109_option->a__109_option)->Option.globalize;;lethash_fold_option:'a.(Ppx_hash_lib.Std.Hash.state->'a->Ppx_hash_lib.Std.Hash.state)->Ppx_hash_lib.Std.Hash.state->'aoption->Ppx_hash_lib.Std.Hash.state=Option.hash_fold_t;;letoption_of_sexp:'a.(Sexplib0.Sexp.t->'a)->Sexplib0.Sexp.t->'aoption=Option.t_of_sexp;;letsexp_of_option:'a.('a->Sexplib0.Sexp.t)->'aoption->Sexplib0.Sexp.t=Option.sexp_of_t;;letoption_sexp_grammar:'a.'aSexplib0.Sexp_grammar.t->'aoptionSexplib0.Sexp_grammar.t=fun_'a_sexp_grammar->Option.t_sexp_grammar_'a_sexp_grammar;;[@@@end]type'aref='aRef.t[@@deriving_inlinecompare~localize,equal~localize,globalize,sexp,sexp_grammar]letcompare_ref__local:'a.('a->'a->int)->'aref->'aref->int=Ref.compare__local;;letcompare_ref:'a.('a->'a->int)->'aref->'aref->int=Ref.compareletequal_ref__local:'a.('a->'a->bool)->'aref->'aref->bool=Ref.equal__local;;letequal_ref:'a.('a->'a->bool)->'aref->'aref->bool=Ref.equalletglobalize_ref:'a.('a->'a)->'aref->'aref=fun(typea__134_):((a__134_->a__134_)->a__134_ref->a__134_ref)->Ref.globalize;;letref_of_sexp:'a.(Sexplib0.Sexp.t->'a)->Sexplib0.Sexp.t->'aref=Ref.t_of_sexp;;letsexp_of_ref:'a.('a->Sexplib0.Sexp.t)->'aref->Sexplib0.Sexp.t=Ref.sexp_of_t;;letref_sexp_grammar:'a.'aSexplib0.Sexp_grammar.t->'arefSexplib0.Sexp_grammar.t=fun_'a_sexp_grammar->Ref.t_sexp_grammar_'a_sexp_grammar;;[@@@end]typestring=String.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_string__local=(String.compare__local:string->string->int)letcompare_string=(funab->compare_string__localab:string->string->int)letequal_string__local=(String.equal__local:string->string->bool)letequal_string=(funab->equal_string__localab:string->string->bool)let(globalize_string:string->string)=(String.globalize:string->string)let(hash_fold_string:Ppx_hash_lib.Std.Hash.state->string->Ppx_hash_lib.Std.Hash.state)=String.hash_fold_tand(hash_string:string->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=String.hashinfunx->funcx;;letstring_of_sexp=(String.t_of_sexp:Sexplib0.Sexp.t->string)letsexp_of_string=(String.sexp_of_t:string->Sexplib0.Sexp.t)let(string_sexp_grammar:stringSexplib0.Sexp_grammar.t)=String.t_sexp_grammar[@@@end]typebytes=Bytes.t[@@deriving_inlinecompare~localize,equal~localize,globalize,sexp,sexp_grammar]letcompare_bytes__local=(Bytes.compare__local:bytes->bytes->int)letcompare_bytes=(funab->compare_bytes__localab:bytes->bytes->int)letequal_bytes__local=(Bytes.equal__local:bytes->bytes->bool)letequal_bytes=(funab->equal_bytes__localab:bytes->bytes->bool)let(globalize_bytes:bytes->bytes)=(Bytes.globalize:bytes->bytes)letbytes_of_sexp=(Bytes.t_of_sexp:Sexplib0.Sexp.t->bytes)letsexp_of_bytes=(Bytes.sexp_of_t:bytes->Sexplib0.Sexp.t)let(bytes_sexp_grammar:bytesSexplib0.Sexp_grammar.t)=Bytes.t_sexp_grammar[@@@end]typeunit=Unit.t[@@deriving_inlinecompare~localize,equal~localize,globalize,hash,sexp,sexp_grammar]letcompare_unit__local=(Unit.compare__local:unit->unit->int)letcompare_unit=(funab->compare_unit__localab:unit->unit->int)letequal_unit__local=(Unit.equal__local:unit->unit->bool)letequal_unit=(funab->equal_unit__localab:unit->unit->bool)let(globalize_unit:unit->unit)=(Unit.globalize:unit->unit)let(hash_fold_unit:Ppx_hash_lib.Std.Hash.state->unit->Ppx_hash_lib.Std.Hash.state)=Unit.hash_fold_tand(hash_unit:unit->Ppx_hash_lib.Std.Hash.hash_value)=letfunc=Unit.hashinfunx->funcx;;letunit_of_sexp=(Unit.t_of_sexp:Sexplib0.Sexp.t->unit)letsexp_of_unit=(Unit.sexp_of_t:unit->Sexplib0.Sexp.t)let(unit_sexp_grammar:unitSexplib0.Sexp_grammar.t)=Unit.t_sexp_grammar[@@@end](** Format stuff *)typenonrec('a,'b,'c)format=('a,'b,'c)formattypenonrec('a,'b,'c,'d)format4=('a,'b,'c,'d)format4typenonrec('a,'b,'c,'d,'e,'f)format6=('a,'b,'c,'d,'e,'f)format6(** List operators *)includeList.Infix(** Int operators and comparisons *)includeInt.OincludeInt_replace_polymorphic_compare(** Float operators *)includeFloat.O_dot(* This is declared as an external to be optimized away in more contexts. *)(** Reverse application operator. [x |> g |> f] is equivalent to [f (g (x))]. *)external(|>):'a->(('a->'b)[@local_opt])->'b="%revapply"(** Application operator. [g @@ f @@ x] is equivalent to [g (f (x))]. *)external(@@):(('a->'b)[@local_opt])->'a->'b="%apply"(** Boolean operations *)(* These need to be declared as an external to get the lazy behavior *)external(&&):(bool[@local_opt])->(bool[@local_opt])->bool="%sequand"external(||):(bool[@local_opt])->(bool[@local_opt])->bool="%sequor"externalnot:(bool[@local_opt])->bool="%boolnot"(* This must be declared as an external for the warnings to work properly. *)externalignore:(_[@local_opt])->unit="%ignore"(** Common string operations *)let(^)=String.(^)(** Reference operations *)(* Declared as an externals so that the compiler skips the caml_modify when possible and
to keep reference unboxing working *)external(!):('aref[@local_opt])->'a="%field0"externalref:'a->('aref[@local_opt])="%makemutable"external(:=):('aref[@local_opt])->'a->unit="%setfield0"(** Pair operations *)letfst=fstletsnd=snd(** Exceptions stuff *)(* Declared as an external so that the compiler may rewrite '%raise' as '%reraise'. *)externalraise:exn->_="%raise"letfailwith=failwithletinvalid_arg=invalid_argletraise_s=Error.raise_s(** Misc *)externalphys_equal:('a[@local_opt])->('a[@local_opt])->bool="%eq"externalforce:('aLazy.t[@local_opt])->'a="%lazy_force"endincludeExportincludeContainer_intf.Export(** @inline *)exceptionNot_found_s=Not_found_s(* We perform these side effects here because we want them to run for any code that uses
[Base]. If this were in another module in [Base] that was not used in some program,
then the side effects might not be run in that program. This will run as long as the
program refers to at least one value directly in [Base]; referring to values in
[Base.Bool], for example, is not sufficient. *)let()=Backtrace.initialize_module()moduleCaml=structend[@@deprecated"[since 2023-01] use Stdlib instead of Caml"]