1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449moduleMaps=Odoc_model.Paths.Identifier.MapsmoduleModuleMap=Map.Make(structtypet=Ident.module_letcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)moduleTypeMap=Map.Make(structtypet=Ident.type_letcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)modulePathModuleMap=Map.Make(structtypet=Ident.path_moduleletcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)moduleModuleTypeMap=Map.Make(structtypet=Ident.module_typeletcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)modulePathTypeMap=Map.Make(structtypet=Ident.path_typeletcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)modulePathClassTypeMap=Map.Make(structtypet=Ident.path_class_typeletcompareab=Ident.compare(a:>Ident.any)(b:>Ident.any)end)moduleIdentMap=Map.Make(structtypet=Ident.anyletcompare=Ident.compareend)moduleDelayed=structleteager=reffalsetype'at={mutablev:'aoption;mutableget:(unit->'a)option}letget:'at->'a=funx->match(x.v,x.get)with|Somex,_->x|None,Someget->letv=get()inx.v<-Somev;x.get<-None;v|_,_->failwith"bad delayed"letput:(unit->'a)->'at=funf->if!eagerthen{v=Some(f());get=None}else{v=None;get=Somef}letput_val:'a->'at=funv->{v=Somev;get=None}endmoduleOpt=structletmapf=functionSomex->Some(fx)|None->NoneendmodulerecModule:sigtypedecl=|AliasofCpath.module_*ModuleType.simple_expansionoption|ModuleTypeofModuleType.exprtypet={doc:CComment.docs;type_:decl;canonical:Cpath.module_option;hidden:bool;}end=ModuleandModuleSubstitution:sigtypet={doc:CComment.docs;manifest:Cpath.module_}end=ModuleSubstitutionandModuleTypeSubstitution:sigtypet={doc:CComment.docs;manifest:ModuleType.expr}end=ModuleTypeSubstitutionandTypeExpr:sigmodulePolymorphic_variant:sigtypekind=Odoc_model.Lang.TypeExpr.Polymorphic_variant.kindmoduleConstructor:sigtypet={name:string;constant:bool;arguments:TypeExpr.tlist;doc:CComment.docs;}endtypeelement=TypeofTypeExpr.t|ConstructorofConstructor.ttypet={kind:kind;elements:elementlist}endmoduleObject:sigtypemethod_={name:string;type_:TypeExpr.t}typefield=Methodofmethod_|InheritofTypeExpr.ttypet={fields:fieldlist;open_:bool}endmodulePackage:sigtypesubstitution=Cfrag.type_*TypeExpr.ttypet={path:Cpath.module_type;substitutions:substitutionlist}endtypelabel=Odoc_model.Lang.TypeExpr.labeltypet=|Varofstring|Any|Aliasoft*string|Arrowoflabeloption*t*t|Tupleoftlist|ConstrofCpath.type_*tlist|Polymorphic_variantofTypeExpr.Polymorphic_variant.t|ObjectofTypeExpr.Object.t|ClassofCpath.class_type*tlist|Polyofstringlist*t|PackageofTypeExpr.Package.tend=TypeExprandExtension:sigmoduleConstructor:sigtypet={name:string;doc:CComment.docs;args:TypeDecl.Constructor.argument;res:TypeExpr.toption;}endtypet={type_path:Cpath.type_;doc:CComment.docs;type_params:TypeDecl.paramlist;private_:bool;constructors:Constructor.tlist;}end=ExtensionandException:sigtypet={doc:CComment.docs;args:TypeDecl.Constructor.argument;res:TypeExpr.toption;}end=ExceptionandFunctorParameter:sigtypeparameter={id:Ident.functor_parameter;expr:ModuleType.expr}typet=Namedofparameter|Unitend=FunctorParameterandModuleType:sigtypesubstitution=|ModuleEqofCfrag.module_*Module.decl|ModuleSubstofCfrag.module_*Cpath.module_|ModuleTypeEqofCfrag.module_type*ModuleType.expr|ModuleTypeSubstofCfrag.module_type*ModuleType.expr|TypeEqofCfrag.type_*TypeDecl.Equation.t|TypeSubstofCfrag.type_*TypeDecl.Equation.ttypetype_of_desc=|ModPathofCpath.module_|StructIncludeofCpath.module_typesimple_expansion=|SignatureofSignature.t|FunctorofFunctorParameter.t*simple_expansiontypetypeof_t={t_desc:type_of_desc;t_expansion:simple_expansionoption;}moduleU:sigtypeexpr=|PathofCpath.module_type|SignatureofSignature.t|Withofsubstitutionlist*expr|TypeOfoftypeof_tendtypepath_t={p_expansion:simple_expansionoption;p_path:Cpath.module_type;}typewith_t={w_substitutions:substitutionlist;w_expansion:simple_expansionoption;w_expr:U.expr;}typeexpr=|Pathofpath_t|SignatureofSignature.t|Withofwith_t|FunctorofFunctorParameter.t*expr|TypeOfoftypeof_ttypet={doc:CComment.docs;canonical:Cpath.module_typeoption;expr:exproption;}end=ModuleTypeandTypeDecl:sigmoduleField:sigtypet={name:string;doc:CComment.docs;mutable_:bool;type_:TypeExpr.t;}endmoduleConstructor:sigtypeargument=TupleofTypeExpr.tlist|RecordofField.tlisttypet={name:string;doc:CComment.docs;args:argument;res:TypeExpr.toption;}endmoduleRepresentation:sigtypet=|VariantofConstructor.tlist|RecordofField.tlist|Extensibleendtypeparam=Odoc_model.Lang.TypeDecl.parammoduleEquation:sigtypet={params:paramlist;private_:bool;manifest:TypeExpr.toption;constraints:(TypeExpr.t*TypeExpr.t)list;}endtypet={doc:CComment.docs;canonical:Cpath.type_option;equation:Equation.t;representation:Representation.toption;}end=TypeDeclandValue:sigtypevalue=Odoc_model.Lang.Value.valuetypet={doc:CComment.docs;type_:TypeExpr.t;value:value}end=ValueandSignature:sigtyperecursive=Odoc_model.Lang.Signature.recursivetypeitem=|ModuleofIdent.module_*recursive*Module.tDelayed.t|ModuleSubstitutionofIdent.module_*ModuleSubstitution.t|ModuleTypeofIdent.module_type*ModuleType.tDelayed.t|ModuleTypeSubstitutionofIdent.module_type*ModuleTypeSubstitution.t|TypeofIdent.type_*recursive*TypeDecl.tDelayed.t|TypeSubstitutionofIdent.type_*TypeDecl.t|ExceptionofIdent.exception_*Exception.t|TypExtofExtension.t|ValueofIdent.value*Value.tDelayed.t|ClassofIdent.class_*recursive*Class.t|ClassTypeofIdent.class_type*recursive*ClassType.t|IncludeofInclude.t|OpenofOpen.t|CommentofCComment.docs_or_stop(* When doing destructive substitution we keep track of the items that have been removed,
and the path they've been substituted with *)typeremoved_item=|RModuleofIdent.module_*Cpath.Resolved.module_|RTypeofIdent.type_*TypeExpr.t*TypeDecl.Equation.t(** [RType (_, texpr, eq)], [eq.manifest = Some texpr] *)|RModuleTypeofIdent.module_type*ModuleType.exprtypet={items:itemlist;compiled:bool;removed:removed_itemlist;doc:CComment.docs;}end=SignatureandOpen:sigtypet={expansion:Signature.t;doc:CComment.docs}end=OpenandInclude:sigtypedecl=AliasofCpath.module_|ModuleTypeofModuleType.U.exprtypet={parent:Odoc_model.Paths.Identifier.Signature.t;strengthened:Cpath.module_option;doc:CComment.docs;status:[`Default|`Inline|`Closed|`Open];shadowed:Odoc_model.Lang.Include.shadowed;expansion_:Signature.t;decl:decl;loc:Odoc_model.Location_.span;}end=IncludeandClass:sigtypedecl=|ClassTypeofClassType.expr|ArrowofTypeExpr.labeloption*TypeExpr.t*decltypet={doc:CComment.docs;virtual_:bool;params:TypeDecl.paramlist;type_:decl;expansion:ClassSignature.toption;}end=ClassandClassType:sigtypeexpr=|ConstrofCpath.class_type*TypeExpr.tlist|SignatureofClassSignature.ttypet={doc:CComment.docs;virtual_:bool;params:TypeDecl.paramlist;expr:expr;expansion:ClassSignature.toption;}end=ClassTypeandClassSignature:sigtypeitem=|MethodofIdent.method_*Method.t|InstanceVariableofIdent.instance_variable*InstanceVariable.t|ConstraintofTypeExpr.t*TypeExpr.t|InheritofClassType.expr|CommentofCComment.docs_or_stoptypet={self:TypeExpr.toption;items:itemlist;doc:CComment.docs}end=ClassSignatureandMethod:sigtypet={doc:CComment.docs;private_:bool;virtual_:bool;type_:TypeExpr.t;}end=MethodandInstanceVariable:sigtypet={doc:CComment.docs;mutable_:bool;virtual_:bool;type_:TypeExpr.t;}end=InstanceVariableandSubstitution:sigtypesubst_module=[`PrefixedofCpath.module_*Cpath.Resolved.module_|`Substituted|`RenamedofIdent.path_module]typesubst_module_type=[`PrefixedofCpath.module_type*Cpath.Resolved.module_type|`RenamedofIdent.module_type]typesubst_type=[`PrefixedofCpath.type_*Cpath.Resolved.type_|`RenamedofIdent.path_type]typesubst_class_type=[`PrefixedofCpath.class_type*Cpath.Resolved.class_type|`RenamedofIdent.path_class_type]typet={module_:subst_modulePathModuleMap.t;module_type:subst_module_typeModuleTypeMap.t;type_:subst_typePathTypeMap.t;class_type:subst_class_typePathClassTypeMap.t;type_replacement:(TypeExpr.t*TypeDecl.Equation.t)PathTypeMap.t;module_type_replacement:ModuleType.exprModuleTypeMap.t;path_invalidating_modules:Ident.path_modulelist;module_type_of_invalidating_modules:Ident.path_modulelist;unresolve_opaque_paths:bool;}end=SubstitutionandCComment:sigtypeblock_element=[Odoc_model.Comment.nestable_block_element|`HeadingofLabel.t|`TagofOdoc_model.Comment.tag]typedocs=block_elementOdoc_model.Comment.with_locationlisttypedocs_or_stop=[`Docsofdocs|`Stop]end=CCommentandLabel:sigtypet={attrs:Odoc_model.Comment.heading_attrs;label:Ident.label;text:Odoc_model.Comment.link_content;location:Odoc_model.Location_.span;}end=LabelmoduleElement=structopenOdoc_model.Pathstypemodule_=[`ModuleofIdentifier.Path.Module.t*Module.tDelayed.t]typemodule_type=[`ModuleTypeofIdentifier.ModuleType.t*ModuleType.t]typetype_=[`TypeofIdentifier.Type.t*TypeDecl.t]typevalue=[`ValueofIdentifier.Value.t*Value.t]typelabel=[`LabelofIdentifier.Label.t*Label.t]typeclass_=[`ClassofIdentifier.Class.t*Class.t]typeclass_type=[`ClassTypeofIdentifier.ClassType.t*ClassType.t]typedatatype=[type_|class_|class_type]typesignature=[module_|module_type]typeconstructor=[`ConstructorofIdentifier.Constructor.t*TypeDecl.Constructor.t]typeexception_=[`ExceptionofIdentifier.Exception.t*Exception.t]typeextension=[`ExtensionofIdentifier.Extension.t*Extension.Constructor.t]typefield=[`FieldofIdentifier.Field.t*TypeDecl.Field.t](* No component for pages yet *)typepage=[`PageofIdentifier.Page.t*Odoc_model.Lang.Page.t]typelabel_parent=[signature|datatype|page]typeany=[signature|value|type_|label|class_|class_type|constructor|exception_|extension|field|page]letidentifier:[<any]->Odoc_model.Paths.Identifier.t=letopenOdoc_model.Paths.Identifierinfunction|`Module(id,_)->(id:>t)|`ModuleType(id,_)->(id:>t)|`Type(id,_)->(id:>t)|`ClassType(id,_)->(id:>t)|`Class(id,_)->(id:>t)|`Value(id,_)->(id:>t)|`Label(id,_)->(id:>t)|`Constructor(id,_)->(id:>t)|`Exception(id,_)->(id:>t)|`Field(id,_)->(id:>t)|`Extension(id,_)->(id:>t)|`Page(id,_)->(id:>t)endmoduleFmt=structopenOdoc_model.Namesletfpf=Format.fprintfletfpp_optfmtpp_appf=function|Somet->fpfppffmtpp_at|None->()letfpp_listfmt_sepfmt_outerpp_appft=letpp_sepppf()=fpfppffmt_sepinmatchtwith|[]->()|t->fpfppffmt_outer(Format.pp_print_list~pp_seppp_a)tletrecsignatureppfsg=letopenSignatureinFormat.fprintfppf"@[<v>";List.iter(function|Module(id,_,m)->Format.fprintfppf"@[<v 2>module %a %a@]@,"Ident.fmtidmodule_(Delayed.getm)|ModuleSubstitution(id,m)->Format.fprintfppf"@[<v 2>module %a := %a@]@,"Ident.fmtidmodule_pathm.ModuleSubstitution.manifest|ModuleType(id,mt)->Format.fprintfppf"@[<v 2>module type %a %a@]@,"Ident.fmtidmodule_type(Delayed.getmt)|ModuleTypeSubstitution(id,mts)->Format.fprintfppf"@[<v 2>module type %a := %a@]@,"Ident.fmtidmodule_type_exprmts.ModuleTypeSubstitution.manifest|Type(id,_,t)->Format.fprintfppf"@[<v 2>type %a%a@]@,"Ident.fmtidtype_decl(Delayed.gett)|TypeSubstitution(id,t)->Format.fprintfppf"@[<v 2>type %a :=%a@]@,"Ident.fmtidtype_declt|Exception(id,e)->Format.fprintfppf"@[<v 2>exception %a %a@]@,"Ident.fmtidexception_e|TypExte->Format.fprintfppf"@[<v 2>type_extension %a@]@,"extensione|Value(id,v)->Format.fprintfppf"@[<v 2>val %a %a@]@,"Ident.fmtidvalue(Delayed.getv)|Class(id,_,c)->Format.fprintfppf"@[<v 2>class %a %a@]@,"Ident.fmtidclass_c|ClassType(id,_,c)->Format.fprintfppf"@[<v 2>class type %a %a@]@,"Ident.fmtidclass_typec|Includei->Format.fprintfppf"@[<v 2>include %a@]@,"include_i|Openo->Format.fprintfppf"open [ %a ]"signatureo.expansion|Comment_c->())sg.items;Format.fprintfppf"@] (removed=[%a])"removed_item_listsg.removedandoptionppppfx=matchxwith|Somex->Format.fprintfppf"Some(%a)"ppx|None->Format.fprintfppf"None"andclass_signatureppfsg=letopenClassSignatureinFormat.fprintfppf"@[<v>self=%a@,"(optiontype_expr)sg.self;List.iter(function|Method(id,m)->Format.fprintfppf"@[<v 2>method %a : %a@]@,"Ident.fmtidmethod_m|InstanceVariable(id,i)->Format.fprintfppf"@[<v 2>instance variable %a : %a@]@,"Ident.fmtidinstance_variablei|Constraint(t1,t2)->Format.fprintfppf"@[<v 2>constraint %a = %a@]@,"type_exprt1type_exprt2|Inheriti->Format.fprintfppf"@[<v 2>inherit %a"class_type_expri|Comment_->())sg.itemsandmethod_ppfm=letopenMethodinFormat.fprintfppf"%s%s%a"(ifm.private_then"private "else"")(ifm.virtual_then"virtual "else"")type_exprm.type_andinstance_variableppfi=letopenInstanceVariableinFormat.fprintfppf"%s%s%a"(ifi.mutable_then"mutable "else"")(ifi.virtual_then"virtual "else"")type_expri.type_andlistppppfls=matchlswith|x::y::rest->Format.fprintfppf"%a, %a"ppx(listpp)(y::rest)|[x]->Format.fprintfppf"%a"ppx|[]->()andclass_type_exprppfc=letopenClassTypeinmatchcwith|Constr(p,ts)->Format.fprintfppf"constr(%a,%a)"class_type_pathp(listtype_expr)ts|Signaturesg->Format.fprintfppf"(%a)"class_signaturesgandremoved_itemppfr=letopenSignatureinmatchrwith|RModule(id,path)->Format.fprintfppf"module %a (%a)"Ident.fmtidresolved_module_pathpath|RType(id,texpr,eq)->Format.fprintfppf"type %a %a = (%a)"type_paramseq.paramsIdent.fmtidtype_exprtexpr|RModuleType(id,mty)->Format.fprintfppf"module type %a = %a"Ident.fmtidmodule_type_exprmtyandremoved_item_listppfr=matchrwith|[]->()|[x]->Format.fprintfppf"%a"removed_itemx|x::ys->Format.fprintfppf"%a;%a"removed_itemxremoved_item_listysandclass_declppfc=letopenClassinmatchcwith|ClassTypecty->Format.fprintfppf"%a"class_type_exprcty|Arrow(lbl,ty,decl)->Format.fprintfppf"%a%a -> %a"type_expr_labellbltype_exprtyclass_decldeclandclass_ppfc=Format.fprintfppf"%a"class_declc.type_andclass_typeppf_c=Format.fprintfppf"<todo>"andinclude_ppfi=Format.fprintfppf"%a (sig = %a)"include_decli.declsignaturei.expansion_andinclude_declppf=letopenIncludeinfunction|Aliasp->Format.fprintfppf"= %a"module_pathp|ModuleTypemt->Format.fprintfppf": %a"u_module_type_exprmtandvalueppfv=letopenValueinFormat.fprintfppf": %a"type_exprv.type_andmodule_declppfd=letopenModuleinmatchdwith|Alias(p,_)->Format.fprintfppf"= %a"module_pathp|ModuleTypemt->Format.fprintfppf": %a"module_type_exprmtandmodule_ppfm=Format.fprintfppf"%a"module_declm.type_andsimple_expansionppf(m:ModuleType.simple_expansion)=matchmwith|ModuleType.Signaturesg->Format.fprintfppf"sig: %a"signaturesg|Functor(arg,sg)->Format.fprintfppf"functor: (%a) -> %a"functor_parameterargsimple_expansionsgandmodule_typeppfmt=matchmt.exprwith|Somex->Format.fprintfppf"= %a"module_type_exprx|None->()andmodule_type_type_of_descppft=matchtwith|ModuleType.ModPathp->Format.fprintfppf"module type of %a"module_pathp|StructIncludep->Format.fprintfppf"module type of struct include %a end"module_pathpandu_module_type_exprppfmt=letopenModuleType.Uinmatchmtwith|Pathp->module_type_pathppfp|Signaturesg->Format.fprintfppf"sig@,@[<v 2>%a@]end"signaturesg|With(subs,e)->Format.fprintfppf"%a with [%a]"u_module_type_expresubstitution_listsubs|TypeOf{t_desc;_}->module_type_type_of_descppft_descandmodule_type_exprppfmt=letopenModuleTypeinmatchmtwith|Path{p_path;_}->module_type_pathppfp_path|Signaturesg->Format.fprintfppf"sig@,@[<v 2>%a@]end"signaturesg|With{w_substitutions=subs;w_expr;_}->Format.fprintfppf"%a with [%a]"u_module_type_exprw_exprsubstitution_listsubs|Functor(arg,res)->Format.fprintfppf"(%a) -> %a"functor_parameterargmodule_type_exprres|TypeOf{t_desc=ModPathp;_}->Format.fprintfppf"module type of %a"module_pathp|TypeOf{t_desc=StructIncludep;_}->Format.fprintfppf"module type of struct include %a end"module_pathpandfunctor_parameterppfx=letopenFunctorParameterinmatchxwith|Unit->()|Namedx->Format.fprintfppf"%a"functor_parameter_parameterxandfunctor_parameter_parameterppfx=Format.fprintfppf"%a : %a"Ident.fmtx.FunctorParameter.idmodule_type_exprx.FunctorParameter.exprandtype_declppft=letopenTypeDeclinmatcht.representationwith|Somerepr->Format.fprintfppf"%a = %a"(fpp_opt" : %a"type_expr)t.equation.Equation.manifesttype_decl_reprrepr|None->(fpp_opt" = %a"type_expr)ppft.equation.Equation.manifestandtype_decl_reprppf=letopenTypeDecl.Representationinfunction|Variantcs->fpp_list" | ""%a"type_decl_constructorppfcs|Recordfs->type_decl_fieldsppffs|Extensible->Format.fprintfppf".."andtype_decl_constructorppft=letopenTypeDecl.Constructorinmatcht.reswith|Someres->fpfppf"%s : %a -> %a"t.nametype_decl_constructor_argt.argstype_exprres|None->fpfppf"%s of %a"t.nametype_decl_constructor_argt.argsandtype_decl_constructor_argppf=letopenTypeDecl.Constructorinfunction|Tuplets->type_tupleppfts|Recordfs->type_decl_fieldsppffsandtype_decl_fieldppft=letopenTypeDecl.Fieldinletmutable_=ift.mutable_then"mutable "else""infpfppf"%s%s : %a"mutable_t.nametype_exprt.type_andtype_decl_fieldsppffs=fpp_list"; ""{ %a }"type_decl_fieldppffsandtype_tupleppfts=fpp_list" * ""%a"type_exprppftsandtype_paramppft=letdesc=matcht.Odoc_model.Lang.TypeDecl.descwithAny->"_"|Varn->nandvariance=matcht.variancewithSomePos->"+"|SomeNeg->"-"|None->""andinjectivity=ift.injectivitythen"!"else""inFormat.fprintfppf"%s%s%s"varianceinjectivitydescandtype_paramsppfts=letpp_sepppf()=Format.fprintfppf", "inFormat.fprintfppf"(%a)"(Format.pp_print_list~pp_septype_param)tsandtype_equationppft=matcht.TypeDecl.Equation.manifestwith|None->()|Somem->Format.fprintfppf" = %a"type_exprmandexception__ppf_e=()andextensionppfe=Format.fprintfppf"%a"type_pathe.Extension.type_pathandsubstitutionppft=letopenModuleTypeinmatchtwith|ModuleEq(frag,decl)->Format.fprintfppf"%a = %a"module_fragmentfragmodule_decldecl|ModuleSubst(frag,mpath)->Format.fprintfppf"%a := %a"module_fragmentfragmodule_pathmpath|ModuleTypeEq(frag,mty)->Format.fprintfppf"%a = %a"module_type_fragmentfragmodule_type_exprmty|ModuleTypeSubst(frag,mty)->Format.fprintfppf"%a := %a"module_type_fragmentfragmodule_type_exprmty|TypeEq(frag,decl)->Format.fprintfppf"%a%a"type_fragmentfragtype_equationdecl|TypeSubst(frag,decl)->Format.fprintfppf"%a%a"type_fragmentfragtype_equationdeclandsubstitution_listppfl=matchlwith|[sub]->Format.fprintfppf"%a"substitutionsub|sub::subs->Format.fprintfppf"%a; %a"substitutionsubsubstitution_listsubs|[]->()andtype_expr_labelppfl=matchlwith|Some(Odoc_model.Lang.TypeExpr.Labell)->Format.fprintfppf"%s:"l|Some(Optionalo)->Format.fprintfppf"?%s:"o|None->()andtype_expr_listppfl=matchlwith|[t]->Format.fprintfppf"%a"type_exprt|t::ts->Format.fprintfppf"%a * %a"type_exprttype_expr_listts|[]->()andtype_objectppf_o=Format.fprintfppf"(object)"andtype_classppf(x,ys)=Format.fprintfppf"(class %a %a)"class_type_pathxtype_expr_listysandtype_packageppf_p=Format.fprintfppf"(package)"andtype_expr_polymorphic_variantppfp=letopenTypeExpr.Polymorphic_variantinletpp_elementppf=function|Typet->type_exprppft|Constructorc->fpfppf"`%s%a"c.Constructor.name(fpp_list" * "" of %a"type_expr)c.argumentsinletpp_elements=fpp_list" | ""%a"pp_elementinmatchp.kindwith|Fixed->fpfppf"[ %a ]"pp_elementsp.elements|Closedxs->fpfppf"[ %a > %a ]"pp_elementsp.elements(fpp_list" ""%a"Format.pp_print_string)xs|Open->fpfppf"[> %a ]"pp_elementsp.elementsandtype_exprppfe=letopenTypeExprinmatchewith|Varx->Format.fprintfppf"%s"x|Any->Format.fprintfppf"_"|Alias(x,y)->Format.fprintfppf"(alias %a %s)"type_exprxy|Arrow(l,t1,t2)->Format.fprintfppf"%a(%a) -> %a"type_expr_labelltype_exprt1type_exprt2|Tuplets->Format.fprintfppf"(%a)"type_expr_listts|Constr(p,args)->(matchargswith|[]->Format.fprintfppf"%a"type_pathp|_->Format.fprintfppf"[%a] %a"type_expr_listargstype_pathp)|Polymorphic_variantpoly->Format.fprintfppf"(poly_var %a)"type_expr_polymorphic_variantpoly|Objectx->type_objectppfx|Class(x,y)->type_classppf(x,y)|Poly(_ss,_t)->Format.fprintfppf"(poly)"|Packagex->type_packageppfxandresolved_module_path:Format.formatter->Cpath.Resolved.module_->unit=funppfp->matchpwith|`Localident->Format.fprintfppf"%a"Ident.fmtident|`Apply(p1,p2)->Format.fprintfppf"%a(%a)"resolved_module_pathp1resolved_module_pathp2|`Identifierp->Format.fprintfppf"%a"model_identifier(p:>Odoc_model.Paths.Identifier.t)|`Substitutedp->Format.fprintfppf"substituted(%a)"resolved_module_pathp|`Module(p,m)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ModuleName.to_stringm)|`Alias(p1,p2)->Format.fprintfppf"alias(%a,%a)"resolved_module_pathp1resolved_module_pathp2|`Subst(p1,p2)->Format.fprintfppf"subst(%a,%a)"resolved_module_type_pathp1resolved_module_pathp2|`Hiddenp1->Format.fprintfppf"hidden(%a)"resolved_module_pathp1|`Canonical(p1,p2)->Format.fprintfppf"canonical(%a,%a)"resolved_module_pathp1module_pathp2|`OpaqueModulem->Format.fprintfppf"opaquemodule(%a)"resolved_module_pathmandmodule_path:Format.formatter->Cpath.module_->unit=funppfp->matchpwith|`Resolvedp->Format.fprintfppf"r(%a)"resolved_module_pathp|`Dot(p,str)->Format.fprintfppf"%a.%s"module_pathpstr|`Module(p,n)->Format.fprintfppf"%a.%a"resolved_parent_pathpModuleName.fmtn|`Apply(p1,p2)->Format.fprintfppf"%a(%a)"module_pathp1module_pathp2|`Identifier(id,b)->Format.fprintfppf"identifier(%a, %b)"model_identifier(id:>Odoc_model.Paths.Identifier.t)b|`Local(id,b)->Format.fprintfppf"local(%a,%b)"Ident.fmtidb|`Substitutedp->Format.fprintfppf"substituted(%a)"module_pathp|`Forwards->Format.fprintfppf"forward(%s)"s|`Rootr->Format.fprintfppf"unresolvedroot(%s)"randresolved_module_type_path:Format.formatter->Cpath.Resolved.module_type->unit=funppfp->matchpwith|`Localid->Format.fprintfppf"%a"Ident.fmtid|`Identifierid->Format.fprintfppf"%a"model_identifier(id:>Odoc_model.Paths.Identifier.t)|`Substitutedx->Format.fprintfppf"substituted(%a)"resolved_module_type_pathx|`ModuleType(p,m)->Format.fprintfppf"%a.%s"resolved_parent_pathp(ModuleTypeName.to_stringm)|`CanonicalModuleType(m1,m2)->Format.fprintfppf"canonicalt(%a,%a)"resolved_module_type_pathm1module_type_pathm2|`OpaqueModuleTypem->Format.fprintfppf"opaquemoduletype(%a)"resolved_module_type_pathm|`AliasModuleType(mt1,mt2)->Format.fprintfppf"aliasmoduletype(%a,%a)"resolved_module_type_pathmt1resolved_module_type_pathmt2|`SubstT(mt1,mt2)->Format.fprintfppf"subst(%a,%a)"resolved_module_type_pathmt1resolved_module_type_pathmt2andmodule_type_path:Format.formatter->Cpath.module_type->unit=funppfm->matchmwith|`Resolvedp->Format.fprintfppf"r(%a)"resolved_module_type_pathp|`Identifier(id,b)->Format.fprintfppf"identifier(%a, %b)"model_identifier(id:>Odoc_model.Paths.Identifier.t)b|`Local(id,b)->Format.fprintfppf"local(%a,%b)"Ident.fmtidb|`Substituteds->Format.fprintfppf"substituted(%a)"module_type_paths|`Dot(m,s)->Format.fprintfppf"%a.%s"module_pathms|`ModuleType(m,n)->Format.fprintfppf"%a.%a"resolved_parent_pathmModuleTypeName.fmtnandresolved_type_path:Format.formatter->Cpath.Resolved.type_->unit=funppfp->matchpwith|`Localid->Format.fprintfppf"%a"Ident.fmtid|`Identifierid->Format.fprintfppf"%a"model_identifier(id:>Odoc_model.Paths.Identifier.t)|`Substitutedx->Format.fprintfppf"substituted(%a)"resolved_type_pathx|`CanonicalType(t1,t2)->Format.fprintfppf"canonicalty(%a,%a)"resolved_type_patht1type_patht2|`Class(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassName.to_stringt)|`ClassType(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassTypeName.to_stringt)|`Type(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.TypeName.to_stringt)andresolved_parent_path:Format.formatter->Cpath.Resolved.parent->unit=funppfp->matchpwith|`Modulem->resolved_module_pathppfm|`ModuleTypem->Format.fprintfppf">>%a<<"resolved_module_type_pathm|`FragmentRoot->Format.fprintfppf"FragmentRoot"andtype_path:Format.formatter->Cpath.type_->unit=funppfp->matchpwith|`Resolvedr->Format.fprintfppf"r(%a)"resolved_type_pathr|`Identifier(id,b)->Format.fprintfppf"identifier(%a, %b)"model_identifier(id:>Odoc_model.Paths.Identifier.t)b|`Local(id,b)->Format.fprintfppf"local(%a,%b)"Ident.fmtidb|`Substituteds->Format.fprintfppf"substituted(%a)"type_paths|`Dot(m,s)->Format.fprintfppf"%a.%s"module_pathms|`Class(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassName.to_stringt)|`ClassType(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassTypeName.to_stringt)|`Type(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.TypeName.to_stringt)andresolved_class_type_path:Format.formatter->Cpath.Resolved.class_type->unit=funppfp->matchpwith|`Localid->Format.fprintfppf"%a"Ident.fmtid|`Identifierid->Format.fprintfppf"%a"model_identifier(id:>Odoc_model.Paths.Identifier.t)|`Substituteds->Format.fprintfppf"substituted(%a)"resolved_class_type_paths|`Class(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassName.to_stringt)|`ClassType(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassTypeName.to_stringt)andclass_type_path:Format.formatter->Cpath.class_type->unit=funppfp->matchpwith|`Resolvedr->Format.fprintfppf"%a"resolved_class_type_pathr|`Identifier(id,b)->Format.fprintfppf"identifier(%a, %b)"model_identifier(id:>Odoc_model.Paths.Identifier.t)b|`Local(id,b)->Format.fprintfppf"local(%a,%b)"Ident.fmtidb|`Substituteds->Format.fprintfppf"substituted(%a)"class_type_paths|`Dot(m,s)->Format.fprintfppf"%a.%s"module_pathms|`Class(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassName.to_stringt)|`ClassType(p,t)->Format.fprintfppf"%a.%s"resolved_parent_pathp(Odoc_model.Names.ClassTypeName.to_stringt)andmodel_path:Format.formatter->Odoc_model.Paths.Path.t->unit=funppf(p:Odoc_model.Paths.Path.t)->matchpwith|`Resolvedrp->Format.fprintfppf"r(%a)"model_resolved_pathrp|`Identifier(id,b)->Format.fprintfppf"identifier(%a, %b)"model_identifier(id:>Odoc_model.Paths.Identifier.t)b|`Roots->Format.fprintfppf"root(%s)"s|`Forwards->Format.fprintfppf"forward(%s)"s|`Dot(parent,s)->Format.fprintfppf"%a.%s"model_path(parent:>Odoc_model.Paths.Path.t)s|`Apply(func,arg)->Format.fprintfppf"%a(%a)"model_path(func:>Odoc_model.Paths.Path.t)model_path(arg:>Odoc_model.Paths.Path.t)andmodel_resolved_pathppf(p:Odoc_model.Paths.Path.Resolved.t)=letopenOdoc_model.Paths.Path.Resolvedinmatchpwith|`Identifierid->Format.fprintfppf"%a"model_identifier(id:>Odoc_model.Paths.Identifier.t)|`Module(parent,name)->Format.fprintfppf"%a.%s"model_resolved_path(parent:>t)(Odoc_model.Names.ModuleName.to_stringname)|`ModuleType(parent,name)->Format.fprintfppf"%a.%s"model_resolved_path(parent:>t)(Odoc_model.Names.ModuleTypeName.to_stringname)|`Type(parent,name)->Format.fprintfppf"%a.%s"model_resolved_path(parent:>t)(Odoc_model.Names.TypeName.to_stringname)|`Alias(path,realpath)->Format.fprintfppf"alias(%a,%a)"model_resolved_path(path:>t)model_resolved_path(realpath:>t)|`AliasModuleType(path,realpath)->Format.fprintfppf"aliasmoduletype(%a,%a)"model_resolved_path(path:>t)model_resolved_path(realpath:>t)|`Subst(modty,m)->Format.fprintfppf"subst(%a,%a)"model_resolved_path(modty:>t)model_resolved_path(m:>t)|`SubstT(t1,t2)->Format.fprintfppf"substt(%a,%a)"model_resolved_path(t1:>t)model_resolved_path(t2:>t)|`CanonicalModuleType(t1,t2)->Format.fprintfppf"canonicalt(%a,%a)"model_resolved_path(t1:>t)model_path(t2:>Odoc_model.Paths.Path.t)|`CanonicalType(t1,t2)->Format.fprintfppf"canonicalty(%a,%a)"model_resolved_path(t1:>t)model_path(t2:>Odoc_model.Paths.Path.t)|`Apply(funct,arg)->Format.fprintfppf"%a(%a)"model_resolved_path(funct:>t)model_resolved_path(arg:>t)|`Canonical(p1,p2)->Format.fprintfppf"canonical(%a,%a)"model_resolved_path(p1:>t)model_path(p2:>Odoc_model.Paths.Path.t)|`Hiddenp->Format.fprintfppf"hidden(%a)"model_resolved_path(p:>t)|`Class(parent,name)->Format.fprintfppf"%a.%s"model_resolved_path(parent:>t)(Odoc_model.Names.ClassName.to_stringname)|`ClassType(parent,name)->Format.fprintfppf"%a.%s"model_resolved_path(parent:>t)(Odoc_model.Names.ClassTypeName.to_stringname)|`OpaqueModulem->Format.fprintfppf"opaquemodule(%a)"model_resolved_path(m:>t)|`OpaqueModuleTypem->Format.fprintfppf"opaquemoduletype(%a)"model_resolved_path(m:>t)andmodel_identifierppf(p:Odoc_model.Paths.Identifier.t)=matchpwith|`Root(_,unit_name)->Format.fprintfppf"(root %s)"(Odoc_model.Names.ModuleName.to_stringunit_name)|`Module(parent,name)->Format.fprintfppf"%a.%s"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(Odoc_model.Names.ModuleName.to_stringname)|`ModuleType(parent,name)->Format.fprintfppf"%a.%s"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(Odoc_model.Names.ModuleTypeName.to_stringname)|`Type(parent,name)->Format.fprintfppf"%a.%s"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(Odoc_model.Names.TypeName.to_stringname)|`Parameter(parent,name)->Format.fprintfppf"(param %a %s)"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(Odoc_model.Names.ParameterName.to_stringname)|`Resultparent->Format.fprintfppf"%a.result"model_identifier(parent:>Odoc_model.Paths.Identifier.t)|`CoreTypename->Format.fprintfppf"%s"(Odoc_model.Names.TypeName.to_stringname)|`Constructor(ty,x)->Format.fprintfppf"%a.%s"model_identifier(ty:>Odoc_model.Paths.Identifier.t)(ConstructorName.to_stringx)|`Value(parent,name)->Format.fprintfppf"%a.%s"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(ValueName.to_stringname)|`CoreExceptionname->Format.fprintfppf"%s"(ExceptionName.to_stringname)|`Class(sg,name)->Format.fprintfppf"%a.%s"model_identifier(sg:>Odoc_model.Paths.Identifier.t)(ClassName.to_stringname)|`ClassType(sg,name)->Format.fprintfppf"%a.%s"model_identifier(sg:>Odoc_model.Paths.Identifier.t)(ClassTypeName.to_stringname)|`InstanceVariable(sg,name)->Format.fprintfppf"%a.%s"model_identifier(sg:>Odoc_model.Paths.Identifier.t)(InstanceVariableName.to_stringname)|`Method(sg,name)->Format.fprintfppf"%a.%s"model_identifier(sg:>Odoc_model.Paths.Identifier.t)(MethodName.to_stringname)|`Label(parent,name)->Format.fprintfppf"%a.%s"model_identifier(parent:>Odoc_model.Paths.Identifier.t)(LabelName.to_stringname)|`Field(ty,name)->Format.fprintfppf"%a.%s"model_identifier(ty:>Odoc_model.Paths.Identifier.t)(FieldName.to_stringname)|`Exception(p,name)->Format.fprintfppf"%a.%s"model_identifier(p:>Odoc_model.Paths.Identifier.t)(ExceptionName.to_stringname)|`Extension(p,name)->Format.fprintfppf"%a.%s"model_identifier(p:>Odoc_model.Paths.Identifier.t)(ExtensionName.to_stringname)|`Page(_,name)|`LeafPage(_,name)->Format.fprintfppf"%s"(PageName.to_stringname)andmodel_fragmentppf(f:Odoc_model.Paths.Fragment.t)=matchfwith|`Resolvedrf->model_resolved_fragmentppfrf|`Dot(sg,d)->Format.fprintfppf"*%a.%s"model_fragment(sg:>Odoc_model.Paths.Fragment.t)d|`Root->()andmodel_resolved_fragmentppf(f:Odoc_model.Paths.Fragment.Resolved.t)=letopenOdoc_model.Paths.Fragment.Resolvedinmatchfwith|`Root(`ModuleTypep)->Format.fprintfppf"root(%a)"model_resolved_path(p:>Odoc_model.Paths.Path.Resolved.t)|`Root(`Modulep)->Format.fprintfppf"root(%a)"model_resolved_path(p:>Odoc_model.Paths.Path.Resolved.t)|`Module(sg,m)->Format.fprintfppf"%a.%s"model_resolved_fragment(sg:>t)(Odoc_model.Names.ModuleName.to_stringm)|`Module_type(sg,mty)->Format.fprintfppf"%a.%s"model_resolved_fragment(sg:>t)(Odoc_model.Names.ModuleTypeName.to_stringmty)|`Type(sg,t)->Format.fprintfppf"%a.%s"model_resolved_fragment(sg:>t)(Odoc_model.Names.TypeName.to_stringt)|`Subst(path,m)->Format.fprintfppf"(%a subst -> %a)"model_resolved_path(path:>Odoc_model.Paths.Path.Resolved.t)model_resolved_fragment(m:>t)|`Alias(_,_)->Format.fprintfppf"UNIMPLEMENTED subst alias!?"|`Class(sg,c)->Format.fprintfppf"%a.%s"model_resolved_fragment(sg:>t)(Odoc_model.Names.ClassName.to_stringc)|`ClassType(sg,c)->Format.fprintfppf"%a.%s"model_resolved_fragment(sg:>t)(Odoc_model.Names.ClassTypeName.to_stringc)|`OpaqueModulem->Format.fprintfppf"opaquemodule(%a)"model_resolved_fragment(m:>Odoc_model.Paths.Fragment.Resolved.t)andresolved_root_fragmentppf(f:Cfrag.root)=matchfwith|`ModuleTypep->Format.fprintfppf"root(%a)"resolved_module_type_pathp|`Modulep->Format.fprintfppf"root(%a)"resolved_module_pathpandresolved_signature_fragmentppf(f:Cfrag.resolved_signature)=matchfwith|`Rootr->Format.fprintfppf"%a"resolved_root_fragmentr|(`Subst_|`Alias_|`Module_)asx->resolved_module_fragmentppfx|`OpaqueModulem->Format.fprintfppf"opaquemodule(%a)"resolved_module_fragmentmandresolved_module_fragmentppf(f:Cfrag.resolved_module)=matchfwith|`Subst(s,f)->Format.fprintfppf"subst(%a,%a)"resolved_module_type_pathsresolved_module_fragmentf|`Alias(m,f)->Format.fprintfppf"substalias(%a,%a)"resolved_module_pathmresolved_module_fragmentf|`Module(p,n)->Format.fprintfppf"%a.%s"resolved_signature_fragmentp(ModuleName.to_stringn)|`OpaqueModulem->Format.fprintfppf"opaquemodule(%a)"resolved_module_fragmentmandresolved_module_type_fragmentppf(f:Cfrag.resolved_module_type)=matchfwith|`ModuleType(p,n)->Format.fprintfppf"%a.%s"resolved_signature_fragmentp(ModuleTypeName.to_stringn)andresolved_type_fragmentppf(f:Cfrag.resolved_type)=matchfwith|`Type(s,n)->Format.fprintfppf"%a.%s"resolved_signature_fragments(TypeName.to_stringn)|`Class(s,n)->Format.fprintfppf"%a.%s"resolved_signature_fragments(ClassName.to_stringn)|`ClassType(s,n)->Format.fprintfppf"%a.%s"resolved_signature_fragments(ClassTypeName.to_stringn)andsignature_fragmentppf(f:Cfrag.signature)=matchfwith|`Resolvedr->Format.fprintfppf"r(%a)"resolved_signature_fragmentr|`Dot(s,n)->Format.fprintfppf"%a.%s"signature_fragmentsn|`Root->Format.fprintfppf"root"andmodule_fragmentppf(f:Cfrag.module_)=matchfwith|`Resolvedr->Format.fprintfppf"r(%a)"resolved_module_fragmentr|`Dot(s,n)->Format.fprintfppf"%a.%s"signature_fragmentsnandmodule_type_fragmentppf(f:Cfrag.module_type)=matchfwith|`Resolvedr->Format.fprintfppf"resolved(%a)"resolved_module_type_fragmentr|`Dot(s,n)->Format.fprintfppf"%a.%s"signature_fragmentsnandtype_fragmentppf(f:Cfrag.type_)=matchfwith|`Resolvedr->Format.fprintfppf"r(%a)"resolved_type_fragmentr|`Dot(s,n)->Format.fprintfppf"%a.%s"signature_fragmentsnandmodel_resolved_referenceppf(r:Odoc_model.Paths.Reference.Resolved.t)=letopenOdoc_model.Paths.Reference.Resolvedinmatchrwith|`Identifierid->Format.fprintfppf"%a"model_identifierid|`Hiddenp->Format.fprintfppf"hidden(%a)"model_resolved_reference(p:>t)|`Module(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ModuleName.to_stringname)|`ModuleType(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ModuleTypeName.to_stringname)|`Type(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(TypeName.to_stringname)|`Constructor(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ConstructorName.to_stringname)|`Field(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(FieldName.to_stringname)|`Extension(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ExtensionName.to_stringname)|`Exception(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ExceptionName.to_stringname)|`Value(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ValueName.to_stringname)|`Class(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ClassName.to_stringname)|`ClassType(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(ClassTypeName.to_stringname)|`Method(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(MethodName.to_stringname)|`InstanceVariable(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(InstanceVariableName.to_stringname)|`Alias(x,y)->Format.fprintfppf"alias(%a,%a)"model_resolved_path(x:>Odoc_model.Paths.Path.Resolved.t)model_resolved_reference(y:>Odoc_model.Paths.Reference.Resolved.t)|`AliasModuleType(x,y)->Format.fprintfppf"aliasmoduletype(%a,%a)"model_resolved_path(x:>Odoc_model.Paths.Path.Resolved.t)model_resolved_reference(y:>Odoc_model.Paths.Reference.Resolved.t)|`Canonical(x,y)->Format.fprintfppf"canonical(%a,%a)"model_resolved_reference(x:>t)model_reference(y:>Odoc_model.Paths.Reference.t)|`Label(parent,name)->Format.fprintfppf"%a.%s"model_resolved_reference(parent:>t)(LabelName.to_stringname)andmodel_referenceppf(r:Odoc_model.Paths.Reference.t)=letopenOdoc_model.Paths.Referenceinmatchrwith|`Resolvedr'->Format.fprintfppf"r(%a)"model_resolved_referencer'|`Root(name,_)->Format.fprintfppf"unresolvedroot(%s)"name|`Dot(parent,str)->Format.fprintfppf"%a.%s"model_reference(parent:>t)str|`Module(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ModuleName.to_stringname)|`ModuleType(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ModuleTypeName.to_stringname)|`Type(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(TypeName.to_stringname)|`Constructor(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ConstructorName.to_stringname)|`Field(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(FieldName.to_stringname)|`Extension(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ExtensionName.to_stringname)|`Exception(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ExceptionName.to_stringname)|`Value(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ValueName.to_stringname)|`Class(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ClassName.to_stringname)|`ClassType(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(ClassTypeName.to_stringname)|`Method(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(MethodName.to_stringname)|`InstanceVariable(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(InstanceVariableName.to_stringname)|`Label(parent,name)->Format.fprintfppf"%a.%s"model_reference(parent:>t)(LabelName.to_stringname)endmoduleLocalIdents=structopenOdoc_model(** The purpose of this module is to extract identifiers
that could be referenced in Paths - that is, modules,
module types, types, classes and class types. That way
we can assign them an Ident.t ahead of time and be
self-consistent. Because we don't need _all_ of the
identifiers we don't traverse the entire structure.
Additionally, we stop at (class_)signature boundaries
since identifiers within these won't be referenced
except within them, so we only do that on demand. *)typet={modules:Paths.Identifier.Sets.Module.t;module_types:Paths.Identifier.Sets.ModuleType.t;types:Paths.Identifier.Sets.Type.t;classes:Paths.Identifier.Sets.Class.t;class_types:Paths.Identifier.Sets.ClassType.t;}letempty=letopenPaths.Identifier.Setsin{modules=Module.empty;module_types=ModuleType.empty;types=Type.empty;classes=Class.empty;class_types=ClassType.empty;}openLangletrecsignature_itemssids=letopenPathsinletopenSignatureinList.fold_right(funcids->matchcwith|Module(_,{Module.id;_})->{idswithmodules=Identifier.Sets.Module.addidids.modules}|ModuleTypem->{idswithmodule_types=Identifier.Sets.ModuleType.addm.ModuleType.idids.module_types;}|ModuleSubstitution{ModuleSubstitution.id;_}->{idswithmodules=Identifier.Sets.Module.addidids.modules}|ModuleTypeSubstitution{ModuleTypeSubstitution.id;_}->{idswithmodule_types=Identifier.Sets.ModuleType.addidids.module_types;}|Type(_,t)->{idswithtypes=Identifier.Sets.Type.addt.TypeDecl.idids.types;}|TypeSubstitutiont->{idswithtypes=Identifier.Sets.Type.addt.TypeDecl.idids.types;}|Class(_,c)->{idswithclasses=Identifier.Sets.Class.addc.Class.idids.classes;}|ClassType(_,c)->{idswithclass_types=Identifier.Sets.ClassType.addc.ClassType.idids.class_types;}|TypExt_|Exception_|Value_|Comment_->ids|Includei->signaturei.Include.expansion.contentids|Openo->signatureo.Open.expansionids)sidsandsignaturesids=signature_itemss.itemsidsendmoduleOf_Lang=structopenOdoc_modelmoduleRM=Map.Make(structtypet=Paths.Path.Resolved.Module.tletcomparexy=ifx==ythen0elsecomparexyend)typememos={mutablermodpathmemo:Cpath.Resolved.module_RM.t}typemap={modules:Ident.module_Paths.Identifier.Maps.Module.t;module_types:Ident.module_typePaths.Identifier.Maps.ModuleType.t;functor_parameters:Ident.functor_parameterPaths.Identifier.Maps.FunctorParameter.t;types:Ident.type_Paths.Identifier.Maps.Type.t;path_types:Ident.path_typePaths.Identifier.Maps.Path.Type.t;path_class_types:Ident.path_class_typePaths.Identifier.Maps.Path.ClassType.t;classes:Ident.class_Paths.Identifier.Maps.Class.t;class_types:Ident.class_typePaths.Identifier.Maps.ClassType.t;memos:memos;}letempty()=letopenPaths.Identifier.Mapsinletmemos={rmodpathmemo=RM.empty}in{modules=Module.empty;module_types=ModuleType.empty;functor_parameters=FunctorParameter.empty;types=Type.empty;path_types=Path.Type.empty;path_class_types=Path.ClassType.empty;classes=Class.empty;class_types=ClassType.empty;memos;}letmap_of_identsidsmap=letopenPaths.Identifierinlettypes_new=Sets.Type.fold(funiacc->Maps.Type.addi(Ident.Of_Identifier.type_i)acc)ids.LocalIdents.typesMaps.Type.emptyinletclasses_new=Sets.Class.fold(funiacc->Maps.Class.addi(Ident.Of_Identifier.class_i)acc)ids.LocalIdents.classesMaps.Class.emptyinletclass_types_new=Sets.ClassType.fold(funiacc->Maps.ClassType.addi(Ident.Of_Identifier.class_typei)acc)ids.LocalIdents.class_typesMaps.ClassType.emptyinletmodules_new=Sets.Module.fold(funiacc->Maps.Module.add(i:>Module.t)(Ident.Of_Identifier.module_i)acc)ids.LocalIdents.modulesMaps.Module.emptyinletmodule_types_new=Sets.ModuleType.fold(funiacc->Maps.ModuleType.addi(Ident.Of_Identifier.module_typei)acc)ids.LocalIdents.module_typesMaps.ModuleType.emptyinletpath_class_types_new=Maps.Path.ClassType.empty|>Maps.ClassType.fold(funkeyvacc->Maps.Path.ClassType.add(key:>Path.ClassType.t)(v:>Ident.path_class_type)acc)class_types_new|>Maps.Class.fold(funkeyvacc->Maps.Path.ClassType.add(key:>Path.ClassType.t)(v:>Ident.path_class_type)acc)classes_newinletpath_types_new=Maps.Path.Type.empty|>Maps.Path.ClassType.fold(funkeyvacc->Maps.Path.Type.add(key:>Path.Type.t)(v:>Ident.path_type)acc)path_class_types_new|>Maps.Type.fold(funkeyvacc->Maps.Path.Type.add(key:>Path.Type.t)(v:>Ident.path_type)acc)types_newinletmerge_fn_kv1v2=match(v1,v2)with|_,Somex->Somex|None,None->None|Somex,None->Somexinletmodules=Maps.Module.mergemerge_fnmodules_newmap.modulesinletmodule_types=Maps.ModuleType.mergemerge_fnmodule_types_newmap.module_typesinletfunctor_parameters=map.functor_parametersinlettypes=Maps.Type.mergemerge_fntypes_newmap.typesinletclasses=Maps.Class.mergemerge_fnclasses_newmap.classesinletclass_types=Maps.ClassType.mergemerge_fnclass_types_newmap.class_typesinletpath_types=Maps.Path.Type.mergemerge_fnpath_types_newmap.path_typesinletpath_class_types=Maps.Path.ClassType.mergemerge_fnpath_class_types_newmap.path_class_typesin{(empty())withmodules;module_types;functor_parameters;types;classes;class_types;path_types;path_class_types;}letoptionconvident_mapx=matchxwithNone->None|Somex'->Some(convident_mapx')letidentifierlookupmapi=matchlookupimapwith|x->`Localx|exceptionNot_found->`Identifieriletfind_any_moduleiident_map=matchiwith|#Paths.Identifier.Module.tasid->(Maps.Module.findidident_map.modules:>Ident.path_module)|#Paths.Identifier.FunctorParameter.tasid->(Maps.FunctorParameter.findidident_map.functor_parameters:>Ident.path_module)|_->raiseNot_foundletrecresolved_module_path:_->Odoc_model.Paths.Path.Resolved.Module.t->Cpath.Resolved.module_=funident_mapp->letf()=letrecursep=resolved_module_pathident_mappinmatchpwith|`Identifieri->identifierfind_any_moduleident_mapi|`Module(p,name)->`Module(`Module(recursep),name)|`Apply(p1,p2)->`Apply(recursep1,recursep2)|`Alias(p1,p2)->`Alias(recursep1,recursep2)|`Subst(p1,p2)->`Subst(resolved_module_type_pathident_mapp1,recursep2)|`Canonical(p1,p2)->`Canonical(recursep1,module_pathident_mapp2)|`Hiddenp1->`Hidden(recursep1)|`OpaqueModulem->`OpaqueModule(recursem)intryRM.findpident_map.memos.rmodpathmemowithNot_found->letres=f()inident_map.memos.rmodpathmemo<-RM.addpresident_map.memos.rmodpathmemo;resandresolved_module_type_path:_->Odoc_model.Paths.Path.Resolved.ModuleType.t->Cpath.Resolved.module_type=funident_mapp->matchpwith|`Identifieri->identifierMaps.ModuleType.findident_map.module_typesi|`ModuleType(p,name)->`ModuleType(`Module(resolved_module_pathident_mapp),name)|`CanonicalModuleType(p1,p2)->`CanonicalModuleType(resolved_module_type_pathident_mapp1,module_type_pathident_mapp2)|`OpaqueModuleTypem->`OpaqueModuleType(resolved_module_type_pathident_mapm)|`AliasModuleType(m1,m2)->`AliasModuleType(resolved_module_type_pathident_mapm1,resolved_module_type_pathident_mapm2)|`SubstT(p1,p2)->`SubstT(resolved_module_type_pathident_mapp1,resolved_module_type_pathident_mapp2)andresolved_type_path:_->Odoc_model.Paths.Path.Resolved.Type.t->Cpath.Resolved.type_=funident_mapp->matchpwith|`Identifieri->identifierMaps.Path.Type.findident_map.path_typesi|`CanonicalType(p1,p2)->`CanonicalType(resolved_type_pathident_mapp1,type_pathident_mapp2)|`Type(p,name)->`Type(`Module(resolved_module_pathident_mapp),name)|`Class(p,name)->`Class(`Module(resolved_module_pathident_mapp),name)|`ClassType(p,name)->`ClassType(`Module(resolved_module_pathident_mapp),name)andresolved_class_type_path:_->Odoc_model.Paths.Path.Resolved.ClassType.t->Cpath.Resolved.class_type=funident_mapp->matchpwith|`Identifieri->identifierMaps.Path.ClassType.findident_map.path_class_typesi|`Class(p,name)->`Class(`Module(resolved_module_pathident_mapp),name)|`ClassType(p,name)->`ClassType(`Module(resolved_module_pathident_mapp),name)andmodule_path:_->Odoc_model.Paths.Path.Module.t->Cpath.module_=funident_mapp->matchpwith|`Resolvedr->`Resolved(resolved_module_pathident_mapr)|`Identifier(i,b)->(matchidentifierfind_any_moduleident_mapiwith|`Identifieri->`Identifier(i,b)|`Locali->`Local(i,b))|`Dot(path',x)->`Dot(module_pathident_mappath',x)|`Apply(p1,p2)->`Apply(module_pathident_mapp1,module_pathident_mapp2)|`Forwardstr->`Forwardstr|`Rootstr->`Rootstrandmodule_type_path:_->Odoc_model.Paths.Path.ModuleType.t->Cpath.module_type=funident_mapp->matchpwith|`Resolvedr->`Resolved(resolved_module_type_pathident_mapr)|`Identifier(i,b)->(matchidentifierMaps.ModuleType.findident_map.module_typesiwith|`Identifieri->`Identifier(i,b)|`Locali->`Local(i,b))|`Dot(path',x)->`Dot(module_pathident_mappath',x)andtype_path:_->Odoc_model.Paths.Path.Type.t->Cpath.type_=funident_mapp->matchpwith|`Resolvedr->`Resolved(resolved_type_pathident_mapr)|`Identifier(i,b)->(matchidentifierMaps.Path.Type.findident_map.path_typesiwith|`Identifieri->`Identifier(i,b)|`Locali->`Local(i,b))|`Dot(path',x)->`Dot(module_pathident_mappath',x)andclass_type_path:_->Odoc_model.Paths.Path.ClassType.t->Cpath.class_type=funident_mapp->matchpwith|`Resolvedr->`Resolved(resolved_class_type_pathident_mapr)|`Identifier(i,b)->(matchidentifierMaps.Path.ClassType.findident_map.path_class_typesiwith|`Identifieri->`Identifier(i,b)|`Locali->`Local(i,b))|`Dot(path',x)->`Dot(module_pathident_mappath',x)letrecresolved_signature_fragment:map->Odoc_model.Paths.Fragment.Resolved.Signature.t->Cfrag.resolved_signature=funident_mapty->matchtywith|`Root(`ModuleTypepath)->`Root(`ModuleType(resolved_module_type_pathident_mappath))|`Root(`Modulepath)->`Root(`Module(resolved_module_pathident_mappath))|(`Alias_|`Subst_|`Module_|`OpaqueModule_)asx->(resolved_module_fragmentident_mapx:>Cfrag.resolved_signature)andresolved_module_fragment:_->Odoc_model.Paths.Fragment.Resolved.Module.t->Cfrag.resolved_module=funident_mapty->matchtywith|`Subst(p,m)->`Subst(resolved_module_type_pathident_mapp,resolved_module_fragmentident_mapm)|`Alias(p,m)->`Alias(resolved_module_pathident_mapp,resolved_module_fragmentident_mapm)|`Module(p,m)->`Module(resolved_signature_fragmentident_mapp,m)|`OpaqueModulem->`OpaqueModule(resolved_module_fragmentident_mapm)andresolved_module_type_fragment:_->Odoc_model.Paths.Fragment.Resolved.ModuleType.t->Cfrag.resolved_module_type=funident_mapty->matchtywith|`Module_type(p,m)->`ModuleType(resolved_signature_fragmentident_mapp,m)andresolved_type_fragment:_->Odoc_model.Paths.Fragment.Resolved.Type.t->Cfrag.resolved_type=funident_mapty->matchtywith|`Type(p,n)->`Type(resolved_signature_fragmentident_mapp,n)|`Class(p,n)->`Class(resolved_signature_fragmentident_mapp,n)|`ClassType(p,n)->`ClassType(resolved_signature_fragmentident_mapp,n)letrecsignature_fragment:_->Odoc_model.Paths.Fragment.Signature.t->Cfrag.signature=funident_mapty->matchtywith|`Resolvedr->`Resolved(resolved_signature_fragmentident_mapr)|`Dot(p,n)->`Dot(signature_fragmentident_mapp,n)|`Root->`Rootletmodule_fragment:_->Odoc_model.Paths.Fragment.Module.t->Cfrag.module_=funident_mapty->matchtywith|`Resolvedr->`Resolved(resolved_module_fragmentident_mapr)|`Dot(p,n)->`Dot(signature_fragmentident_mapp,n)letmodule_type_fragment:_->Odoc_model.Paths.Fragment.ModuleType.t->Cfrag.module_type=funident_mapty->matchtywith|`Resolvedr->`Resolved(resolved_module_type_fragmentident_mapr)|`Dot(p,n)->`Dot(signature_fragmentident_mapp,n)lettype_fragment:_->Odoc_model.Paths.Fragment.Type.t->Cfrag.type_=funident_mapty->matchtywith|`Resolvedr->`Resolved(resolved_type_fragmentident_mapr)|`Dot(p,n)->`Dot(signature_fragmentident_mapp,n)letrectype_declident_mapty=letopenOdoc_model.Lang.TypeDeclin{TypeDecl.doc=docsident_mapty.doc;canonical=Opt.map(type_pathident_map)ty.canonical;equation=type_equationident_mapty.equation;representation=Opt.map(type_decl_representationident_map)ty.representation;}andtype_decl_representationident_mapr=letopenOdoc_model.Lang.TypeDecl.Representationinmatchrwith|Variantcs->TypeDecl.Representation.Variant(List.map(type_decl_constructorident_map)cs)|Recordfs->Record(List.map(type_decl_fieldident_map)fs)|Extensible->Extensibleandtype_decl_constructorident_mapt=letopenOdoc_model.Lang.TypeDecl.Constructorinletargs=type_decl_constructor_argumentident_mapt.argsinletres=Opt.map(type_expressionident_map)t.resin{TypeDecl.Constructor.name=Paths.Identifier.namet.id;doc=docsident_mapt.doc;args;res;}andtype_decl_constructor_argumentident_mapa=letopenOdoc_model.Lang.TypeDecl.Constructorinmatchawith|Tuplets->TypeDecl.Constructor.Tuple(List.map(type_expressionident_map)ts)|Recordfs->Record(List.map(type_decl_fieldident_map)fs)andtype_decl_fieldident_mapf=letopenOdoc_model.Lang.TypeDecl.Fieldinlettype_=type_expressionident_mapf.type_in{TypeDecl.Field.name=Paths.Identifier.namef.id;doc=docsident_mapf.doc;mutable_=f.mutable_;type_;}andtype_equationident_mapteq=letopenOdoc_model.Lang.TypeDecl.Equationin{TypeDecl.Equation.params=teq.params;private_=teq.private_;manifest=optiontype_expressionident_mapteq.manifest;constraints=List.map(fun(x,y)->(type_expressionident_mapx,type_expressionident_mapy))teq.constraints;}andtype_expr_polyvarident_mapv=letopenOdoc_model.Lang.TypeExpr.Polymorphic_variantinletmap_element=function|Typeexpr->TypeExpr.Polymorphic_variant.Type(type_expressionident_mapexpr)|Constructorc->ConstructorTypeExpr.Polymorphic_variant.Constructor.{name=c.name;constant=c.constant;arguments=List.map(type_expressionident_map)c.arguments;doc=docsident_mapc.doc;}in{TypeExpr.Polymorphic_variant.kind=v.kind;elements=List.mapmap_elementv.elements;}andtype_objectident_mapo=letopenOdoc_model.Lang.TypeExpr.Objectinletmap_field=function|Methodm->TypeExpr.(Object.Method{Object.name=m.name;type_=type_expressionident_mapm.type_;})|Inheriti->Inherit(type_expressionident_mapi)in{TypeExpr.Object.open_=o.open_;fields=List.mapmap_fieldo.fields}andtype_packageident_mappkg=letopenOdoc_model.Lang.TypeExpr.Packagein{TypeExpr.Package.path=module_type_pathident_mappkg.path;substitutions=List.map(fun(x,y)->letf=type_fragmentident_mapxin(f,type_expressionident_mapy))pkg.substitutions;}andtype_expressionident_mapexpr=letopenOdoc_model.Lang.TypeExprinmatchexprwith|Vars->TypeExpr.Vars|Any->Any|Constr(p,xs)->Constr(type_pathident_mapp,List.map(type_expressionident_map)xs)|Arrow(lbl,t1,t2)->Arrow(lbl,type_expressionident_mapt1,type_expressionident_mapt2)|Tuplets->Tuple(List.map(type_expressionident_map)ts)|Polymorphic_variantv->Polymorphic_variant(type_expr_polyvarident_mapv)|Poly(s,ts)->Poly(s,type_expressionident_mapts)|Alias(t,s)->Alias(type_expressionident_mapt,s)|Class(p,ts)->Class(class_type_pathident_mapp,List.map(type_expressionident_map)ts)|Objecto->Object(type_objectident_mapo)|Packagep->Package(type_packageident_mapp)andmodule_declident_mapm=matchmwith|Odoc_model.Lang.Module.Alias(p,e)->Module.Alias(module_pathident_mapp,optionsimple_expansionident_mape)|Odoc_model.Lang.Module.ModuleTypes->Module.ModuleType(module_type_exprident_maps)andinclude_declident_mapm=matchmwith|Odoc_model.Lang.Include.Aliasp->Include.Alias(module_pathident_mapp)|ModuleTypes->ModuleType(u_module_type_exprident_maps)andcanonicalident_map(canonical:Odoc_model.Paths.Path.Module.toption)=matchcanonicalwith|Somep->Some(module_pathident_mapp)|None->Noneandsimple_expansionident_map(f:Odoc_model.Lang.ModuleType.simple_expansion):ModuleType.simple_expansion=letopenOdoc_model.Lang.ModuleTypeinletopenOdoc_model.Lang.FunctorParameterinmatchfwith|Signaturet->Signature(signatureident_mapt)|Functor(arg,sg)->(matchargwith|Namedarg->letidentifier=arg.Odoc_model.Lang.FunctorParameter.idinletid=Ident.Of_Identifier.functor_parameteridentifierinletident_map'={ident_mapwithfunctor_parameters=Maps.FunctorParameter.addidentifieridident_map.functor_parameters;}inletarg'=functor_parameterident_map'idarginFunctor(FunctorParameter.Namedarg',simple_expansionident_map'sg)|Unit->Functor(FunctorParameter.Unit,simple_expansionident_mapsg))andmodule_ident_mapm=lettype_=module_declident_mapm.Odoc_model.Lang.Module.type_inletcanonical=canonicalident_mapm.Odoc_model.Lang.Module.canonicalin{Module.doc=docsident_mapm.doc;type_;canonical;hidden=m.hidden}andwith_module_type_substitutionident_mapm=letopenOdoc_model.Lang.ModuleTypeinmatchmwith|ModuleEq(frag,decl)->ModuleType.ModuleEq(module_fragmentident_mapfrag,module_declident_mapdecl)|ModuleSubst(frag,p)->ModuleType.ModuleSubst(module_fragmentident_mapfrag,module_pathident_mapp)|ModuleTypeEq(frag,mty)->ModuleType.ModuleTypeEq(module_type_fragmentident_mapfrag,module_type_exprident_mapmty)|ModuleTypeSubst(frag,mty)->ModuleType.ModuleTypeSubst(module_type_fragmentident_mapfrag,module_type_exprident_mapmty)|TypeEq(frag,eqn)->ModuleType.TypeEq(type_fragmentident_mapfrag,type_equationident_mapeqn)|TypeSubst(frag,eqn)->ModuleType.TypeSubst(type_fragmentident_mapfrag,type_equationident_mapeqn)andfunctor_parameterident_mapida=letexpr'=module_type_exprident_mapa.Odoc_model.Lang.FunctorParameter.exprin{FunctorParameter.id;expr=expr'}andextensionident_mape=letopenOdoc_model.Lang.Extensioninlettype_path=type_pathident_mape.type_pathinletconstructors=List.map(extension_constructorident_map)e.constructorsin{Extension.type_path;doc=docsident_mape.doc;type_params=e.type_params;private_=e.private_;constructors;}andextension_constructorident_mapc=letopenOdoc_model.Lang.Extension.Constructorinletargs=type_decl_constructor_argumentident_mapc.argsinletres=Opt.map(type_expressionident_map)c.resin{Extension.Constructor.name=Paths.Identifier.namec.id;doc=docsident_mapc.doc;args;res;}andexception_ident_mape=letopenOdoc_model.Lang.Exceptioninletargs=type_decl_constructor_argumentident_mape.argsinletres=Opt.map(type_expressionident_map)e.resin{Exception.doc=docsident_mape.doc;args;res}andu_module_type_exprident_mapm=letopenOdoc_modelinmatchmwith|Lang.ModuleType.U.Signatures->lets=signatureident_mapsinModuleType.U.Signatures|Pathp->letp'=module_type_pathident_mappinPathp'|With(w,e)->letw'=List.map(with_module_type_substitutionident_map)winWith(w',u_module_type_exprident_mape)|TypeOf{t_desc;t_expansion}->lett_desc=matcht_descwith|ModPathp->ModuleType.ModPath(module_pathident_mapp)|StructIncludep->StructInclude(module_pathident_mapp)inlett_expansion=Opt.map(simple_expansionident_map)t_expansioninTypeOf{t_desc;t_expansion}andmodule_type_exprident_mapm=letopenOdoc_modelinletopenPathsinmatchmwith|Lang.ModuleType.Signatures->lets=signatureident_mapsinModuleType.Signatures|Lang.ModuleType.Pathp->letp'=ModuleType.{p_path=module_type_pathident_mapp.p_path;p_expansion=optionsimple_expansionident_mapp.p_expansion;}inModuleType.Pathp'|Lang.ModuleType.Withw->letw'=ModuleType.{w_substitutions=List.map(with_module_type_substitutionident_map)w.w_substitutions;w_expansion=optionsimple_expansionident_mapw.w_expansion;w_expr=u_module_type_exprident_mapw.w_expr;}inModuleType.Withw'|Lang.ModuleType.Functor(Namedarg,expr)->letidentifier=arg.Lang.FunctorParameter.idinletid=Ident.Of_Identifier.functor_parameteridentifierinletident_map'={ident_mapwithfunctor_parameters=Identifier.Maps.FunctorParameter.addidentifieridident_map.functor_parameters;}inletarg'=functor_parameterident_map'idarginletexpr'=module_type_exprident_map'exprinModuleType.Functor(Namedarg',expr')|Lang.ModuleType.Functor(Unit,expr)->letexpr'=module_type_exprident_mapexprinModuleType.Functor(Unit,expr')|Lang.ModuleType.TypeOf{t_desc;t_expansion}->lett_desc=matcht_descwith|ModPathp->ModuleType.ModPath(module_pathident_mapp)|StructIncludep->StructInclude(module_pathident_mapp)inlett_expansion=optionsimple_expansionident_mapt_expansioninModuleType.(TypeOf{t_desc;t_expansion})andmodule_typeident_mapm=letexpr=Opt.map(module_type_exprident_map)m.Odoc_model.Lang.ModuleType.exprin{ModuleType.doc=docsident_mapm.doc;canonical=optionmodule_type_pathident_mapm.canonical;expr;}andvalueident_mapv=lettype_=type_expressionident_mapv.Lang.Value.type_in{Value.type_;doc=docsident_mapv.doc;value=v.value}andinclude_ident_mapi=letopenOdoc_model.Lang.Includeinletdecl=include_declident_mapi.declin{Include.parent=i.parent;doc=docsident_mapi.doc;shadowed=i.expansion.shadowed;expansion_=apply_sig_mapident_mapi.expansion.content;status=i.status;strengthened=optionmodule_pathident_mapi.strengthened;decl;loc=i.loc;}andclass_ident_mapc=letopenOdoc_model.Lang.Classinletexpansion=Opt.map(class_signatureident_map)c.expansionin{Class.doc=docsident_mapc.doc;virtual_=c.virtual_;params=c.params;type_=class_declident_mapc.type_;expansion;}andclass_declident_mapc=letopenOdoc_model.Lang.Classinmatchcwith|ClassTypee->Class.ClassType(class_type_exprident_mape)|Arrow(lbl,e,d)->Arrow(lbl,type_expressionident_mape,class_declident_mapd)andclass_type_exprident_mape=letopenOdoc_model.Lang.ClassTypeinmatchewith|Constr(p,ts)->ClassType.Constr(class_type_pathident_mapp,List.map(type_expressionident_map)ts)|Signatures->Signature(class_signatureident_maps)andclass_typeident_mapt=letopenOdoc_model.Lang.ClassTypeinletexpansion=Opt.map(class_signatureident_map)t.expansionin{ClassType.doc=docsident_mapt.doc;virtual_=t.virtual_;params=t.params;expr=class_type_exprident_mapt.expr;expansion;}andclass_signatureident_mapsg=letopenOdoc_model.Lang.ClassSignatureinletitems=List.map(function|Methodm->letid=Ident.Of_Identifier.method_m.idinletm'=method_ident_mapminClassSignature.Method(id,m')|InstanceVariablei->letid=Ident.Of_Identifier.instance_variablei.idinleti'=instance_variableident_mapiinClassSignature.InstanceVariable(id,i')|Constraint(t1,t2)->Constraint(type_expressionident_mapt1,type_expressionident_mapt2)|Inherite->Inherit(class_type_exprident_mape)|Commentc->Comment(docs_or_stopident_mapc))sg.itemsin{ClassSignature.self=Opt.map(type_expressionident_map)sg.self;items;doc=docsident_mapsg.doc;}andmethod_ident_mapm=letopenOdoc_model.Lang.Methodin{Method.doc=docsident_mapm.doc;private_=m.private_;virtual_=m.virtual_;type_=type_expressionident_mapm.type_;}andinstance_variableident_mapi={InstanceVariable.doc=docsident_mapi.doc;mutable_=i.mutable_;virtual_=i.virtual_;type_=type_expressionident_mapi.type_;}andmodule_substitutionident_map(t:Odoc_model.Lang.ModuleSubstitution.t)={ModuleSubstitution.doc=docsident_mapt.doc;manifest=module_pathident_mapt.manifest;}andmodule_type_substitutionident_map(t:Odoc_model.Lang.ModuleTypeSubstitution.t)={ModuleTypeSubstitution.doc=docsident_mapt.doc;manifest=module_type_exprident_mapt.manifest;}andmodule_of_module_substitutionident_map(t:Odoc_model.Lang.ModuleSubstitution.t)=letmanifest=module_pathident_mapt.manifestinletcanonical=Somemanifestin{Module.doc=docsident_mapt.doc;type_=Alias(manifest,None);canonical;hidden=true;}andsignature:_->Odoc_model.Lang.Signature.t->Signature.t=funident_mapitems->(* First we construct a list of brand new [Ident.t]s
for each item in the signature *)letident_map=map_of_idents(LocalIdents.signatureitemsLocalIdents.empty)ident_mapin(* Now we construct the Components for each item,
converting all paths containing Identifiers pointing at
our elements to local paths *)apply_sig_mapident_mapitemsandopen_ident_mapo=Open.{expansion=apply_sig_mapident_mapo.Odoc_model.Lang.Open.expansion;doc=docsident_mapo.Odoc_model.Lang.Open.doc;}andapply_sig_mapident_mapsg=letitems=List.map(letopenOdoc_model.Lang.SignatureinletopenOdoc_model.Pathsinfunction|Type(r,t)->letid=Identifier.Maps.Type.findt.idident_map.typesinlett'=Delayed.put(fun()->type_declident_mapt)inSignature.Type(id,r,t')|TypeSubstitutiont->letid=Identifier.Maps.Type.findt.idident_map.typesinlett'=type_declident_maptinSignature.TypeSubstitution(id,t')|Module(r,m)->letid=Identifier.Maps.Module.find(m.id:>Identifier.Module.t)ident_map.modulesinletm'=Delayed.put(fun()->module_ident_mapm)inSignature.Module(id,r,m')|ModuleSubstitutionm->letid=Identifier.Maps.Module.findm.idident_map.modulesinletm'=module_substitutionident_mapminSignature.ModuleSubstitution(id,m')|ModuleTypeSubstitutionm->letid=Identifier.Maps.ModuleType.findm.idident_map.module_typesinletm'=module_type_substitutionident_mapminSignature.ModuleTypeSubstitution(id,m')|ModuleTypem->letid=Identifier.Maps.ModuleType.findm.idident_map.module_typesinletm'=Delayed.put(fun()->module_typeident_mapm)inSignature.ModuleType(id,m')|Valuev->letid=Ident.Of_Identifier.valuev.idinletv'=Delayed.put(fun()->valueident_mapv)inSignature.Value(id,v')|Commentc->Comment(docs_or_stopident_mapc)|TypExte->TypExt(extensionident_mape)|Exceptione->letid=Ident.Of_Identifier.exception_e.idinException(id,exception_ident_mape)|Class(r,c)->letid=Identifier.Maps.Class.findc.idident_map.classesinClass(id,r,class_ident_mapc)|ClassType(r,c)->letid=Identifier.Maps.ClassType.findc.idident_map.class_typesinClassType(id,r,class_typeident_mapc)|Openo->Open(open_ident_mapo)|Includei->Include(include_ident_mapi))sg.itemsin{items;removed=[];compiled=sg.compiled;doc=docsident_mapsg.doc}andblock_element_b:CComment.block_elementOdoc_model.Comment.with_location=matchbwith|{Odoc_model.Location_.value=`Heading(attrs,label,text);location}->letlabel=Ident.Of_Identifier.labellabelinOdoc_model.Location_.sameb(`Heading{Label.attrs;label;text;location})|{value=`Tag_;_}ast->t|{value=#Odoc_model.Comment.nestable_block_element;_}asn->nanddocsident_mapd=List.map(block_elementident_map)danddocs_or_stopident_map=function|`Docsd->`Docs(docsident_mapd)|`Stop->`Stopendletmodule_of_functor_argument(arg:FunctorParameter.parameter)={Module.doc=[];type_=ModuleTypearg.expr;canonical=None;hidden=false;}(** This is equivalent to {!Lang.extract_signature_doc}. *)letextract_signature_doc(s:Signature.t)=match(s.doc,s.items)with|[],Include{expansion_;status=`Inline;_}::_->expansion_.doc|doc,_->doc