123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452openStdlib0moduleFrom=Ast_504moduleTo=Ast_503moduleBivariant_param =structletlist_map~fl=List.fold_left_map~acc:falsel~f:(fun~accx->letcontains_bivariant,x'=fxin(acc||contains_bivariant,x'))endlet bivariant_error~loc=Location.raise_errorf~loc"Ppxlib migration error: bivariant type parameters cannot be migrated from \
OCaml 5.4 to 5.3"letreccopy_toplevel_phrase:Ast_504.Parsetree.toplevel_phrase->Ast_503.Parsetree.toplevel_phrase=function|Ast_504.Parsetree.Ptop_defx0->Ast_503.Parsetree.Ptop_def(copy_structurex0)|Ast_504.Parsetree.Ptop_dirx0->Ast_503.Parsetree.Ptop_dir(copy_toplevel_directivex0)andcopy_toplevel_directive:Ast_504.Parsetree.toplevel_directive->Ast_503.Parsetree.toplevel_directive=fun{Ast_504.Parsetree.pdir_name;Ast_504.Parsetree.pdir_arg;Ast_504.Parsetree.pdir_loc;}->{Ast_503.Parsetree.pdir_name=copy_loc(funx->x)pdir_name;Ast_503.Parsetree.pdir_arg=Option.mapcopy_directive_argumentpdir_arg;Ast_503.Parsetree.pdir_loc=copy_locationpdir_loc;}andcopy_directive_argument:Ast_504.Parsetree.directive_argument->Ast_503.Parsetree.directive_argument=fun{Ast_504.Parsetree.pdira_desc;Ast_504.Parsetree.pdira_loc}->{Ast_503.Parsetree.pdira_desc=copy_directive_argument_descpdira_desc;Ast_503.Parsetree.pdira_loc=copy_locationpdira_loc;}andcopy_directive_argument_desc:Ast_504.Parsetree.directive_argument_desc ->Ast_503.Parsetree.directive_argument_desc =function|Ast_504.Parsetree.Pdir_stringx0->Ast_503.Parsetree.Pdir_stringx0|Ast_504.Parsetree.Pdir_int(x0,x1)->Ast_503.Parsetree.Pdir_int(x0,Option.map(funx->x)x1)|Ast_504.Parsetree.Pdir_identx0->Ast_503.Parsetree.Pdir_ident(copy_Longident_tx0)|Ast_504.Parsetree.Pdir_boolx0->Ast_503.Parsetree.Pdir_boolx0andcopy_expression:Ast_504.Parsetree.expression->Ast_503.Parsetree.expression=fun{Ast_504.Parsetree.pexp_desc;Ast_504.Parsetree.pexp_loc;Ast_504.Parsetree.pexp_loc_stack;Ast_504.Parsetree.pexp_attributes;}->letloc=copy_location pexp_locin{Ast_503.Parsetree.pexp_desc=copy_expression_desc~locpexp_desc;Ast_503.Parsetree.pexp_loc=loc;Ast_503.Parsetree.pexp_loc_stack=copy_location_stackpexp_loc_stack;Ast_503.Parsetree.pexp_attributes=copy_attributespexp_attributes;}andcopy_expression_desc~loc:Ast_504.Parsetree.expression_desc ->Ast_503.Parsetree.expression_desc =function|Ast_504.Parsetree.Pexp_identx0->Ast_503.Parsetree.Pexp_ident(copy_loccopy_Longident_tx0)|Ast_504.Parsetree.Pexp_constantx0->Ast_503.Parsetree.Pexp_constant(copy_constantx0)|Ast_504.Parsetree.Pexp_let(x0,x1,x2)->Ast_503.Parsetree.Pexp_let(copy_rec_flagx0,List.mapcopy_value_bindingx1,copy_expressionx2)|Ast_504.Parsetree.Pexp_function(params,typ_constraint,fun_body)->letparams=List.mapcopy_function_paramparamsinlettyp_constraint=Option.mapcopy_type_constrainttyp_constraintinletfun_body=copy_function_bodyfun_bodyinAst_503.Parsetree.Pexp_function(params,typ_constraint,fun_body)|Ast_504.Parsetree.Pexp_apply(x0,x1)->Ast_503.Parsetree.Pexp_apply(copy_expressionx0,List.map(funx->letx0,x1=xin(copy_arg_labelx0,copy_expressionx1))x1)|Ast_504.Parsetree.Pexp_match(x0,x1)->Ast_503.Parsetree.Pexp_match(copy_expressionx0,List.mapcopy_casex1)|Ast_504.Parsetree.Pexp_try(x0,x1)->Ast_503.Parsetree.Pexp_try(copy_expressionx0,List.mapcopy_casex1)|Ast_504.Parsetree.Pexp_tuplex0->letexps=List.map(fun(label,exp)->(label,copy_expressionexp))x0inifList.exists(functionSome_,_->true|_->false)expsthenEncoding_504.To_503.encode_pexp_labeled_tuple~locexpselseAst_503.Parsetree.Pexp_tuple(List.mapsndexps)|Ast_504.Parsetree.Pexp_construct(x0,x1)->Ast_503.Parsetree.Pexp_construct(copy_loccopy_Longident_tx0,Option.mapcopy_expressionx1)|Ast_504.Parsetree.Pexp_variant(x0,x1)->Ast_503.Parsetree.Pexp_variant(copy_labelx0,Option.mapcopy_expressionx1)|Ast_504.Parsetree.Pexp_record(x0,x1)->Ast_503.Parsetree.Pexp_record(List.map(funx->letx0,x1=xin(copy_loccopy_Longident_tx0,copy_expressionx1))x0,Option.mapcopy_expressionx1)|Ast_504.Parsetree.Pexp_field(x0,x1)->Ast_503.Parsetree.Pexp_field(copy_expressionx0,copy_loccopy_Longident_tx1)|Ast_504.Parsetree.Pexp_setfield(x0,x1,x2)->Ast_503.Parsetree.Pexp_setfield(copy_expressionx0,copy_loccopy_Longident_tx1,copy_expressionx2)|Ast_504.Parsetree.Pexp_arrayx0->Ast_503.Parsetree.Pexp_array(List.mapcopy_expressionx0)|Ast_504.Parsetree.Pexp_ifthenelse(x0,x1,x2)->Ast_503.Parsetree.Pexp_ifthenelse(copy_expressionx0,copy_expressionx1,Option.mapcopy_expressionx2)|Ast_504.Parsetree.Pexp_sequence(x0,x1)->Ast_503.Parsetree.Pexp_sequence(copy_expressionx0,copy_expressionx1)|Ast_504.Parsetree.Pexp_while(x0,x1)->Ast_503.Parsetree.Pexp_while(copy_expressionx0,copy_expressionx1)|Ast_504.Parsetree.Pexp_for(x0,x1,x2,x3,x4)->Ast_503.Parsetree.Pexp_for(copy_patternx0,copy_expressionx1,copy_expressionx2,copy_direction_flagx3,copy_expressionx4)|Ast_504.Parsetree.Pexp_constraint(x0,x1)->Ast_503.Parsetree.Pexp_constraint(copy_expressionx0,copy_core_typex1)|Ast_504.Parsetree.Pexp_coerce(x0,x1,x2)->Ast_503.Parsetree.Pexp_coerce(copy_expressionx0,Option.mapcopy_core_typex1,copy_core_typex2)|Ast_504.Parsetree.Pexp_send(x0,x1)->Ast_503.Parsetree.Pexp_send(copy_expressionx0,copy_loccopy_labelx1)|Ast_504.Parsetree.Pexp_newx0->Ast_503.Parsetree.Pexp_new(copy_loccopy_Longident_tx0)|Ast_504.Parsetree.Pexp_setinstvar(x0,x1)->Ast_503.Parsetree.Pexp_setinstvar(copy_loccopy_labelx0,copy_expressionx1)|Ast_504.Parsetree.Pexp_overridex0->Ast_503.Parsetree.Pexp_override(List.map(funx->letx0,x1=xin(copy_loccopy_label x0,copy_expressionx1))x0)|Ast_504.Parsetree.Pexp_letmodule(x0,x1,x2)->Ast_503.Parsetree.Pexp_letmodule(copy_loc(funx->Option.map(funx->x)x)x0,copy_module_exprx1,copy_expressionx2)|Ast_504.Parsetree.Pexp_letexception(x0,x1)->Ast_503.Parsetree.Pexp_letexception(copy_extension_constructorx0,copy_expressionx1)|Ast_504.Parsetree.Pexp_assertx0->Ast_503.Parsetree.Pexp_assert(copy_expressionx0)|Ast_504.Parsetree.Pexp_lazyx0->Ast_503.Parsetree.Pexp_lazy(copy_expressionx0)|Ast_504.Parsetree.Pexp_poly(x0,x1)->Ast_503.Parsetree.Pexp_poly(copy_expressionx0,Option.mapcopy_core_typex1)|Ast_504.Parsetree.Pexp_objectx0->Ast_503.Parsetree.Pexp_object(copy_class_structurex0)|Ast_504.Parsetree.Pexp_newtype(x0,x1)->Ast_503.Parsetree.Pexp_newtype(copy_loc(funx->x)x0,copy_expressionx1)|Ast_504.Parsetree.Pexp_pack(x0,Somec)->letmodule_exp=Ast_503.Parsetree.Pexp_pack(copy_module_exprx0)inletpackage=Ast_503.Parsetree.Ptyp_package(copy_package_typec)inletexp:Ast_503.Parsetree.expression={pexp_desc=module_exp;pexp_loc=Location.none;pexp_loc_stack=[];pexp_attributes=[];}inletct:Ast_503.Parsetree.core_type={ptyp_desc=package;ptyp_loc=Location.none;ptyp_loc_stack=[];ptyp_attributes=[];}inAst_503.Parsetree.Pexp_constraint(exp,ct)|Ast_504.Parsetree.Pexp_pack(x0,None)->Ast_503.Parsetree.Pexp_pack(copy_module_exprx0)|Ast_504.Parsetree.Pexp_open(x0,x1)->Ast_503.Parsetree.Pexp_open(copy_open_declarationx0,copy_expressionx1)|Ast_504.Parsetree.Pexp_letopx0->Ast_503.Parsetree.Pexp_letop(copy_letopx0)|Ast_504.Parsetree.Pexp_extensionx0->Ast_503.Parsetree.Pexp_extension(copy_extensionx0)|Ast_504.Parsetree.Pexp_unreachable->Ast_503.Parsetree.Pexp_unreachableandcopy_letop:Ast_504.Parsetree.letop->Ast_503.Parsetree.letop=fun{Ast_504.Parsetree.let_;Ast_504.Parsetree.ands;Ast_504.Parsetree.body}->{Ast_503.Parsetree.let_=copy_binding_oplet_;Ast_503.Parsetree.ands=List.mapcopy_binding_opands;Ast_503.Parsetree.body=copy_expression body;}andcopy_binding_op:Ast_504.Parsetree.binding_op->Ast_503.Parsetree.binding_op=fun{Ast_504.Parsetree.pbop_op;Ast_504.Parsetree.pbop_pat;Ast_504.Parsetree.pbop_exp;Ast_504.Parsetree.pbop_loc;}->{Ast_503.Parsetree.pbop_op=copy_loc(funx->x)pbop_op;Ast_503.Parsetree.pbop_pat=copy_patternpbop_pat;Ast_503.Parsetree.pbop_exp=copy_expressionpbop_exp;Ast_503.Parsetree.pbop_loc=copy_locationpbop_loc;}andcopy_function_param_desc:Ast_504.Parsetree.function_param_desc->Ast_503.Parsetree.function_param_desc=function|Ast_504.Parsetree.Pparam_val(l,e,p)->Ast_503.Parsetree.Pparam_val(copy_arg_labell,Option.mapcopy_expressione,copy_patternp)|Ast_504.Parsetree.Pparam_newtypex->Ast_503.Parsetree.Pparam_newtype(copy_loc(funx->x)x)andcopy_function_param:Ast_504.Parsetree.function_param->Ast_503.Parsetree.function_param=fun{Ast_504.Parsetree.pparam_loc;pparam_desc}->{Ast_503.Parsetree.pparam_loc=copy_locationpparam_loc;pparam_desc=copy_function_param_descpparam_desc;}andcopy_function_body:Ast_504.Parsetree.function_body ->Ast_503.Parsetree.function_body =function|Ast_504.Parsetree.Pfunction_bodye->Ast_503.Parsetree.Pfunction_body(copy_expressione)|Ast_504.Parsetree.Pfunction_cases(cases,loc,attributes)->Ast_503.Parsetree.Pfunction_cases(List.mapcopy_casecases,copy_locationloc,copy_attributesattributes)and copy_type_constraint:Ast_504.Parsetree.type_constraint->Ast_503.Parsetree.type_constraint=function|Ast_504.Parsetree.Pconstraintt->Ast_503.Parsetree.Pconstraint(copy_core_typet)|Ast_504.Parsetree.Pcoerce(t1,t2)->Ast_503.Parsetree.Pcoerce(Option.mapcopy_core_typet1,copy_core_typet2)andcopy_direction_flag:Ast_504.Asttypes.direction_flag->Ast_503.Asttypes.direction_flag =function|Ast_504.Asttypes.Upto->Ast_503.Asttypes.Upto|Ast_504.Asttypes.Downto->Ast_503.Asttypes.Downtoandcopy_case:Ast_504.Parsetree.case->Ast_503.Parsetree.case=fun{Ast_504.Parsetree.pc_lhs;Ast_504.Parsetree.pc_guard;Ast_504.Parsetree.pc_rhs;}->{Ast_503.Parsetree.pc_lhs=copy_patternpc_lhs;Ast_503.Parsetree.pc_guard=Option.mapcopy_expressionpc_guard;Ast_503.Parsetree.pc_rhs=copy_expressionpc_rhs;}andcopy_value_binding:Ast_504.Parsetree.value_binding ->Ast_503.Parsetree.value_binding =fun{Ast_504.Parsetree.pvb_pat;Ast_504.Parsetree.pvb_expr;Ast_504.Parsetree.pvb_constraint;Ast_504.Parsetree.pvb_attributes;Ast_504.Parsetree.pvb_loc;}->{Ast_503.Parsetree.pvb_pat=copy_patternpvb_pat;Ast_503.Parsetree.pvb_expr=copy_expressionpvb_expr;Ast_503.Parsetree.pvb_constraint=Option.mapcopy_value_constraintpvb_constraint;Ast_503.Parsetree.pvb_attributes=copy_attributespvb_attributes;Ast_503.Parsetree.pvb_loc=copy_locationpvb_loc;}andcopy_pattern:Ast_504.Parsetree.pattern->Ast_503.Parsetree.pattern=fun{Ast_504.Parsetree.ppat_desc;Ast_504.Parsetree.ppat_loc;Ast_504.Parsetree.ppat_loc_stack;Ast_504.Parsetree.ppat_attributes;}->letppat_loc=copy_location ppat_locin{Ast_503.Parsetree.ppat_desc=copy_pattern_descppat_locppat_desc;Ast_503.Parsetree.ppat_loc;Ast_503.Parsetree.ppat_loc_stack =copy_location_stackppat_loc_stack;Ast_503.Parsetree.ppat_attributes=copy_attributesppat_attributes;}andcopy_pattern_descloc:Ast_504.Parsetree.pattern_desc->Ast_503.Parsetree.pattern_desc=function|Ast_504.Parsetree.Ppat_any->Ast_503.Parsetree.Ppat_any|Ast_504.Parsetree.Ppat_varx0->Ast_503.Parsetree.Ppat_var(copy_loc(funx->x)x0)|Ast_504.Parsetree.Ppat_alias(x0,x1)->Ast_503.Parsetree.Ppat_alias(copy_patternx0,copy_loc(funx->x)x1)|Ast_504.Parsetree.Ppat_constantx0->Ast_503.Parsetree.Ppat_constant(copy_constantx0)|Ast_504.Parsetree.Ppat_interval(x0,x1)->Ast_503.Parsetree.Ppat_interval(copy_constantx0,copy_constantx1)|Ast_504.Parsetree.Ppat_tuple(x0,flag)->(letflag=copy_closed_flagflaginletargs=List.map(fun(lbl,pat)->(lbl,copy_pattern pat))x0inlethas_label=List.exists(functionSome_,_->true|_->false)argsinmatch(has_label,flag)with|true,_|false,Open->Encoding_504.To_503.encode_ppat_labeled_tuple~locargsflag|_,_->Ast_503.Parsetree.Ppat_tuple(List.mapsndargs))|Ast_504.Parsetree.Ppat_construct (x0,x1)->Ast_503.Parsetree.Ppat_construct(copy_loccopy_Longident_tx0,Option.map(funx->letx0,x1=xin(List.map(funx->copy_loc(funx->x)x)x0,copy_patternx1))x1)|Ast_504.Parsetree.Ppat_variant(x0,x1)->Ast_503.Parsetree.Ppat_variant(copy_labelx0,Option.mapcopy_patternx1)|Ast_504.Parsetree.Ppat_record(x0,x1)->Ast_503.Parsetree.Ppat_record(List.map(funx->letx0,x1=xin(copy_loccopy_Longident_tx0,copy_patternx1))x0,copy_closed_flagx1)|Ast_504.Parsetree.Ppat_arrayx0->Ast_503.Parsetree.Ppat_array(List.mapcopy_patternx0)|Ast_504.Parsetree.Ppat_or(x0,x1)->Ast_503.Parsetree.Ppat_or(copy_patternx0,copy_patternx1)|Ast_504.Parsetree.Ppat_constraint(x0,x1)->Ast_503.Parsetree.Ppat_constraint(copy_patternx0,copy_core_typex1)|Ast_504.Parsetree.Ppat_typex0->Ast_503.Parsetree.Ppat_type(copy_loccopy_Longident_tx0)|Ast_504.Parsetree.Ppat_lazyx0->Ast_503.Parsetree.Ppat_lazy(copy_patternx0)|Ast_504.Parsetree.Ppat_unpackx0->Ast_503.Parsetree.Ppat_unpack(copy_loc(funx->Option.map(funx->x)x)x0)|Ast_504.Parsetree.Ppat_exceptionx0->Ast_503.Parsetree.Ppat_exception(copy_patternx0)|Ast_504.Parsetree.Ppat_effect(e,c)->Ast_503.Parsetree.Ppat_effect(copy_patterne,copy_patternc)|Ast_504.Parsetree.Ppat_extensionx0->Ast_503.Parsetree.Ppat_extension(copy_extensionx0)|Ast_504.Parsetree.Ppat_open(x0,x1)->Ast_503.Parsetree.Ppat_open(copy_loccopy_Longident_tx0,copy_patternx1)andcopy_value_constraint:Ast_504.Parsetree.value_constraint->Ast_503.Parsetree.value_constraint=function|Ast_504.Parsetree.Pvc_constraint{locally_abstract_univars;typ}->Ast_503.Parsetree.Pvc_constraint{locally_abstract_univars=List.map(copy_loc(funx->x))locally_abstract_univars;typ=copy_core_typetyp;}|Ast_504.Parsetree.Pvc_coercion{ground;coercion}->Ast_503.Parsetree.Pvc_coercion{ground=Option.mapcopy_core_typeground;coercion=copy_core_typecoercion;}andcopy_core_type:Ast_504.Parsetree.core_type->Ast_503.Parsetree.core_type=fun{Ast_504.Parsetree.ptyp_desc;Ast_504.Parsetree.ptyp_loc;Ast_504.Parsetree.ptyp_loc_stack;Ast_504.Parsetree.ptyp_attributes;}->letloc=copy_location ptyp_locin{Ast_503.Parsetree.ptyp_desc=copy_core_type_desc~locptyp_desc;Ast_503.Parsetree.ptyp_loc=loc;Ast_503.Parsetree.ptyp_loc_stack=copy_location_stackptyp_loc_stack;Ast_503.Parsetree.ptyp_attributes=copy_attributesptyp_attributes;}andcopy_location_stack:Ast_504.Parsetree.location_stack->Ast_503.Parsetree.location_stack=funx->List.mapcopy_location xandcopy_core_type_desc~loc:Ast_504.Parsetree.core_type_desc->Ast_503.Parsetree.core_type_desc=function|Ast_504.Parsetree.Ptyp_any->Ast_503.Parsetree.Ptyp_any|Ast_504.Parsetree.Ptyp_varx0->Ast_503.Parsetree.Ptyp_varx0|Ast_504.Parsetree.Ptyp_arrow(x0,x1,x2)->Ast_503.Parsetree.Ptyp_arrow(copy_arg_labelx0,copy_core_typex1,copy_core_typex2)|Ast_504.Parsetree.Ptyp_tuplex0->lettyps=List.map(fun(label,typ)->(label,copy_core_typetyp))x0inifList.exists(functionSome_,_->true|_->false)typsthen(* At least one element of the tuple is labeled *)Encoding_504.To_503.encode_ptyp_labeled_tuple~loctypselseAst_503.Parsetree.Ptyp_tuple(List.mapsndtyps)|Ast_504.Parsetree.Ptyp_constr(x0,x1)->Ast_503.Parsetree.Ptyp_constr(copy_loccopy_Longident_tx0,List.mapcopy_core_typex1)|Ast_504.Parsetree.Ptyp_object(x0,x1)->Ast_503.Parsetree.Ptyp_object(List.mapcopy_object_fieldx0,copy_closed_flagx1)|Ast_504.Parsetree.Ptyp_class(x0,x1)->Ast_503.Parsetree.Ptyp_class(copy_loccopy_Longident_tx0,List.mapcopy_core_typex1)|Ast_504.Parsetree.Ptyp_alias(x0,x1)->Ast_503.Parsetree.Ptyp_alias(copy_core_typex0,copy_loc(funx->x)x1)|Ast_504.Parsetree.Ptyp_variant(x0,x1,x2)->Ast_503.Parsetree.Ptyp_variant(List.mapcopy_row_fieldx0,copy_closed_flag x1,Option.map(funx->List.mapcopy_labelx)x2)|Ast_504.Parsetree.Ptyp_poly(x0,x1)->Ast_503.Parsetree.Ptyp_poly(List.map(funx->copy_loc(funx->x)x)x0,copy_core_typex1)|Ast_504.Parsetree.Ptyp_packagex0->Ast_503.Parsetree.Ptyp_package(copy_package_typex0)|Ast_504.Parsetree.Ptyp_open(x0,ty)->Ast_503.Parsetree.Ptyp_open(copy_loccopy_Longident_tx0,copy_core_typety)|Ast_504.Parsetree.Ptyp_extensionx0->Ast_503.Parsetree.Ptyp_extension(copy_extensionx0)andcopy_package_type:Ast_504.Parsetree.package_type ->Ast_503.Parsetree.package_type=fun{ppt_path;ppt_cstrs;ppt_loc =_;ppt_attrs =_}->(copy_loccopy_Longident_tppt_path,List.map(funx->letx0,x1=xin(copy_loccopy_Longident_tx0,copy_core_typex1))ppt_cstrs)andcopy_row_field:Ast_504.Parsetree.row_field->Ast_503.Parsetree.row_field=fun{Ast_504.Parsetree.prf_desc;Ast_504.Parsetree.prf_loc;Ast_504.Parsetree.prf_attributes;}->{Ast_503.Parsetree.prf_desc=copy_row_field_descprf_desc;Ast_503.Parsetree.prf_loc=copy_locationprf_loc;Ast_503.Parsetree.prf_attributes=copy_attributesprf_attributes;}andcopy_row_field_desc:Ast_504.Parsetree.row_field_desc->Ast_503.Parsetree.row_field_desc=function|Ast_504.Parsetree.Rtag(x0,x1,x2)->Ast_503.Parsetree.Rtag(copy_loccopy_labelx0,x1,List.mapcopy_core_typex2)|Ast_504.Parsetree.Rinheritx0->Ast_503.Parsetree.Rinherit(copy_core_typex0)andcopy_object_field:Ast_504.Parsetree.object_field ->Ast_503.Parsetree.object_field=fun{Ast_504.Parsetree.pof_desc;Ast_504.Parsetree.pof_loc;Ast_504.Parsetree.pof_attributes;}->{Ast_503.Parsetree.pof_desc=copy_object_field_descpof_desc;Ast_503.Parsetree.pof_loc=copy_locationpof_loc;Ast_503.Parsetree.pof_attributes=copy_attributespof_attributes;}andcopy_attributes:Ast_504.Parsetree.attributes->Ast_503.Parsetree.attributes=funx->List.mapcopy_attribute xandcopy_attribute:Ast_504.Parsetree.attribute->Ast_503.Parsetree.attribute=fun{Ast_504.Parsetree.attr_name;Ast_504.Parsetree.attr_payload;Ast_504.Parsetree.attr_loc;}->{Ast_503.Parsetree.attr_name=copy_loc(funx->x)attr_name;Ast_503.Parsetree.attr_payload =copy_payloadattr_payload;Ast_503.Parsetree.attr_loc=copy_locationattr_loc;}andcopy_payload:Ast_504.Parsetree.payload->Ast_503.Parsetree.payload=function|Ast_504.Parsetree.PStrx0->Ast_503.Parsetree.PStr(copy_structurex0)|Ast_504.Parsetree.PSigx0->Ast_503.Parsetree.PSig(copy_signaturex0)|Ast_504.Parsetree.PTypx0->Ast_503.Parsetree.PTyp(copy_core_typex0)|Ast_504.Parsetree.PPat(x0,x1)->Ast_503.Parsetree.PPat(copy_patternx0,Option.mapcopy_expressionx1)andcopy_structure :Ast_504.Parsetree.structure->Ast_503.Parsetree.structure=funx->List.mapcopy_structure_itemxandcopy_structure_item :Ast_504.Parsetree.structure_item->Ast_503.Parsetree.structure_item=fun{Ast_504.Parsetree.pstr_desc;Ast_504.Parsetree.pstr_loc}->letloc=copy_locationpstr_locin{Ast_503.Parsetree.pstr_desc=copy_structure_item_desc_with_loc~locpstr_desc;Ast_503.Parsetree.pstr_loc=loc;}andcopy_structure_item_desc_with_loc~loc:Ast_504.Parsetree.structure_item_desc->Ast_503.Parsetree.structure_item_desc=function|Ast_504.Parsetree.Pstr_eval(x0,x1)->Ast_503.Parsetree.Pstr_eval(copy_expressionx0,copy_attributesx1)|Ast_504.Parsetree.Pstr_value(x0,x1)->Ast_503.Parsetree.Pstr_value(copy_rec_flagx0,List.mapcopy_value_bindingx1)|Ast_504.Parsetree.Pstr_primitivex0->Ast_503.Parsetree.Pstr_primitive(copy_value_descriptionx0)|Ast_504.Parsetree.Pstr_type(x0,x1)->letrec_flag=copy_rec_flagx0inletcontains_bivariant,tds=Bivariant_param.list_map ~f:copy_type_declaration_x1inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_pstr_type~locrec_flagtdselseAst_503.Parsetree.Pstr_type (rec_flag,tds)|Ast_504.Parsetree.Pstr_typextx0->letcontains_bivariant,ty_ext=copy_type_extension_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_pstr_typext~locty_extelseAst_503.Parsetree.Pstr_typextty_ext|Ast_504.Parsetree.Pstr_exceptionx0->Ast_503.Parsetree.Pstr_exception(copy_type_exceptionx0)|Ast_504.Parsetree.Pstr_modulex0->Ast_503.Parsetree.Pstr_module(copy_module_bindingx0)|Ast_504.Parsetree.Pstr_recmodulex0->Ast_503.Parsetree.Pstr_recmodule(List.mapcopy_module_bindingx0)|Ast_504.Parsetree.Pstr_modtypex0->Ast_503.Parsetree.Pstr_modtype(copy_module_type_declarationx0)|Ast_504.Parsetree.Pstr_openx0->Ast_503.Parsetree.Pstr_open(copy_open_declarationx0)|Ast_504.Parsetree.Pstr_classx0->letcontains_bivariant,cds=Bivariant_param.list_map ~f:copy_class_declaration_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_pstr_class~loccdselseAst_503.Parsetree.Pstr_class cds|Ast_504.Parsetree.Pstr_class_typex0->letcontains_bivariant,ctds=Bivariant_param.list_map ~f:copy_class_type_declaration_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_pstr_class_type~locctdselseAst_503.Parsetree.Pstr_class_typectds|Ast_504.Parsetree.Pstr_includex0->Ast_503.Parsetree.Pstr_include(copy_include_declarationx0)|Ast_504.Parsetree.Pstr_attributex0->Ast_503.Parsetree.Pstr_attribute(copy_attributex0)|Ast_504.Parsetree.Pstr_extension(x0,x1)->Ast_503.Parsetree.Pstr_extension(copy_extensionx0,copy_attributesx1)andcopy_include_declaration:Ast_504.Parsetree.include_declaration->Ast_503.Parsetree.include_declaration=funx->copy_include_infoscopy_module_exprxandcopy_class_declaration_:Ast_504.Parsetree.class_declaration->bool*Ast_503.Parsetree.class_declaration=funx->copy_class_infos_copy_class_exprxandcopy_class_expr:Ast_504.Parsetree.class_expr->Ast_503.Parsetree.class_expr=fun{Ast_504.Parsetree.pcl_desc;Ast_504.Parsetree.pcl_loc;Ast_504.Parsetree.pcl_attributes;}->{Ast_503.Parsetree.pcl_desc=copy_class_expr_descpcl_desc;Ast_503.Parsetree.pcl_loc=copy_locationpcl_loc;Ast_503.Parsetree.pcl_attributes=copy_attributespcl_attributes;}andcopy_class_expr_desc:Ast_504.Parsetree.class_expr_desc->Ast_503.Parsetree.class_expr_desc=function|Ast_504.Parsetree.Pcl_constr(x0,x1)->Ast_503.Parsetree.Pcl_constr(copy_loccopy_Longident_tx0,List.mapcopy_core_typex1)|Ast_504.Parsetree.Pcl_structurex0->Ast_503.Parsetree.Pcl_structure(copy_class_structurex0)|Ast_504.Parsetree.Pcl_fun(x0,x1,x2,x3)->Ast_503.Parsetree.Pcl_fun(copy_arg_labelx0,Option.mapcopy_expressionx1,copy_pattern x2,copy_class_exprx3)|Ast_504.Parsetree.Pcl_apply(x0,x1)->Ast_503.Parsetree.Pcl_apply(copy_class_exprx0,List.map(funx->letx0,x1=xin(copy_arg_labelx0,copy_expressionx1))x1)|Ast_504.Parsetree.Pcl_let(x0,x1,x2)->Ast_503.Parsetree.Pcl_let(copy_rec_flagx0,List.mapcopy_value_bindingx1,copy_class_exprx2)|Ast_504.Parsetree.Pcl_constraint(x0,x1)->Ast_503.Parsetree.Pcl_constraint(copy_class_exprx0,copy_class_typex1)|Ast_504.Parsetree.Pcl_extensionx0->Ast_503.Parsetree.Pcl_extension(copy_extensionx0)|Ast_504.Parsetree.Pcl_open(x0,x1)->Ast_503.Parsetree.Pcl_open(copy_open_descriptionx0,copy_class_exprx1)andcopy_class_structure:Ast_504.Parsetree.class_structure->Ast_503.Parsetree.class_structure=fun{Ast_504.Parsetree.pcstr_self;Ast_504.Parsetree.pcstr_fields}->{Ast_503.Parsetree.pcstr_self=copy_patternpcstr_self;Ast_503.Parsetree.pcstr_fields=List.mapcopy_class_fieldpcstr_fields;}andcopy_class_field:Ast_504.Parsetree.class_field->Ast_503.Parsetree.class_field =fun{Ast_504.Parsetree.pcf_desc;Ast_504.Parsetree.pcf_loc;Ast_504.Parsetree.pcf_attributes;}->{Ast_503.Parsetree.pcf_desc=copy_class_field_descpcf_desc;Ast_503.Parsetree.pcf_loc=copy_locationpcf_loc;Ast_503.Parsetree.pcf_attributes=copy_attributespcf_attributes;}andcopy_class_field_desc:Ast_504.Parsetree.class_field_desc->Ast_503.Parsetree.class_field_desc=function|Ast_504.Parsetree.Pcf_inherit(x0,x1,x2)->Ast_503.Parsetree.Pcf_inherit(copy_override_flagx0,copy_class_exprx1,Option.map(funx->copy_loc(funx->x)x)x2)|Ast_504.Parsetree.Pcf_valx0->Ast_503.Parsetree.Pcf_val(letx0,x1,x2=x0in(copy_loccopy_labelx0,copy_mutable_flagx1,copy_class_field_kindx2))|Ast_504.Parsetree.Pcf_methodx0->Ast_503.Parsetree.Pcf_method(letx0,x1,x2=x0in(copy_loccopy_labelx0,copy_private_flagx1,copy_class_field_kindx2))|Ast_504.Parsetree.Pcf_constraintx0->Ast_503.Parsetree.Pcf_constraint(letx0,x1=x0in(copy_core_typex0,copy_core_typex1))|Ast_504.Parsetree.Pcf_initializerx0->Ast_503.Parsetree.Pcf_initializer(copy_expressionx0)|Ast_504.Parsetree.Pcf_attributex0->Ast_503.Parsetree.Pcf_attribute(copy_attributex0)|Ast_504.Parsetree.Pcf_extensionx0->Ast_503.Parsetree.Pcf_extension(copy_extensionx0)andcopy_class_field_kind:Ast_504.Parsetree.class_field_kind->Ast_503.Parsetree.class_field_kind=function|Ast_504.Parsetree.Cfk_virtualx0->Ast_503.Parsetree.Cfk_virtual(copy_core_typex0)|Ast_504.Parsetree.Cfk_concrete(x0,x1)->Ast_503.Parsetree.Cfk_concrete(copy_override_flagx0,copy_expressionx1)andcopy_open_declaration:Ast_504.Parsetree.open_declaration->Ast_503.Parsetree.open_declaration=funx->copy_open_infoscopy_module_exprxandcopy_module_binding:Ast_504.Parsetree.module_binding->Ast_503.Parsetree.module_binding=fun{Ast_504.Parsetree.pmb_name;Ast_504.Parsetree.pmb_expr;Ast_504.Parsetree.pmb_attributes;Ast_504.Parsetree.pmb_loc;}->{Ast_503.Parsetree.pmb_name=copy_loc(funx->Option.map(funx->x)x)pmb_name;Ast_503.Parsetree.pmb_expr=copy_module_exprpmb_expr;Ast_503.Parsetree.pmb_attributes=copy_attributespmb_attributes;Ast_503.Parsetree.pmb_loc=copy_locationpmb_loc;}andcopy_module_expr:Ast_504.Parsetree.module_expr->Ast_503.Parsetree.module_expr =fun{Ast_504.Parsetree.pmod_desc;Ast_504.Parsetree.pmod_loc;Ast_504.Parsetree.pmod_attributes;}->{Ast_503.Parsetree.pmod_desc=copy_module_expr_descpmod_desc;Ast_503.Parsetree.pmod_loc=copy_locationpmod_loc;Ast_503.Parsetree.pmod_attributes=copy_attributespmod_attributes;}andcopy_module_expr_desc:Ast_504.Parsetree.module_expr_desc->Ast_503.Parsetree.module_expr_desc=function|Ast_504.Parsetree.Pmod_identx0->Ast_503.Parsetree.Pmod_ident(copy_loccopy_Longident_tx0)|Ast_504.Parsetree.Pmod_structurex0->Ast_503.Parsetree.Pmod_structure(copy_structurex0)|Ast_504.Parsetree.Pmod_functor(x0,x1)->Ast_503.Parsetree.Pmod_functor(copy_functor_parameterx0,copy_module_exprx1)|Ast_504.Parsetree.Pmod_apply(x0,x1)->Ast_503.Parsetree.Pmod_apply(copy_module_exprx0,copy_module_exprx1)|Ast_504.Parsetree.Pmod_apply_unitx0->Ast_503.Parsetree.Pmod_apply_unit(copy_module_exprx0)|Ast_504.Parsetree.Pmod_constraint(x0,x1)->Ast_503.Parsetree.Pmod_constraint(copy_module_exprx0,copy_module_typex1)|Ast_504.Parsetree.Pmod_unpackx0->Ast_503.Parsetree.Pmod_unpack(copy_expressionx0)|Ast_504.Parsetree.Pmod_extensionx0->Ast_503.Parsetree.Pmod_extension(copy_extensionx0)andcopy_functor_parameter:Ast_504.Parsetree.functor_parameter->Ast_503.Parsetree.functor_parameter=function|Ast_504.Parsetree.Unit->Ast_503.Parsetree.Unit|Ast_504.Parsetree.Named(x0,x1)->Ast_503.Parsetree.Named(copy_loc(funx->Option.map(funx->x)x)x0,copy_module_typex1)andcopy_module_type:Ast_504.Parsetree.module_type->Ast_503.Parsetree.module_type =fun{Ast_504.Parsetree.pmty_desc;Ast_504.Parsetree.pmty_loc;Ast_504.Parsetree.pmty_attributes;}->letloc=copy_location pmty_locin{Ast_503.Parsetree.pmty_desc=copy_module_type_desc_with_loc~locpmty_desc;Ast_503.Parsetree.pmty_loc=loc;Ast_503.Parsetree.pmty_attributes=copy_attributespmty_attributes;}andcopy_module_type_desc_with_loc~loc:Ast_504.Parsetree.module_type_desc ->Ast_503.Parsetree.module_type_desc =function|Ast_504.Parsetree.Pmty_identx0->Ast_503.Parsetree.Pmty_ident(copy_loccopy_Longident_tx0)|Ast_504.Parsetree.Pmty_signaturex0->Ast_503.Parsetree.Pmty_signature(copy_signaturex0)|Ast_504.Parsetree.Pmty_functor(x0,x1)->Ast_503.Parsetree.Pmty_functor(copy_functor_parameterx0,copy_module_typex1)|Ast_504.Parsetree.Pmty_with(x0,x1)->letmty=copy_module_typex0inletcontains_bivariant,constraints=Bivariant_param.list_map ~f:copy_with_constraint_x1inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_pmty_with~locmtyconstraintselseAst_503.Parsetree.Pmty_with(copy_module_typex0,constraints)|Ast_504.Parsetree.Pmty_typeofx0->Ast_503.Parsetree.Pmty_typeof(copy_module_exprx0)|Ast_504.Parsetree.Pmty_extensionx0->Ast_503.Parsetree.Pmty_extension(copy_extensionx0)|Ast_504.Parsetree.Pmty_aliasx0->Ast_503.Parsetree.Pmty_alias(copy_loccopy_Longident_tx0)andcopy_with_constraint_:Ast_504.Parsetree.with_constraint->bool*Ast_503.Parsetree.with_constraint=function|Ast_504.Parsetree.Pwith_type(x0,x1)->letlident_loc=copy_loccopy_Longident_tx0inletcontains_bivariant,td=copy_type_declaration_x1in(contains_bivariant,Ast_503.Parsetree.Pwith_type(lident_loc,td))|Ast_504.Parsetree.Pwith_module(x0,x1)->(false,Ast_503.Parsetree.Pwith_module(copy_loccopy_Longident_tx0,copy_loccopy_Longident_tx1))|Ast_504.Parsetree.Pwith_modtype(x0,x1)->(false,Ast_503.Parsetree.Pwith_modtype(copy_loccopy_Longident_tx0,copy_module_typex1))|Ast_504.Parsetree.Pwith_modtypesubst(x0,x1)->(false,Ast_503.Parsetree.Pwith_modtypesubst(copy_loccopy_Longident_tx0,copy_module_typex1))|Ast_504.Parsetree.Pwith_typesubst(x0,x1)->letlident_loc=copy_loccopy_Longident_tx0inletcontains_bivariant,td=copy_type_declaration_x1in(contains_bivariant,Ast_503.Parsetree.Pwith_typesubst(lident_loc,td))|Ast_504.Parsetree.Pwith_modsubst(x0,x1)->(false,Ast_503.Parsetree.Pwith_modsubst(copy_loccopy_Longident_tx0,copy_loccopy_Longident_tx1))andcopy_signature:Ast_504.Parsetree.signature->Ast_503.Parsetree.signature=funx->List.mapcopy_signature_itemxandcopy_signature_item :Ast_504.Parsetree.signature_item->Ast_503.Parsetree.signature_item=fun{Ast_504.Parsetree.psig_desc;Ast_504.Parsetree.psig_loc}->letloc=copy_locationpsig_locin{Ast_503.Parsetree.psig_desc=copy_signature_item_desc_with_loc~locpsig_desc;Ast_503.Parsetree.psig_loc=loc;}andcopy_signature_item_desc_with_loc~loc:Ast_504.Parsetree.signature_item_desc->Ast_503.Parsetree.signature_item_desc=function|Ast_504.Parsetree.Psig_valuex0->Ast_503.Parsetree.Psig_value(copy_value_descriptionx0)|Ast_504.Parsetree.Psig_type(x0,x1)->letrec_flag=copy_rec_flagx0inletcontains_bivariant,tds=Bivariant_param.list_map ~f:copy_type_declaration_x1inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_psig_type~locrec_flagtdselseAst_503.Parsetree.Psig_type (rec_flag,tds)|Ast_504.Parsetree.Psig_typesubstx0->letcontains_bivariant,tds=Bivariant_param.list_map ~f:copy_type_declaration_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_psig_typesubst~loctdselseAst_503.Parsetree.Psig_typesubst tds|Ast_504.Parsetree.Psig_typextx0->letcontains_bivariant,ty_ext=copy_type_extension_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_psig_typext~locty_extelseAst_503.Parsetree.Psig_typextty_ext|Ast_504.Parsetree.Psig_exceptionx0->Ast_503.Parsetree.Psig_exception(copy_type_exceptionx0)|Ast_504.Parsetree.Psig_modulex0->Ast_503.Parsetree.Psig_module(copy_module_declarationx0)|Ast_504.Parsetree.Psig_modsubstx0->Ast_503.Parsetree.Psig_modsubst(copy_module_substitutionx0)|Ast_504.Parsetree.Psig_recmodulex0->Ast_503.Parsetree.Psig_recmodule(List.mapcopy_module_declarationx0)|Ast_504.Parsetree.Psig_modtypex0->Ast_503.Parsetree.Psig_modtype(copy_module_type_declarationx0)|Ast_504.Parsetree.Psig_modtypesubstx0->Ast_503.Parsetree.Psig_modtypesubst(copy_module_type_declarationx0)|Ast_504.Parsetree.Psig_openx0->Ast_503.Parsetree.Psig_open(copy_open_descriptionx0)|Ast_504.Parsetree.Psig_includex0->Ast_503.Parsetree.Psig_include(copy_include_descriptionx0)|Ast_504.Parsetree.Psig_classx0->letcontains_bivariant,cds=Bivariant_param.list_map ~f:copy_class_description_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_psig_class~loccdselseAst_503.Parsetree.Psig_class cds|Ast_504.Parsetree.Psig_class_typex0->letcontains_bivariant,ctds=Bivariant_param.list_map ~f:copy_class_type_declaration_x0inifcontains_bivariantthenEncoding_504.To_503.encode_bivariant_psig_class_type~locctdselseAst_503.Parsetree.Psig_class_typectds|Ast_504.Parsetree.Psig_attributex0->Ast_503.Parsetree.Psig_attribute(copy_attributex0)|Ast_504.Parsetree.Psig_extension(x0,x1)->Ast_503.Parsetree.Psig_extension(copy_extensionx0,copy_attributesx1)andcopy_class_type_declaration_:Ast_504.Parsetree.class_type_declaration ->bool*Ast_503.Parsetree.class_type_declaration=funx->copy_class_infos_copy_class_typexandcopy_class_description_:Ast_504.Parsetree.class_description->bool*Ast_503.Parsetree.class_description=funx->copy_class_infos_copy_class_typexandcopy_class_type:Ast_504.Parsetree.class_type->Ast_503.Parsetree.class_type=fun{Ast_504.Parsetree.pcty_desc;Ast_504.Parsetree.pcty_loc;Ast_504.Parsetree.pcty_attributes;}->{Ast_503.Parsetree.pcty_desc=copy_class_type_descpcty_desc;Ast_503.Parsetree.pcty_loc=copy_locationpcty_loc;Ast_503.Parsetree.pcty_attributes=copy_attributespcty_attributes;}andcopy_class_type_desc:Ast_504.Parsetree.class_type_desc->Ast_503.Parsetree.class_type_desc=function|Ast_504.Parsetree.Pcty_constr(x0,x1)->Ast_503.Parsetree.Pcty_constr(copy_loccopy_Longident_tx0,List.mapcopy_core_typex1)|Ast_504.Parsetree.Pcty_signaturex0->Ast_503.Parsetree.Pcty_signature(copy_class_signaturex0)|Ast_504.Parsetree.Pcty_arrow(x0,x1,x2)->Ast_503.Parsetree.Pcty_arrow(copy_arg_labelx0,copy_core_typex1,copy_class_typex2)|Ast_504.Parsetree.Pcty_extensionx0->Ast_503.Parsetree.Pcty_extension(copy_extensionx0)|Ast_504.Parsetree.Pcty_open(x0,x1)->Ast_503.Parsetree.Pcty_open(copy_open_descriptionx0,copy_class_typex1)andcopy_class_signature:Ast_504.Parsetree.class_signature->Ast_503.Parsetree.class_signature=fun{Ast_504.Parsetree.pcsig_self;Ast_504.Parsetree.pcsig_fields}->{Ast_503.Parsetree.pcsig_self=copy_core_typepcsig_self;Ast_503.Parsetree.pcsig_fields=List.mapcopy_class_type_fieldpcsig_fields;}andcopy_class_type_field:Ast_504.Parsetree.class_type_field->Ast_503.Parsetree.class_type_field=fun{Ast_504.Parsetree.pctf_desc;Ast_504.Parsetree.pctf_loc;Ast_504.Parsetree.pctf_attributes;}->{Ast_503.Parsetree.pctf_desc=copy_class_type_field_descpctf_desc;Ast_503.Parsetree.pctf_loc=copy_locationpctf_loc;Ast_503.Parsetree.pctf_attributes=copy_attributespctf_attributes;}andcopy_class_type_field_desc:Ast_504.Parsetree.class_type_field_desc ->Ast_503.Parsetree.class_type_field_desc =function|Ast_504.Parsetree.Pctf_inheritx0->Ast_503.Parsetree.Pctf_inherit(copy_class_typex0)|Ast_504.Parsetree.Pctf_valx0->Ast_503.Parsetree.Pctf_val(letx0,x1,x2,x3=x0in(copy_loccopy_label x0,copy_mutable_flagx1,copy_virtual_flagx2,copy_core_typex3))|Ast_504.Parsetree.Pctf_methodx0->Ast_503.Parsetree.Pctf_method(letx0,x1,x2,x3=x0in(copy_loccopy_label x0,copy_private_flagx1,copy_virtual_flagx2,copy_core_typex3))|Ast_504.Parsetree.Pctf_constraintx0->Ast_503.Parsetree.Pctf_constraint(letx0,x1=x0in(copy_core_typex0,copy_core_typex1))|Ast_504.Parsetree.Pctf_attributex0->Ast_503.Parsetree.Pctf_attribute(copy_attributex0)|Ast_504.Parsetree.Pctf_extensionx0->Ast_503.Parsetree.Pctf_extension(copy_extensionx0)andcopy_extension:Ast_504.Parsetree.extension->Ast_503.Parsetree.extension=funx->letx0,x1=xin(copy_loc(funx-> x)x0,copy_payloadx1)andcopy_class_infos_:'f0'g0.('f0->'g0)->'f0Ast_504.Parsetree.class_infos->bool*'g0Ast_503.Parsetree.class_infos=funf0{Ast_504.Parsetree.pci_virt;Ast_504.Parsetree.pci_params;Ast_504.Parsetree.pci_name;Ast_504.Parsetree.pci_expr;Ast_504.Parsetree.pci_loc;Ast_504.Parsetree.pci_attributes;}->letcontains_bivariant,params=copy_type_paramspci_paramsinletci={Ast_503.Parsetree.pci_virt=copy_virtual_flagpci_virt;Ast_503.Parsetree.pci_params=params;Ast_503.Parsetree.pci_name=copy_loc(funx->x)pci_name;Ast_503.Parsetree.pci_expr=f0pci_expr;Ast_503.Parsetree.pci_loc=copy_locationpci_loc;Ast_503.Parsetree.pci_attributes =copy_attributespci_attributes;}in(contains_bivariant,ci)andcopy_virtual_flag:Ast_504.Asttypes.virtual_flag ->Ast_503.Asttypes.virtual_flag =function|Ast_504.Asttypes.Virtual->Ast_503.Asttypes.Virtual|Ast_504.Asttypes.Concrete->Ast_503.Asttypes.Concreteandcopy_include_description:Ast_504.Parsetree.include_description->Ast_503.Parsetree.include_description=funx->copy_include_infoscopy_module_typexandcopy_include_infos:'f0'g0.('f0->'g0)->'f0Ast_504.Parsetree.include_infos->'g0Ast_503.Parsetree.include_infos=funf0{Ast_504.Parsetree.pincl_mod;Ast_504.Parsetree.pincl_loc;Ast_504.Parsetree.pincl_attributes;}->{Ast_503.Parsetree.pincl_mod=f0pincl_mod;Ast_503.Parsetree.pincl_loc =copy_locationpincl_loc;Ast_503.Parsetree.pincl_attributes =copy_attributespincl_attributes;}andcopy_open_description:Ast_504.Parsetree.open_description->Ast_503.Parsetree.open_description=funx->copy_open_infos(funx->copy_loccopy_Longident_tx)xandcopy_open_infos:'f0'g0.('f0->'g0)->'f0Ast_504.Parsetree.open_infos->'g0Ast_503.Parsetree.open_infos=funf0{Ast_504.Parsetree.popen_expr;Ast_504.Parsetree.popen_override;Ast_504.Parsetree.popen_loc;Ast_504.Parsetree.popen_attributes;}->{Ast_503.Parsetree.popen_expr=f0popen_expr;Ast_503.Parsetree.popen_override=copy_override_flagpopen_override;Ast_503.Parsetree.popen_loc=copy_locationpopen_loc;Ast_503.Parsetree.popen_attributes =copy_attributespopen_attributes;}andcopy_override_flag:Ast_504.Asttypes.override_flag ->Ast_503.Asttypes.override_flag=function|Ast_504.Asttypes.Override->Ast_503.Asttypes.Override|Ast_504.Asttypes.Fresh->Ast_503.Asttypes.Freshandcopy_module_type_declaration:Ast_504.Parsetree.module_type_declaration ->Ast_503.Parsetree.module_type_declaration =fun{Ast_504.Parsetree.pmtd_name;Ast_504.Parsetree.pmtd_type;Ast_504.Parsetree.pmtd_attributes;Ast_504.Parsetree.pmtd_loc;}->{Ast_503.Parsetree.pmtd_name=copy_loc(funx->x)pmtd_name;Ast_503.Parsetree.pmtd_type =Option.mapcopy_module_typepmtd_type;Ast_503.Parsetree.pmtd_attributes =copy_attributespmtd_attributes;Ast_503.Parsetree.pmtd_loc=copy_locationpmtd_loc;}andcopy_module_substitution:Ast_504.Parsetree.module_substitution->Ast_503.Parsetree.module_substitution=fun{Ast_504.Parsetree.pms_name;Ast_504.Parsetree.pms_manifest;Ast_504.Parsetree.pms_attributes;Ast_504.Parsetree.pms_loc;}->{Ast_503.Parsetree.pms_name=copy_loc(funx->x)pms_name;Ast_503.Parsetree.pms_manifest=copy_loccopy_Longident_tpms_manifest;Ast_503.Parsetree.pms_attributes=copy_attributespms_attributes;Ast_503.Parsetree.pms_loc=copy_locationpms_loc;}andcopy_module_declaration:Ast_504.Parsetree.module_declaration->Ast_503.Parsetree.module_declaration=fun{Ast_504.Parsetree.pmd_name;Ast_504.Parsetree.pmd_type;Ast_504.Parsetree.pmd_attributes;Ast_504.Parsetree.pmd_loc;}->{Ast_503.Parsetree.pmd_name=copy_loc(funx->Option.map(funx->x)x)pmd_name;Ast_503.Parsetree.pmd_type=copy_module_typepmd_type;Ast_503.Parsetree.pmd_attributes=copy_attributespmd_attributes;Ast_503.Parsetree.pmd_loc=copy_locationpmd_loc;}andcopy_type_exception:Ast_504.Parsetree.type_exception->Ast_503.Parsetree.type_exception=fun{Ast_504.Parsetree.ptyexn_constructor;Ast_504.Parsetree.ptyexn_loc;Ast_504.Parsetree.ptyexn_attributes;}->{Ast_503.Parsetree.ptyexn_constructor=copy_extension_constructorptyexn_constructor;Ast_503.Parsetree.ptyexn_loc =copy_locationptyexn_loc;Ast_503.Parsetree.ptyexn_attributes=copy_attributesptyexn_attributes;}andcopy_type_extension_:Ast_504.Parsetree.type_extension->bool*Ast_503.Parsetree.type_extension=fun{Ast_504.Parsetree.ptyext_path;Ast_504.Parsetree.ptyext_params;Ast_504.Parsetree.ptyext_constructors;Ast_504.Parsetree.ptyext_private;Ast_504.Parsetree.ptyext_loc;Ast_504.Parsetree.ptyext_attributes;}->letcontains_bivariant,params=copy_type_paramsptyext_paramsinlette={Ast_503.Parsetree.ptyext_path=copy_loccopy_Longident_tptyext_path;Ast_503.Parsetree.ptyext_params=params;Ast_503.Parsetree.ptyext_constructors=List.mapcopy_extension_constructorptyext_constructors;Ast_503.Parsetree.ptyext_private=copy_private_flagptyext_private;Ast_503.Parsetree.ptyext_loc=copy_locationptyext_loc;Ast_503.Parsetree.ptyext_attributes=copy_attributesptyext_attributes;}in(contains_bivariant,te)andcopy_extension_constructor:Ast_504.Parsetree.extension_constructor ->Ast_503.Parsetree.extension_constructor =fun{Ast_504.Parsetree.pext_name;Ast_504.Parsetree.pext_kind;Ast_504.Parsetree.pext_loc;Ast_504.Parsetree.pext_attributes;}->{Ast_503.Parsetree.pext_name=copy_loc(funx->x)pext_name;Ast_503.Parsetree.pext_kind =copy_extension_constructor_kindpext_kind;Ast_503.Parsetree.pext_loc=copy_locationpext_loc;Ast_503.Parsetree.pext_attributes=copy_attributespext_attributes;}andcopy_extension_constructor_kind:Ast_504.Parsetree.extension_constructor_kind ->Ast_503.Parsetree.extension_constructor_kind =function|Ast_504.Parsetree.Pext_decl(x0,x1,x2)->Ast_503.Parsetree.Pext_decl(List.map(funx->copy_loc(funx->x)x)x0,copy_constructor_argumentsx1,Option.mapcopy_core_typex2)|Ast_504.Parsetree.Pext_rebindx0->Ast_503.Parsetree.Pext_rebind(copy_loccopy_Longident_tx0)andcopy_type_paramsparams=Bivariant_param.list_mapparams~f:(fun(typ,(variance,injectivity))->lettyp' =copy_core_type typinlet injectivity'=copy_injectivityinjectivityinmatchvariancewith|Ast_504.Asttypes.Bivariant->(true,Encoding_504.To_503.encode_bivariant_paramtyp'injectivity')|_->(false,(typ',(copy_variance variance,injectivity'))))andcopy_type_declaration_:Ast_504.Parsetree.type_declaration->bool*Ast_503.Parsetree.type_declaration=fun{Ast_504.Parsetree.ptype_name;Ast_504.Parsetree.ptype_params;Ast_504.Parsetree.ptype_cstrs;Ast_504.Parsetree.ptype_kind;Ast_504.Parsetree.ptype_private;Ast_504.Parsetree.ptype_manifest;Ast_504.Parsetree.ptype_attributes;Ast_504.Parsetree.ptype_loc;}->letcontains_bivariant,params=copy_type_paramsptype_paramsinlettd={Ast_503.Parsetree.ptype_name=copy_loc(funx->x)ptype_name;Ast_503.Parsetree.ptype_params=params;Ast_503.Parsetree.ptype_cstrs=List.map(funx->letx0,x1,x2=xin(copy_core_typex0,copy_core_typex1,copy_locationx2))ptype_cstrs;Ast_503.Parsetree.ptype_kind=copy_type_kindptype_kind;Ast_503.Parsetree.ptype_private=copy_private_flagptype_private;Ast_503.Parsetree.ptype_manifest=Option.mapcopy_core_typeptype_manifest;Ast_503.Parsetree.ptype_attributes=copy_attributesptype_attributes;Ast_503.Parsetree.ptype_loc =copy_locationptype_loc;}in(contains_bivariant,td)andcopy_private_flag:Ast_504.Asttypes.private_flag ->Ast_503.Asttypes.private_flag =function|Ast_504.Asttypes.Private->Ast_503.Asttypes.Private|Ast_504.Asttypes.Public->Ast_503.Asttypes.Publicandcopy_type_kind:Ast_504.Parsetree.type_kind->Ast_503.Parsetree.type_kind=function|Ast_504.Parsetree.Ptype_abstract->Ast_503.Parsetree.Ptype_abstract|Ast_504.Parsetree.Ptype_variantx0->Ast_503.Parsetree.Ptype_variant(List.mapcopy_constructor_declarationx0)|Ast_504.Parsetree.Ptype_recordx0->Ast_503.Parsetree.Ptype_record(List.mapcopy_label_declarationx0)|Ast_504.Parsetree.Ptype_open->Ast_503.Parsetree.Ptype_openandcopy_constructor_declaration:Ast_504.Parsetree.constructor_declaration ->Ast_503.Parsetree.constructor_declaration =fun{Ast_504.Parsetree.pcd_name;Ast_504.Parsetree.pcd_vars;Ast_504.Parsetree.pcd_args;Ast_504.Parsetree.pcd_res;Ast_504.Parsetree.pcd_loc;Ast_504.Parsetree.pcd_attributes;}->{Ast_503.Parsetree.pcd_name=copy_loc(funx->x)pcd_name;Ast_503.Parsetree.pcd_vars=List.map(funx->copy_loc(funx->x)x)pcd_vars;Ast_503.Parsetree.pcd_args=copy_constructor_argumentspcd_args;Ast_503.Parsetree.pcd_res=Option.mapcopy_core_typepcd_res;Ast_503.Parsetree.pcd_loc=copy_locationpcd_loc;Ast_503.Parsetree.pcd_attributes=copy_attributespcd_attributes;}andcopy_constructor_arguments:Ast_504.Parsetree.constructor_arguments ->Ast_503.Parsetree.constructor_arguments =function|Ast_504.Parsetree.Pcstr_tuplex0->Ast_503.Parsetree.Pcstr_tuple(List.mapcopy_core_typex0)|Ast_504.Parsetree.Pcstr_recordx0->Ast_503.Parsetree.Pcstr_record(List.mapcopy_label_declarationx0)andcopy_label_declaration:Ast_504.Parsetree.label_declaration->Ast_503.Parsetree.label_declaration=fun{Ast_504.Parsetree.pld_name;Ast_504.Parsetree.pld_mutable;Ast_504.Parsetree.pld_type;Ast_504.Parsetree.pld_loc;Ast_504.Parsetree.pld_attributes;}->{Ast_503.Parsetree.pld_name=copy_loc(funx->x)pld_name;Ast_503.Parsetree.pld_mutable=copy_mutable_flagpld_mutable;Ast_503.Parsetree.pld_type=copy_core_typepld_type;Ast_503.Parsetree.pld_loc=copy_locationpld_loc;Ast_503.Parsetree.pld_attributes=copy_attributespld_attributes;}andcopy_mutable_flag:Ast_504.Asttypes.mutable_flag ->Ast_503.Asttypes.mutable_flag =function|Ast_504.Asttypes.Immutable->Ast_503.Asttypes.Immutable|Ast_504.Asttypes.Mutable->Ast_503.Asttypes.Mutableandcopy_injectivity:Ast_504.Asttypes.injectivity->Ast_503.Asttypes.injectivity=function|Ast_504.Asttypes.Injective->Ast_503.Asttypes.Injective|Ast_504.Asttypes.NoInjectivity->Ast_503.Asttypes.NoInjectivityandcopy_variance:Ast_504.Asttypes.variance->Ast_503.Asttypes.variance=function|Ast_504.Asttypes.Covariant->Ast_503.Asttypes.Covariant|Ast_504.Asttypes.Contravariant->Ast_503.Asttypes.Contravariant|Ast_504.Asttypes.NoVariance->Ast_503.Asttypes.NoVariance|Ast_504.Asttypes.Bivariant->(* note that this should never be reached, unless a user explicitly
calls this very function *)bivariant_error~loc:Location.noneandcopy_value_description:Ast_504.Parsetree.value_description->Ast_503.Parsetree.value_description=fun{Ast_504.Parsetree.pval_name;Ast_504.Parsetree.pval_type;Ast_504.Parsetree.pval_prim;Ast_504.Parsetree.pval_attributes;Ast_504.Parsetree.pval_loc;}->{Ast_503.Parsetree.pval_name=copy_loc(funx->x)pval_name;Ast_503.Parsetree.pval_type =copy_core_typepval_type;Ast_503.Parsetree.pval_prim =List.map(funx->x)pval_prim;Ast_503.Parsetree.pval_attributes =copy_attributespval_attributes;Ast_503.Parsetree.pval_loc=copy_locationpval_loc;}andcopy_object_field_desc:Ast_504.Parsetree.object_field_desc->Ast_503.Parsetree.object_field_desc=function|Ast_504.Parsetree.Otag(x0,x1)->Ast_503.Parsetree.Otag(copy_loccopy_labelx0,copy_core_typex1)|Ast_504.Parsetree.Oinheritx0->Ast_503.Parsetree.Oinherit(copy_core_typex0)andcopy_arg_label:Ast_504.Asttypes.arg_label->Ast_503.Asttypes.arg_label=function|Ast_504.Asttypes.Nolabel->Ast_503.Asttypes.Nolabel|Ast_504.Asttypes.Labelledx0->Ast_503.Asttypes.Labelledx0|Ast_504.Asttypes.Optionalx0 ->Ast_503.Asttypes.Optionalx0andcopy_closed_flag:Ast_504.Asttypes.closed_flag->Ast_503.Asttypes.closed_flag=function|Ast_504.Asttypes.Closed->Ast_503.Asttypes.Closed|Ast_504.Asttypes.Open->Ast_503.Asttypes.Openandcopy_label:Ast_504.Asttypes.label->Ast_503.Asttypes.label=funx->xandcopy_rec_flag:Ast_504.Asttypes.rec_flag->Ast_503.Asttypes.rec_flag=function|Ast_504.Asttypes.Nonrecursive->Ast_503.Asttypes.Nonrecursive|Ast_504.Asttypes.Recursive->Ast_503.Asttypes.Recursiveandcopy_constant:Ast_504.Parsetree.constant->Ast_503.Parsetree.constant=funconst->letpconst_desc=match const.pconst_descwith|Ast_504.Parsetree.Pconst_integer(x0,x1)->Ast_503.Parsetree.Pconst_integer (x0,Option.map(funx->x)x1)|Ast_504.Parsetree.Pconst_charx0->Ast_503.Parsetree.Pconst_charx0|Ast_504.Parsetree.Pconst_string(x0,x1,x2)->Ast_503.Parsetree.Pconst_string(x0,copy_locationx1,Option.map(funx->x)x2)|Ast_504.Parsetree.Pconst_float(x0,x1)->Ast_503.Parsetree.Pconst_float (x0,Option.map(funx->x)x1)in{pconst_desc;pconst_loc=copy_locationconst.pconst_loc}andcopy_Longident_t:Ast_504.Longident.t->Longident.t=function|Ast_504.Longident.Lidentx0->Longident.Lidentx0|Ast_504.Longident.Ldot(x0,x1)->Longident.Ldot(copy_Longident_t x0.txt,x1.txt)|Ast_504.Longident.Lapply(x0,x1)->Longident.Lapply(copy_Longident_tx0.txt,copy_Longident_tx1.txt)andcopy_loc:'f0'g0.('f0->'g0)->'f0Ast_504.Asttypes.loc->'g0Ast_503.Asttypes.loc=funf0{Ast_504.Asttypes.txt;Ast_504.Asttypes.loc}->{Ast_503.Asttypes.txt=f0txt;Ast_503.Asttypes.loc=copy_locationloc}andcopy_location:Location.t->Location.t=funx->x(** The functions below are provided to keep a coherent and stable API with
other migrate_X_Y modules while allowing us to locally define variations of
those functions used to encode 5.4 features into the 5.3 AST. *)letcopy_structure_item_descstri_d=copy_structure_item_desc_with_loc ~loc:Location.nonestri_dletcopy_module_type_descpmty=copy_module_type_desc_with_loc~loc:Location.nonepmtyletcopy_signature_item_descsigi_desc=copy_signature_item_desc_with_loc~loc:Location.nonesigi_descletcopy_class_infos:'f0'g0.('f0->'g0)->'f0Ast_504.Parsetree.class_infos->'g0Ast_503.Parsetree.class_infos=funf0ci->letcontains_bivariant,ci=copy_class_infos_f0ciinifcontains_bivariantthenbivariant_error~loc:ci.Ast_503.Parsetree.pci_locelseciletcopy_class_declarationcd=letcontains_bivariant,cd'=copy_class_declaration_cdinifcontains_bivariantthenbivariant_error~loc:cd.pci_locelsecd'letcopy_with_constraintwc=letcontains_bivariant,wc'=copy_with_constraint_wcinifcontains_bivariantthenmatchwcwith|Pwith_type(_,td)|Pwith_typesubst(_,td)->bivariant_error~loc:td.ptype_loc|_->assertfalseelsewc'letcopy_class_type_declarationctd=letcontains_bivariant,ctd'=copy_class_type_declaration_ctdinifcontains_bivariantthenbivariant_error~loc:ctd.pci_locelsectd'letcopy_class_descriptioncd=letcontains_bivariant,cd'=copy_class_description_cdinifcontains_bivariantthenbivariant_error~loc:cd.pci_locelsecd'letcopy_type_extensionte=letcontains_bivariant,te'=copy_type_extension_teinifcontains_bivariantthenbivariant_error~loc:te.ptyext_locelsete'letcopy_type_declarationtd=letcontains_bivariant,td'=copy_type_declaration_tdinifcontains_bivariantthenbivariant_error~loc:td.ptype_locelsetd'