123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386(** A set of migration annotations to convert code using the Stdlib to Base, intended to
be used this way:
{v ocamlmig run -extra-migrations ocamlmig.stdlib_to_base v}
This should have decent coverage, but note that it only works for functions operating
on the same datatypes in both libs. So for instance, [String] functions can be
converted, but [Queue] functions cannot, because the queue types are not identical. *)openstruct(* toplevel of Stdlib should be fully converted *)let_=raise[@migrate{repl=Base.raise}]let_=raise_notrace[@migrate{repl=Base.Exn.raise_without_backtrace}]let_=invalid_arg[@migrate{repl=Base.invalid_arg}]let_=failwith[@migrate{repl=Base.failwith}](* can't do anything about the exception Exit, Match_failure, etc *)let_=(=)[@migrate{repl=(function|[%context:int->_]->Base.(=)|[%context:string->_]->Base.String.(=)|[%context:char->_]->Base.Char.(=)|_->Base.Poly.(=))}]let_=(<>)[@migrate{repl=(function|[%context:int->_]->Base.(<>)|[%context:string->_]->Base.String.(<>)|[%context:char->_]->Base.Char.(<>)|_->Base.Poly.(<>))}]let_=(>)[@migrate{repl=(function|[%context:int->_]->Base.(>)|[%context:string->_]->Base.String.(>)|[%context:char->_]->Base.Char.(>)|_->Base.Poly.(>))}]let_=(>=)[@migrate{repl=(function|[%context:int->_]->Base.(>=)|[%context:string->_]->Base.String.(>=)|[%context:char->_]->Base.Char.(>=)|_->Base.Poly.(>=))}]let_=(<)[@migrate{repl=(function|[%context:int->_]->Base.(<)|[%context:string->_]->Base.String.(<)|[%context:char->_]->Base.Char.(<)|_->Base.Poly.(<))}]let_=(<=)[@migrate{repl=(function|[%context:int->_]->Base.(<=)|[%context:string->_]->Base.String.(<=)|[%context:char->_]->Base.Char.(<=)|_->Base.Poly.(<=))}]let_=compare[@migrate{repl=(function|[%context:int->_]->Base.compare|[%context:string->_]->Base.String.compare|[%context:char->_]->Base.Char.compare|_->Base.Poly.compare)}]let_=min[@migrate{repl=(function|[%context:int->_]->Base.min|[%context:string->_]->Base.String.min|[%context:char->_]->Base.Char.min|_->Base.Poly.min)}]let_=max[@migrate{repl=(function|[%context:int->_]->Base.max|[%context:string->_]->Base.String.max|[%context:char->_]->Base.Char.max|_->Base.Poly.max)}]let_=(==)[@migrate{repl=Base.phys_equal}]let_=(!=)[@migrate{repl=(funab->Base.not(Base.phys_equalab))}]let_=not[@migrate{repl=Base.not}]let_=(&&)[@migrate{repl=Base.(&&)}]let_=(||)[@migrate{repl=Base.(||)}](* no equivalent for __LOC__ etc *)let_=(|>)[@migrate{repl=Base.(|>)}]let_=(@@)[@migrate{repl=Base.(@@)}]let_=(~-)[@migrate{repl=Base.(~-)}]let_=succ[@migrate{repl=Base.Int.succ}]let_=pred[@migrate{repl=Base.Int.pred}]let_=(+)[@migrate{repl=Base.(+)}]let_=(-)[@migrate{repl=Base.(-)}]let_=(*)[@migrate{repl=Base.(*)}]let_=(/)[@migrate{repl=Base.(/)}]let_=(mod)[@migrate{repl=Base.Int.rem}](* This is exposed as Core.(mod) but not Base.(mod). Base.(%) is slighly different *)let_=abs[@migrate{repl=Base.abs}]let_=max_int[@migrate{repl=Base.Int.max_value}]let_=min_int[@migrate{repl=Base.Int.min_value}]let_=(land)[@migrate{repl=Base.(land)}]let_=(lor)[@migrate{repl=Base.(lor)}]let_=(lxor)[@migrate{repl=Base.(lxor)}]let_=lnot[@migrate{repl=Base.lnot}]let_=(lsl)[@migrate{repl=Base.(lsl)}]let_=(lsr)[@migrate{repl=Base.(lsr)}]let_=(asr)[@migrate{repl=Base.(asr)}]let_=(~-.)[@migrate{repl=Base.(~-.)}]let_=(+.)[@migrate{repl=Base.(+.)}]let_=(-.)[@migrate{repl=Base.(-.)}]let_=(*.)[@migrate{repl=Base.(*.)}]let_=(/.)[@migrate{repl=Base.(/.)}]let_=(**)[@migrate{repl=Base.(**.)}]let_=sqrt[@migrate{repl=Base.Float.sqrt}]let_=exp[@migrate{repl=Base.Float.exp}]let_=log[@migrate{repl=Base.Float.log}]let_=log10[@migrate{repl=Base.Float.log10}]let_=expm1[@migrate{repl=Base.Float.expm1}]let_=log1p[@migrate{repl=Base.Float.log1p}]let_=cos[@migrate{repl=Base.Float.cos}]let_=sin[@migrate{repl=Base.Float.sin}]let_=tan[@migrate{repl=Base.Float.tan}]let_=acos[@migrate{repl=Base.Float.acos}]let_=asin[@migrate{repl=Base.Float.asin}]let_=atan[@migrate{repl=Base.Float.atan}]let_=atan2[@migrate{repl=Base.Float.atan2}]let_=hypot[@migrate{repl=Base.Float.hypot}]let_=cosh[@migrate{repl=Base.Float.cosh}]let_=sinh[@migrate{repl=Base.Float.sinh}]let_=tanh[@migrate{repl=Base.Float.tanh}]let_=acosh[@migrate{repl=Base.Float.acosh}]let_=asinh[@migrate{repl=Base.Float.asinh}]let_=atanh[@migrate{repl=Base.Float.atanh}]let_=ceil[@migrate{repl=Base.Float.round_up}]let_=floor[@migrate{repl=Base.Float.round_down}]let_=abs_float[@migrate{repl=Base.Float.abs}]let_=copysign[@migrate{repl=Base.Float.copysign}]let_=mod_float[@migrate{repl=Base.Float.mod_float}]let_=frexp[@migrate{repl=Base.Float.frexp}]let_=ldexp[@migrate{repl=Base.Float.ldexp}](* let _ = modf [@migrate { repl = Base.Float.modf }] involves a different type *)let_=float[@migrate{repl=Base.Float.of_int}]let_=float_of_int[@migrate{repl=Base.Float.of_int}]let_=truncate[@migrate{repl=Base.Int.of_float}]let_=int_of_float[@migrate{repl=Base.Int.of_float}]let_=infinity[@migrate{repl=Base.Float.infinity}]let_=neg_infinity[@migrate{repl=Base.Float.neg_infinity}]let_=nan[@migrate{repl=Base.Float.nan}]let_=max_float[@migrate{repl=Base.Float.max_finite_value}]let_=min_float[@migrate{repl=Base.Float.min_positive_normal_value}]let_=epsilon_float[@migrate{repl=Base.Float.epsilon_float}](* let _ = classify_float [@migrate { repl = Base.Float.classify }] involves a different type *)let_=(^)[@migrate{repl=Base.(^)}]let_=int_of_char[@migrate{repl=Base.Char.to_int}]let_=char_of_int[@migrate{repl=Base.Char.of_int_exn}]let_=ignore[@migrate{repl=Base.ignore}]let_=string_of_bool[@migrate{repl=Base.Bool.to_string}]let_=bool_of_string[@migrate{repl=Base.Bool.of_string}](* no equivalent of bool_of_string_opt *)let_=string_of_int[@migrate{repl=Base.Int.to_string}]let_=int_of_string[@migrate{repl=Base.Int.of_string}](* no equivalent of int_of_string_opt *)let_=string_of_float[@migrate{repl=Base.Float.to_string}]let_=float_of_string[@migrate{repl=Base.Float.of_string}](* no equivalent of float_of_string_opt *)let_=fst[@migrate{repl=Base.fst}]let_=snd[@migrate{repl=Base.snd}]let_=(@)[@migrate{repl=Base.(@)}](* Stdio exposes stdin at toplevel, but Core deprecates it :/ *)let_=stdin[@migrate{repl=Stdio.In_channel.stdin;libraries=["stdio"]}]let_=stdout[@migrate{repl=Stdio.Out_channel.stdout;libraries=["stdio"]}]let_=stderr[@migrate{repl=Stdio.Out_channel.stderr;libraries=["stdio"]}]let_=print_char[@migrate{repl=(func->Stdio.Out_channel.output_charStdio.Out_channel.stdoutc);libraries=["stdio"]}]let_=print_string[@migrate{repl=Stdio.print_string;libraries=["stdio"]}]let_=print_bytes[@migrate{repl=(funb->Stdio.Out_channel.output_bytesStdio.Out_channel.stdoutb);libraries=["stdio"]}]let_=print_int[@migrate{repl=(funn->Stdio.print_string(Base.Int.to_stringn));libraries=["stdio"]}]let_=print_float[@migrate{repl=(funf->Stdio.print_string(Base.Float.to_stringf));libraries=["stdio"]}]let_=print_endline[@migrate{repl=Stdio.print_endline;libraries=["stdio"]}]let_=print_newline[@migrate{repl=(fun()->Stdio.print_endline"");libraries=["stdio"]}]let_=prerr_char[@migrate{repl=(func->Stdio.Out_channel.output_charStdio.Out_channel.stderrc);libraries=["stdio"]}]let_=prerr_string[@migrate{repl=(funs->Stdio.Out_channel.output_stringStdio.Out_channel.stderrs);libraries=["stdio"]}]let_=prerr_bytes[@migrate{repl=(funb->Stdio.Out_channel.output_bytesStdio.Out_channel.stderrb);libraries=["stdio"]}]let_=prerr_int[@migrate{repl=(funn->Stdio.Out_channel.output_stringStdio.Out_channel.stderr(Base.Int.to_stringn));libraries=["stdio"]}]let_=prerr_float[@migrate{repl=(funf->Stdio.Out_channel.output_stringStdio.Out_channel.stderr(Base.Float.to_stringf));libraries=["stdio"]}]let_=prerr_endline[@migrate{repl=Stdio.prerr_endline;libraries=["stdio"]}]let_=prerr_newline[@migrate{repl=(fun()->Stdio.prerr_endline"");libraries=["stdio"]}]let_=read_line[@migrate{repl=(fun()->Stdio.In_channel.input_line_exnStdio.In_channel.stdin~fix_win_eol:false);libraries=["stdio"]}](* Ignoring read_int_opt read_int read_float_opt read_float, which seem like
exceedingly rare functions *)let_=open_out[@migrate{repl=Stdio.Out_channel.create~binary:false;libraries=["stdio"]}]let_=open_out_bin[@migrate{repl=Stdio.Out_channel.create;libraries=["stdio"]}](* no equivalent of open_out_gen *)let_=flush[@migrate{repl=Stdio.Out_channel.flush;libraries=["stdio"]}](* probably no equivalent for flush_all *)let_=output_char[@migrate{repl=Stdio.Out_channel.output_char;libraries=["stdio"]}]let_=output_string[@migrate{repl=Stdio.Out_channel.output_string;libraries=["stdio"]}]let_=output_bytes[@migrate{repl=Stdio.Out_channel.output_bytes;libraries=["stdio"]}]let_=output[@migrate{repl=(funchbufposlen->Stdio.Out_channel.outputch~buf~pos~len);libraries=["stdio"]}]let_=output_substring[@migrate{repl=(funchbufposlen->Stdio.Out_channel.output_substringch~buf~pos~len);libraries=["stdio"]}]let_=output_byte[@migrate{repl=Stdio.Out_channel.output_byte;libraries=["stdio"]}]let_=output_binary_int[@migrate{repl=Stdio.Out_channel.output_binary_int;libraries=["stdio"]}]let_=output_value[@migrate{repl=Stdio.Out_channel.output_value;libraries=["stdio"]}]let_=seek_out[@migrate{repl=(funchn->Stdio.Out_channel.seekch(Base.Int64.of_intn));libraries=["stdio"]}]let_=pos_out[@migrate{repl=(funch->Base.Int64.to_int_exn(Stdio.Out_channel.posch));libraries=["stdio"]}]let_=out_channel_length[@migrate{repl=(funch->Base.Int64.to_int_exn(Stdio.Out_channel.lengthch));libraries=["stdio"]}]let_=close_out[@migrate{repl=Stdio.Out_channel.close;libraries=["stdio"]}]let_=close_out_noerr[@migrate{repl=Stdio.Out_channel.close_no_err;libraries=["stdio"]}]let_=set_binary_mode_out[@migrate{repl=Stdio.Out_channel.set_binary_mode;libraries=["stdio"]}]let_=open_in[@migrate{repl=Stdio.In_channel.create~binary:false;libraries=["stdio"]}]let_=open_in_bin[@migrate{repl=Stdio.In_channel.create;libraries=["stdio"]}](* no equivalent of open_in_gen *)(*
let _ =
input_char
[@migrate
{ repl = Stdio.In_channel.input_char; libraries = [ "stdio" ] }]
*)(* would need _exn of this, and same thing with input_byte, input_binary_int,
input_value *)let_=input_line[@migrate{repl=(funch->Stdio.In_channel.input_line_exn~fix_win_eol:falsech);libraries=["stdio"]}]let_=input[@migrate{repl=(funchbufposlen->Stdio.In_channel.inputch~buf~pos~len);libraries=["stdio"]}]let_=really_input[@migrate{repl=(funchbufposlen->Stdio.In_channel.really_input_exnch~buf~pos~len);libraries=["stdio"]}](* no equivalent of really_input_string *)let_=seek_in[@migrate{repl=(funchn->Stdio.In_channel.seekch(Base.Int64.of_intn));libraries=["stdio"]}]let_=pos_in[@migrate{repl=(funch->Base.Int64.to_int_exn(Stdio.In_channel.posch));libraries=["stdio"]}]let_=in_channel_length[@migrate{repl=(funch->Base.Int64.to_int_exn(Stdio.In_channel.lengthch));libraries=["stdio"]}]let_=set_binary_mode_in[@migrate{repl=Stdio.In_channel.set_binary_mode;libraries=["stdio"]}]let_=close_in[@migrate{repl=Stdio.In_channel.close;libraries=["stdio"]}](*
let _ =
close_in_noerr
[@migrate { repl = Stdio.In_channel.close_no_err; libraries = [ "stdio" ] }]
*)(* turns out this function is not provided, unlike in out_channel *)let_=LargeFile.seek_out[@migrate{repl=Stdio.Out_channel.seek;libraries=["stdio"]}]let_=LargeFile.pos_out[@migrate{repl=Stdio.Out_channel.pos;libraries=["stdio"]}]let_=LargeFile.out_channel_length[@migrate{repl=Stdio.Out_channel.length;libraries=["stdio"]}]let_=LargeFile.seek_in[@migrate{repl=Stdio.In_channel.seek;libraries=["stdio"]}]let_=LargeFile.pos_in[@migrate{repl=Stdio.In_channel.pos;libraries=["stdio"]}]let_=LargeFile.in_channel_length[@migrate{repl=Stdio.In_channel.length;libraries=["stdio"]}]let_=ref[@migrate{repl=Base.ref}]let_=(!)[@migrate{repl=Base.(!)}]let_=incr[@migrate{repl=Base.Int.incr}]let_=decr[@migrate{repl=Base.Int.decr}](* no equivalent of string_of_format, format_of_string, (^^) *)(* not sure where the replacements are for exit, at_exit *)endopenstructopenBuffer(* should be fully converted *)let_=create[@migrate{repl=Base.Buffer.create}]let_=contents[@migrate{repl=Base.Buffer.contents}]let_=to_bytes[@migrate{repl=Base.Buffer.contents_bytes}]let_=sub[@migrate{repl=(funbufposlen->Base.Buffer.To_string.subbuf~pos~len)}]let_=blit[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Buffer.blit~src~src_pos~dst~dst_pos~len)}]let_=nth[@migrate{repl=Base.Buffer.nth}]let_=length[@migrate{repl=Base.Buffer.length}]let_=clear[@migrate{repl=Base.Buffer.clear}]let_=reset[@migrate{repl=Base.Buffer.reset}]let_=output_buffer[@migrate{repl=Stdio.Out_channel.output_buffer;libraries=["stdio"]}](* no equivalent of truncate *)let_=add_char[@migrate{repl=Base.Buffer.add_char}](* no equivalent of add_utf_8_uchar, etc *)let_=add_string[@migrate{repl=Base.Buffer.add_string}]let_=add_bytes[@migrate{repl=Base.Buffer.add_bytes}]let_=add_substring[@migrate{repl=(funbufsposlen->Base.Buffer.add_substringbufs~pos~len)}]let_=add_subbytes[@migrate{repl=(funbufbposlen->Base.Buffer.add_subbytesbufb~pos~len)}](* no equivalent of add_substitute *)let_=add_buffer[@migrate{repl=Base.Buffer.add_buffer}](* I don't see an equivalent of Buffer.add_channel in In_channel *)(* no equivalent of seq functions *)(* don't know where the binary int functions are *)endopenstructopenBytes(* should be fully converted *)let_=length[@migrate{repl=Base.Bytes.length}]let_=get[@migrate{repl=Base.Bytes.get}]let_=set[@migrate{repl=Base.Bytes.set}]let_=create[@migrate{repl=Base.Bytes.create}]let_=make[@migrate{repl=Base.Bytes.make}]let_=init[@migrate{repl=(funnf->Base.Bytes.initn~f)}](* no equivalent for empty *)let_=copy[@migrate{repl=Base.Bytes.copy}]let_=of_string[@migrate{repl=Base.Bytes.of_string}]let_=to_string[@migrate{repl=Base.Bytes.to_string}]let_=sub[@migrate{repl=(funstrposlen->Base.Bytes.substr~pos~len)}]let_=sub_string[@migrate{repl=(funstrposlen->Base.Bytes.To_string.substr~pos~len)}](* no equivalent of extend that I can see *)let_=fill[@migrate{repl=(funbposlenc->Base.Bytes.fillb~pos~lenc)}]let_=blit[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.blit~src~src_pos~dst~dst_pos~len)}]let_=blit_string[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.From_string.blit~src~src_pos~dst~dst_pos~len)}](* no equivalent of concat, cat, iter, iteri *)let_=map[@migrate{repl=(funfs->Base.Bytes.maps~f)}]let_=mapi[@migrate{repl=(funfs->Base.Bytes.mapis~f)}](* no equivalent of fold_left, fold_right, for_all, exists, trim, escaped, {,r}index{,_from}{,_opt} *)let_=contains[@migrate{repl=(funbc->Base.Bytes.containsbc)}]let_=contains_from[@migrate{repl=(funsposc->Base.Bytes.containssc~pos)}](* no equivalent to rcontains_from, {uppercase,lowercase,capitalize,uncapitalize}_ascii *)let_=equal[@migrate{repl=Base.Bytes.equal}]let_=compare[@migrate{repl=Base.Bytes.compare}](* no equivalent to starts_with, ends_with *)let_=unsafe_to_string[@migrate{repl=(funb->Base.Bytes.unsafe_to_string~no_mutation_while_string_reachable:b)}]let_=unsafe_of_string[@migrate{repl=Base.Bytes.unsafe_of_string_promise_no_mutation}](* no equivalent to split_on_char, to_seq, to_seqi, of_seq *)(* no equivalent to get_utf_8_uchar, but there is set_utf_8_uchar etc? weird *)let_=set_utf_8_uchar[@migrate{repl=Base.Bytes.Utf8.set}](* not sure where the equivalent of set_uint8 are. *)let_=unsafe_get[@migrate{repl=Base.Bytes.unsafe_get}]let_=unsafe_set[@migrate{repl=Base.Bytes.unsafe_set}]let_=unsafe_blit[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.unsafe_blit~src~src_pos~dst~dst_pos~len)}]let_=unsafe_blit_string[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.From_string.unsafe_blit~src~src_pos~dst~dst_pos~len)}](* no equivalent of unsafe_fill *)(* no equivalent of unsafe_escape *)endopenstructopenChar(* should be fully converted *)let_=code[@migrate{repl=Base.Char.to_int}]let_=chr[@migrate{repl=Base.Char.of_int_exn}]let_=unsafe_chr[@migrate{repl=Base.Char.unsafe_of_int}]let_=escaped[@migrate{repl=Base.Char.escaped}]let_=lowercase_ascii[@migrate{repl=Base.Char.lowercase}]let_=uppercase_ascii[@migrate{repl=Base.Char.uppercase}]let_=compare[@migrate{repl=Base.Char.compare}]let_=equal[@migrate{repl=Base.Char.equal}](* leaving the hash functions unconverted *)endopenstructopenFilenamelet_=chop_extension[@migrate{repl=Filename_base.chop_extension;libraries=["core.filename_base"]}](* no equivalent for remove_extension! *)let_=dirname[@migrate{repl=Filename_base.dirname;libraries=["core.filename_base"]}]let_=basename[@migrate{repl=Filename_base.basename;libraries=["core.filename_base"]}](* Reducing the shapes for these identifiers doesn't work, which prevents our the
rewriting. We should fix this to simply require a normal form, instead of a
definition. And probably drop all this shape stuff. *)let_=concat[@migrate{repl=Filename_base.concat;libraries=["core.filename_base"]}](* not exactly equivalent for two reasons:
- [concat "" "/a"] is an error with Core, but returns "/a" with Stdlib, which is
unlikely to ever be correct. Given even open("", O_PATH, 0) rejects the empty
path, the behavior of Core is correct.
- some "." get cleaned up with Core. *)let_=temp_file[@migrate{repl=(fun?temp_dirprefixsuffix->Filename_unix.temp_file?in_dir:temp_dirprefixsuffix);libraries=["core_unix.filename_unix"]}]let_=temp_dir[@migrate{repl=(fun?temp_dir?permsprefixsuffix->Filename_unix.temp_dir?in_dir:temp_dir?perm:permsprefixsuffix);libraries=["core_unix.filename_unix"]}]endopenstructopenFloatlet_=of_int[@migrate{repl=Base.Float.of_int}]endopenstructopenIn_channel(* should be fully converted *)let_=stdin[@migrate{repl=Stdio.In_channel.stdin;libraries=["stdio"]}]let_=open_bin[@migrate{repl=Stdio.In_channel.create;libraries=["stdio"]}]let_=open_text[@migrate{repl=Stdio.In_channel.create~binary:false;libraries=["stdio"]}](* no clear equivalent to open_gen *)let_=with_open_bin[@migrate{repl=(funpathf->Stdio.In_channel.with_filepath~f);libraries=["stdio"]}]let_=with_open_text[@migrate{repl=(funpathf->Stdio.In_channel.with_file~binary:falsepath~f);libraries=["stdio"]}](* no clear equivalent to with_open_gen *)let_=close[@migrate{repl=Stdio.In_channel.close;libraries=["stdio"]}](*
let _ =
close_noerr
[@migrate { repl = Stdio.In_channel.close_no_err; libraries = [ "stdio" ] }]
*)(* no equivalent, weirdly *)(*
let _ =
input_char
[@migrate { repl = Stdio.In_channel.input_char; libraries = [ "stdio" ] }]
let _ =
input_byte
[@migrate { repl = Stdio.In_channel.input_byte; libraries = [ "stdio" ] }]
*)(* would need _exn versions of these *)let_=input_line[@migrate{repl=(funch->Stdio.In_channel.input_linech~fix_win_eol:false);libraries=["stdio"]}](* no equivalent of really_input_string, I think *)let_=input_all[@migrate{repl=Stdio.In_channel.input_all;libraries=["stdio"]}]let_=input_lines[@migrate{repl=(funch->Stdio.In_channel.input_linesch~fix_win_eol:false);libraries=["stdio"]}]let_=input[@migrate{repl=(funchbufposlen->Stdio.In_channel.inputch~buf~pos~len);libraries=["stdio"]}](* no equivalent of input_bigarray *)let_=really_input[@migrate{repl=(funchbufposlen->Stdio.In_channel.really_inputch~buf~pos~len);libraries=["stdio"]}](* no equivalent of really_input_bigarray *)let_=fold_lines[@migrate{repl=(funfinitch->Stdio.In_channel.fold_lines~fix_win_eol:falsech~init~f);libraries=["stdio"]}]let_=seek[@migrate{repl=Stdio.In_channel.seek;libraries=["stdio"]}]let_=pos[@migrate{repl=Stdio.In_channel.pos;libraries=["stdio"]}]let_=length[@migrate{repl=Stdio.In_channel.length;libraries=["stdio"]}]let_=set_binary_mode[@migrate{repl=Stdio.In_channel.set_binary_mode;libraries=["stdio"]}](* no equivalent of is_binary_mode, isatty *)endopenstructopenInt(* should be fully converted *)let_=zero[@migrate{repl=Base.Int.zero}]let_=one[@migrate{repl=Base.Int.one}]let_=minus_one[@migrate{repl=Base.Int.zero}]let_=neg[@migrate{repl=Base.Int.neg}]let_=add[@migrate{repl=Base.Int.(+)}]let_=sub[@migrate{repl=Base.Int.(-)}]let_=div[@migrate{repl=Base.Int.(/)}]let_=rem[@migrate{repl=Base.Int.(/)}]let_=to_string[@migrate{repl=Base.Int.to_string}]let_=rem[@migrate{repl=Base.Int.rem}]let_=succ[@migrate{repl=Base.Int.succ}]let_=pred[@migrate{repl=Base.Int.pred}]let_=abs[@migrate{repl=Base.Int.abs}]let_=max_int[@migrate{repl=Base.Int.max_value}]let_=min_int[@migrate{repl=Base.Int.min_value}]let_=logand[@migrate{repl=Base.Int.bit_and}]let_=logor[@migrate{repl=Base.Int.bit_or}]let_=logxor[@migrate{repl=Base.Int.bit_xor}]let_=lognot[@migrate{repl=Base.Int.bit_not}]let_=shift_left[@migrate{repl=Base.Int.shift_left}]let_=shift_right[@migrate{repl=Base.Int.shift_right}]let_=shift_right_logical[@migrate{repl=Base.Int.shift_right_logical}]let_=equal[@migrate{repl=Base.Int.equal}]let_=compare[@migrate{repl=Base.Int.compare}]let_=min[@migrate{repl=Base.Int.min}]let_=max[@migrate{repl=Base.Int.max}]let_=to_float[@migrate{repl=Base.Int.to_float}]let_=of_float[@migrate{repl=Base.Int.of_float_unchecked}]let_=to_string[@migrate{repl=Base.Int.to_string}](* leaving hash functions alone *)endopenstructopenLazy(* should be fully converted *)let_=force[@migrate{repl=Base.force}]let_=map[@migrate{repl=(funfl->Base.Lazy.mapl~f)}]let_=is_val[@migrate{repl=Base.Lazy.is_val}]let_=from_val[@migrate{repl=Base.Lazy.from_val}](* no equivalent of map_val *)let_=from_fun[@migrate{repl=Base.Lazy.from_fun}]let_=force_val[@migrate{repl=Base.Lazy.force_val}]endopenstructopenList(* should be fully converted *)let_=length[@migrate{repl=Base.List.length}]let_=is_empty[@migrate{repl=Base.List.is_empty}](* no equivalent of compare_lengths, compare_length_with *)let_=cons[@migrate{repl=Base.List.cons}]let_=hd[@migrate{repl=Base.List.hd_exn}]let_=tl[@migrate{repl=Base.List.tl_exn}]let_=nth[@migrate{repl=Base.List.nth_exn}]let_=nth_opt[@migrate{repl=Base.List.nth}]let_=rev[@migrate{repl=Base.List.rev}]let_=init[@migrate{repl=(funnf->Base.List.initn~f)}]let_=append[@migrate{repl=Base.List.append}]let_=rev_append[@migrate{repl=Base.List.rev_append}]let_=concat[@migrate{repl=Base.List.concat}]let_=flatten[@migrate{repl=Base.List.concat}]let_=equal[@migrate{repl=Base.List.equal}]let_=compare[@migrate{repl=Base.List.compare}]let_=iter[@migrate{repl=(funfl->Base.List.iterl~f)}]let_=iteri[@migrate{repl=(funfl->Base.List.iteril~f)}]let_=map[@migrate{repl=(funfl->(Base.List.mapl~f[@reorder]))}]let_=mapi[@migrate{repl=(funfl->Base.List.mapil~f)}]let_=rev_map[@migrate{repl=(funfl->Base.List.rev_mapl~f)}]let_=filter_map[@migrate{repl=(funfl->Base.List.filter_mapl~f)}]let_=concat_map[@migrate{repl=(funfl->Base.List.concat_mapl~f)}]let_=fold_left_map[@migrate{repl=(funfinitl->Base.List.fold_mapl~init~f)}]let_=fold_left[@migrate{repl=(funfinitl->Base.List.fold_leftl~init~f)}]let_=fold_right[@migrate{repl=(funflinit->Base.List.fold_rightl~init~f)}]let_=iter2[@migrate{repl=(funfl1l2->Base.List.iter2_exnl1l2~f)}]let_=map2[@migrate{repl=(funfl1l2->Base.List.map2_exnl1l2~f)}]let_=rev_map2[@migrate{repl=(funfl1l2->Base.List.rev_map2_exnl1l2~f)}]let_=fold_left2[@migrate{repl=(funfinitl1l2->Base.List.fold2_exnl1l2~init~f)}]let_=fold_right2[@migrate{repl=(funfl1l2init->Base.List.fold_right2_exnl1l2~init~f)}]let_=for_all[@migrate{repl=(funfl->Base.List.for_alll~f)}]let_=exists[@migrate{repl=(funfl->Base.List.existsl~f)}]let_=for_all2[@migrate{repl=(funfl->Base.List.for_all2_exnl~f)}]let_=exists2[@migrate{repl=(funfl->Base.List.exists2_exnl~f)}]let_=mem[@migrate{repl=(function|[%context:int->_]->funal->Base.List.mem~equal:Base.(=)la|[%context:string->_]->funal->Base.List.mem~equal:Base.String.(=)la|[%context:char->_]->funal->Base.List.mem~equal:Base.Char.(=)la|_->funal->Base.List.mem~equal:Base.Poly.(=)la)}]let_=memq[@migrate{repl=(funal->Base.List.mem~equal:Base.phys_equalla)}](* let _ = find [@migrate { repl = (fun f l -> Base.List.find_exn l ~f) }] *)let_=find_opt[@migrate{repl=(funfl->Base.List.findl~f)}]let_=find_index[@migrate{repl=(funfl->matchBase.List.findil~f:(fun_a->fa)with|None->None|Some(i,_)->Somei)}]let_=find_map[@migrate{repl=(funfl->Base.List.find_mapl~f)}]let_=find_mapi[@migrate{repl=(funfl->Base.List.find_mapil~f)}]let_=filter[@migrate{repl=(funfl->Base.List.filterl~f)}]let_=find_all[@migrate{repl=(funfl->Base.List.filterl~f)}]let_=filteri[@migrate{repl=(funfl->Base.List.filteril~f)}]let_=partition[@migrate{repl=(funfl->Base.List.partition_tfl~f)}]let_=partition_map[@migrate{repl=(funfl->Base.List.partition_mapl~f:(funa->matchfawithStdlib.Either.Leftl->Firstl|Rightr->Secondr))}](* let _ =
* assoc
* [@migrate
* { repl = (fun a l -> Base.List.Assoc.find_exn ~equal:Base.Poly.( = ) l a) }] *)let_=assoc_opt[@migrate{repl=(funal->Base.List.Assoc.find~equal:Base.Poly.(=)la)}](* let _ =
* assq
* [@migrate
* { repl = (fun a l -> Base.List.Assoc.find_exn ~equal:Base.phys_equal l a) }] *)let_=assq_opt[@migrate{repl=(funal->Base.List.Assoc.find~equal:Base.phys_equalla)}]let_=mem_assoc[@migrate{repl=(funal->Base.List.Assoc.mem~equal:Base.Poly.(=)la)}]let_=mem_assq[@migrate{repl=(funal->Base.List.Assoc.mem~equal:Base.phys_equalla)}]let_=remove_assoc[@migrate{repl=(funal->Base.List.Assoc.remove~equal:Base.Poly.(=)la)}]let_=remove_assq[@migrate{repl=(funal->Base.List.Assoc.remove~equal:Base.phys_equalla)}]let_=split[@migrate{repl=Base.List.unzip}]let_=combine[@migrate{repl=Base.List.zip_exn}]let_=sort[@migrate{repl=(funcomparel->Base.List.sort~comparel)}]let_=stable_sort[@migrate{repl=(funcomparel->Base.List.stable_sort~comparel)}]let_=fast_sort[@migrate{repl=(funcomparel->Base.List.sort~comparel)}]let_=sort_uniq[@migrate{repl=(funcomparel->Base.List.dedup_and_sort~comparel)}]let_=merge[@migrate{repl=(funcomparel1l2->Base.List.mergel1l2~compare)}](* no equivalent of to_seq, of_seq *)endopenstructopenOption(* should be fully converted *)let_=none[@migrate{repl=None}]let_=some[@migrate{repl=Base.Option.some}]let_=value[@migrate{repl=Base.Option.value}]let_=get[@migrate{repl=(funo->Base.Option.value_exno)}]let_=bind[@migrate{repl=(funof->Base.Option.bindo~f)}]let_=join[@migrate{repl=Base.Option.join}]let_=map[@migrate{repl=(funfo->Base.Option.mapo~f)}]let_=fold[@migrate{repl=(fun~none~someo->Base.Option.value_mapo~default:none~f:some)}]let_=iter[@migrate{repl=(funfo->Base.Option.itero~f)}]let_=is_none[@migrate{repl=Base.Option.is_none}]let_=is_some[@migrate{repl=Base.Option.is_some}]let_=equal[@migrate{repl=Base.Option.equal}]let_=compare[@migrate{repl=Base.Option.compare}]let_=to_result[@migrate{repl=(fun~noneo->Base.Result.of_option~error:noneo)}]let_=to_list[@migrate{repl=Base.Option.to_list}](* no equivalent for to_seq *)endopenstructopenOut_channel(* should be fully converted *)let_=stdout[@migrate{repl=Stdio.Out_channel.stdout;libraries=["stdio"]}]let_=stderr[@migrate{repl=Stdio.Out_channel.stderr;libraries=["stdio"]}]let_=open_bin[@migrate{repl=Stdio.Out_channel.create;libraries=["stdio"]}]let_=open_text[@migrate{repl=Stdio.Out_channel.create~binary:false;libraries=["stdio"]}](* no clear equivalent to open_gen *)let_=with_open_bin[@migrate{repl=(funpathf->Stdio.Out_channel.with_filepath~f);libraries=["stdio"]}](* here it'd good to have context matching to turn
Out_channel.with_open_bin old_path (fun oc ->
Out_channel.output_string oc src)
into
Stdio.Out_channel.write_all old_path ~data:src
*)let_=with_open_text[@migrate{repl=(funpathf->Stdio.Out_channel.with_file~binary:falsepath~f);libraries=["stdio"]}](* no clear equivalent to with_open_gen *)let_=close[@migrate{repl=Stdio.Out_channel.close;libraries=["stdio"]}]let_=close_noerr[@migrate{repl=Stdio.Out_channel.close_no_err;libraries=["stdio"]}]let_=output_char[@migrate{repl=Stdio.Out_channel.output_char;libraries=["stdio"]}]let_=output_byte[@migrate{repl=Stdio.Out_channel.output_byte;libraries=["stdio"]}]let_=output_string[@migrate{repl=Stdio.Out_channel.output_string;libraries=["stdio"]}]let_=output_bytes[@migrate{repl=Stdio.Out_channel.output_bytes;libraries=["stdio"]}]let_=output[@migrate{repl=(funchbufposlen->Stdio.Out_channel.outputch~buf~pos~len);libraries=["stdio"]}]let_=output_substring[@migrate{repl=(funchbufposlen->Stdio.Out_channel.output_substringch~buf~pos~len);libraries=["stdio"]}](* no idea where output_bigarray is *)let_=flush[@migrate{repl=Stdio.Out_channel.flush;libraries=["stdio"]}](* probably no equivalent for flush_all *)let_=seek[@migrate{repl=Stdio.Out_channel.seek;libraries=["stdio"]}]let_=pos[@migrate{repl=Stdio.Out_channel.pos;libraries=["stdio"]}]let_=length[@migrate{repl=Stdio.Out_channel.length;libraries=["stdio"]}]let_=set_binary_mode[@migrate{repl=Stdio.Out_channel.set_binary_mode;libraries=["stdio"]}](* no equivalent of is_binary_mode, set_buffered, is_buffered, isatty *)endopenstructopenBool(* should be fully converted *)let_=not[@migrate{repl=Base.not}]let_=(&&)[@migrate{repl=Base.(&&)}]let_=(||)[@migrate{repl=Base.(||)}]let_=equal[@migrate{repl=Base.Bool.equal}]let_=compare[@migrate{repl=Base.Bool.compare}]let_=to_int[@migrate{repl=Base.Bool.to_int}]let_=to_string[@migrate{repl=Base.Bool.to_string}](* leaving the hash functions, and to float unconverted *)endopenstructopenString(* should be fully converted *)let_=make[@migrate{repl=Base.String.make}]let_=init[@migrate{repl=(funnf->Base.String.initn~f)}]let_=empty[@migrate{repl=""}]let_=length[@migrate{repl=Base.String.length}]let_=get[@migrate{repl=Base.String.get}]let_=of_bytes[@migrate{repl=Base.Bytes.to_string}]let_=to_bytes[@migrate{repl=Base.Bytes.of_string}]let_=blit[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.From_string.blit~src~src_pos~dst~dst_pos~len)}]let_=concat[@migrate{repl=(funsepl->Base.String.concatl~sep)}]let_=cat[@migrate{repl=Base.(^)}]let_=equal[@migrate{repl=Base.String.equal}]let_=compare[@migrate{repl=Base.String.compare}]let_=starts_with[@migrate{repl=(fun~prefixs->Base.String.is_prefixs~prefix)}]let_=ends_with[@migrate{repl=(fun~suffixs->Base.String.is_suffixs~suffix)}]let_=contains_from[@migrate{repl=(funsposc->Base.String.containssc~pos)}](* not sure there's an equivalent to rcontains_from *)let_=contains[@migrate{repl=Base.String.contains}]let_=sub[@migrate{repl=(funstrposlen->Base.String.substr~pos~len)}]let_=split_on_char[@migrate{repl=(funsepl->Base.String.splitl~on:sep)}]let_=map[@migrate{repl=(funfs->Base.String.maps~f)}]let_=mapi[@migrate{repl=(funfs->Base.String.mapis~f)}]let_=fold_left[@migrate{repl=(funfinits->Base.String.folds~init~f)}](* no equivalent of fold_right *)let_=for_all[@migrate{repl=(funfs->Base.String.for_alls~f)}]let_=exists[@migrate{repl=(funfs->Base.String.existss~f)}]let_=trim[@migrate{repl=Base.String.strip}](*
This is not 100% equivalent, because Stdlib.String.trim strips \011 whereas
Core.String.strip doesn't. It's hard to imagine when it would ever matter. Ideally,
we'd use String.strip ~drop:Stdlib.Char.is_space but since the is-a-space criteria is
not provided as a separate function, we can't even do that. Maybe we should have either
a way to say "you could migrate to this, but it's not exactly the same", or perhaps if
we should emit a warning (or annotation in the comment) saying "there is a slighly
corner case here".
*)let_=escaped[@migrate{repl=Base.String.escaped}]let_=lowercase_ascii[@migrate{repl=Base.String.lowercase}]let_=uppercase_ascii[@migrate{repl=Base.String.uppercase}]let_=capitalize_ascii[@migrate{repl=Base.String.capitalize}]let_=uncapitalize_ascii[@migrate{repl=Base.String.capitalize}]let_=iter[@migrate{repl=(funfs->Base.String.iters~f)}]let_=iteri[@migrate{repl=(funfs->Base.String.iteris~f)}](* let _ = index_from [@migrate { repl = Base.String.index_from_exn }] *)let_=index_from_opt[@migrate{repl=Base.String.index_from}](* let _ = rindex_from [@migrate { repl = Base.String.rindex_from_exn }] *)let_=rindex_from_opt[@migrate{repl=Base.String.rindex_from}](* let _ = index [@migrate { repl = Base.String.index_exn }]
* let _ = rindex [@migrate { repl = Base.String.rindex_exn }] *)let_=index_opt[@migrate{repl=Base.String.index}]let_=rindex_opt[@migrate{repl=Base.String.rindex}](* no equivalent of to_seq, to_seqi, of_seq *)(* get_utf_8_uchar and the other ones don't seem to have direct equivalent.
There is Base.String.Utf8.get, but it works on a type of known-to-be-valid-utf8
string, which is is not necessarily what one wants, so I don't think we should
translate to that. There's the same split as Bstr vs String in rust. *)(* seems simpler to leave hash, seeded_hash alone, and let people switch to hash,
hash_fold_t if they want to. These functions are probably rarely used, considering
the lack of support for hand written hash functions in the stdlib. *)(* no equivalent for get_int{32,64}_{le,be}. *)let_=unsafe_get[@migrate{repl=Base.String.unsafe_get}]let_=unsafe_blit[@migrate{repl=(funsrcsrc_posdstdst_poslen->Base.Bytes.From_string.unsafe_blit~src~src_pos~dst~dst_pos~len)}]endopenstructopenSys(* should be as fully converted as is possible *)let_=argv[@migrate{repl=Base.Sys.get_argv()}]let_=executable_name[@migrate{repl=Sys_unix.executable_name;libraries=["core_unix.sys_unix"]}]let_=file_exists[@migrate{repl=Sys_unix.file_exists_exn;libraries=["core_unix.sys_unix"]}]let_=is_directory[@migrate{repl=Sys_unix.is_directory_exn;libraries=["core_unix.sys_unix"]}]let_=is_regular_file[@migrate{repl=Sys_unix.is_file_exn;libraries=["core_unix.sys_unix"]}]let_=remove[@migrate{repl=Sys_unix.remove;libraries=["core_unix.sys_unix"]}]let_=rename[@migrate{repl=Sys_unix.rename;libraries=["core_unix.sys_unix"]}]let_=getenv[@migrate{repl=(funvar->matchBase.Sys.getenvvarwith|None->Base.raiseStdlib.Not_found|Somev->v)}]let_=getenv_opt[@migrate{repl=Base.Sys.getenv}]let_=command[@migrate{repl=Sys_unix.command;libraries=["core_unix.sys_unix"]}](* not sure whether we should migrate Sys.time, since it's very heavy to switch from
Sys.time () to Core.Time_float.Span.to_seconds_since_epoch
(Core.Time_float.to_span_since_epoch
(Core.Time_float.now ()))
though it'd make for easier switching by hand, since that would indicate where the
replacement is for the functionality. Perhaps we could have functionality to add a
comment to the callsite, to indicate where to look for equivalent functionality, to
get the discovery benefit without adding too much mess to the code.
Stupidly, we couldn't even use Time_ns, because even though Core.Time_float.now () is
implemented on top of Time_now.nanoseconds_since_unix_epoch (), which is exactly what
Core.Time_ns.now () should be, Core.Time_ns.now is not provided, and points to
Time_ns_unix instead. *)let_=chdir[@migrate{repl=Sys_unix.chdir;libraries=["core_unix.sys_unix"]}]let_=(* mkdir and rmdir don't seem to be in Sys_unix, weirdly *)mkdir[@migrate{repl=(fundirperm->Core_unix.mkdirdir~perm);libraries=["core_unix"]}]let_=rmdir[@migrate{repl=Core_unix.rmdir;libraries=["core_unix"]}]let_=getcwd[@migrate{repl=Sys_unix.getcwd;libraries=["core_unix.sys_unix"]}]let_=readdir[@migrate{repl=Sys_unix.readdir;libraries=["core_unix.sys_unix"]}]let_=interactive[@migrate{repl=Base.Sys.interactive}]let_=os_type[@migrate{repl=Base.Sys.os_type}]let_=backend_type[@migrate{repl=Base.Sys.backend_type}]let_=unix[@migrate{repl=Base.Sys.unix}]let_=win32[@migrate{repl=Base.Sys.win32}]let_=cygwin[@migrate{repl=Base.Sys.cygwin}]let_=word_size[@migrate{repl=Base.Sys.word_size_in_bits}]let_=int_size[@migrate{repl=Base.Sys.int_size_in_bits}]let_=big_endian[@migrate{repl=Base.Sys.big_endian}]let_=max_string_length[@migrate{repl=Base.Sys.max_string_length}]let_=max_array_length[@migrate{repl=Base.Sys.max_array_length}](* no equivalent for max_floatarray_length *)let_=runtime_variant[@migrate{repl=Base.Sys.runtime_variant}]let_=runtime_parameters[@migrate{repl=Base.Sys.runtime_parameters}](* all the signal stuff should be replaced by Core.Signal, but Core.Signal.t is opaque from Stdlib.Sys uses int, so not clear what to do. Maybe we should insert sigabrt by Core.Signal.to_caml_int Core.Signal.sigabrt? *)let_=(* ideally, we'd do the same thing with the Break exception, but ocamlmig doesn't
support that *)catch_break[@migrate{repl=Sys_unix.catch_break;libraries=["core_unix.sys_unix"]}]let_=ocaml_version[@migrate{repl=Base.Sys.ocaml_version}](* no equivalent of development_version, ocaml_release *)let_=enable_runtime_warnings[@migrate{repl=Base.Sys.enable_runtime_warnings}]let_=runtime_warnings_enabled[@migrate{repl=Base.Sys.runtime_warnings_enabled}]let_=opaque_identity[@migrate{repl=Base.Sys.opaque_identity}](* no equivalent of Immediate64, but int63 is provided instead *)endopenstructopenUcharlet_=utf_8_byte_length[@migrate{repl=Base.Uchar.Utf8.byte_length}]let_=to_char[@migrate{repl=Base.Uchar.to_char_exn}]let_=utf_decode_uchar[@migrate{repl=Base.Uchar.Decode_result.uchar_or_replacement_char}]let_=utf_decode_length[@migrate{repl=Base.Uchar.Decode_result.bytes_consumed}]endopenstructopenUnit(* should be fully converted *)let_=to_string[@migrate{repl=Base.Unit.to_string}]let_=compare[@migrate{repl=Base.Unit.compare}]let_=equal[@migrate{repl=Base.Unit.equal}](* leaving the hash functions unconverted *)end