12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199(*
* Copyright (c) 2014 Leo White <lpw25@cl.cam.ac.uk>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduleOcaml_ident=IdentmoduleOcaml_env=EnvopenNamesmoduleIdentifier=structtype'aid='aPaths_types.id={iv:'a;ihash:int;ikey:string}moduleId=Paths_types.Identifiertypet=Id.anytypet_pv=Id.any_pvletrecname_aux:t->string=funx->matchx.ivwith|`Root(_,name)->ModuleName.to_stringname|`Page(_,name)->PageName.to_stringname|`LeafPage(_,name)->PageName.to_stringname|`Module(_,name)->ModuleName.to_stringname|`Parameter(_,name)->ModuleName.to_stringname|`Resultx->name_aux(x:>t)|`ModuleType(_,name)->ModuleTypeName.to_stringname|`Type(_,name)->TypeName.to_stringname|`CoreTypename->TypeName.to_stringname|`Constructor(_,name)->ConstructorName.to_stringname|`Field(_,name)->FieldName.to_stringname|`Extension(_,name)->ExtensionName.to_stringname|`ExtensionDecl(_,_,name)->ExtensionName.to_stringname|`Exception(_,name)->ExceptionName.to_stringname|`CoreExceptionname->ExceptionName.to_stringname|`Value(_,name)->ValueName.to_stringname|`Class(_,name)->ClassName.to_stringname|`ClassType(_,name)->ClassTypeName.to_stringname|`Method(_,name)->MethodName.to_stringname|`InstanceVariable(_,name)->InstanceVariableName.to_stringname|`Label(_,name)->LabelName.to_stringname|`SourcePage(dir,name)->name_aux(dir:>t)^name|`SourceDir(({iv=`SourceDir_;_}asp),n)->name_aux(p:>t)^n^"/"|`SourceDir(_,n)->"./"^n^"/"|`SourceLocation(x,anchor)->name_aux(x:>t)^"#"^DefName.to_stringanchor|`SourceLocationModx->name_aux(x:>t)|`SourceLocationInternal(x,anchor)->name_aux(x:>t)^"#"^LocalName.to_stringanchor|`AssetFile(_,name)->nameletrecis_internal:t->bool=funx->matchx.ivwith|`Root(_,name)->ModuleName.is_internalname|`Page(_,_)->false|`LeafPage(_,_)->false|`Module(_,name)->ModuleName.is_internalname|`Parameter(_,name)->ModuleName.is_internalname|`Resultx->is_internal(x:>t)|`ModuleType(_,name)->ModuleTypeName.is_internalname|`Type(_,name)->TypeName.is_internalname|`CoreTypename->TypeName.is_internalname|`Constructor(parent,_)->is_internal(parent:>t)|`Field(parent,_)->is_internal(parent:>t)|`Extension(parent,_)->is_internal(parent:>t)|`ExtensionDecl(parent,_,_)->is_internal(parent:>t)|`Exception(parent,_)->is_internal(parent:>t)|`CoreException_->false|`Value(_,name)->ValueName.is_internalname|`Class(_,name)->ClassName.is_internalname|`ClassType(_,name)->ClassTypeName.is_internalname|`Method(parent,_)->is_internal(parent:>t)|`InstanceVariable(parent,_)->is_internal(parent:>t)|`Label(parent,_)->is_internal(parent:>t)|`SourceDir_|`SourceLocationMod_|`SourceLocation_|`SourcePage_|`SourceLocationInternal_|`AssetFile_->falseletname:[<t_pv]id->string=funn->name_aux(n:>t)letrecfull_name_aux:t->stringlist=funx->matchx.ivwith|`Root(_,name)->[ModuleName.to_stringname]|`Page(_,name)->[PageName.to_stringname]|`LeafPage(_,name)->[PageName.to_stringname]|`Module(parent,name)->ModuleName.to_stringname::full_name_aux(parent:>t)|`Parameter(parent,name)->ModuleName.to_stringname::full_name_aux(parent:>t)|`Resultx->full_name_aux(x:>t)|`ModuleType(parent,name)->ModuleTypeName.to_stringname::full_name_aux(parent:>t)|`Type(parent,name)->TypeName.to_stringname::full_name_aux(parent:>t)|`CoreTypename->[TypeName.to_stringname]|`Constructor(parent,name)->ConstructorName.to_stringname::full_name_aux(parent:>t)|`Field(parent,name)->FieldName.to_stringname::full_name_aux(parent:>t)|`Extension(parent,name)->ExtensionName.to_stringname::full_name_aux(parent:>t)|`ExtensionDecl(parent,_,name)->ExtensionName.to_stringname::full_name_aux(parent:>t)|`Exception(parent,name)->ExceptionName.to_stringname::full_name_aux(parent:>t)|`CoreExceptionname->[ExceptionName.to_stringname]|`Value(parent,name)->ValueName.to_stringname::full_name_aux(parent:>t)|`Class(parent,name)->ClassName.to_stringname::full_name_aux(parent:>t)|`ClassType(parent,name)->ClassTypeName.to_stringname::full_name_aux(parent:>t)|`Method(parent,name)->MethodName.to_stringname::full_name_aux(parent:>t)|`InstanceVariable(parent,name)->InstanceVariableName.to_stringname::full_name_aux(parent:>t)|`Label(parent,name)->LabelName.to_stringname::full_name_aux(parent:>t)|`AssetFile(parent,name)->name::full_name_aux(parent:>t)|`SourceDir_|`SourceLocationMod_|`SourceLocation_|`SourcePage_|`SourceLocationInternal_->[]letfullname:[<t_pv]id->stringlist=funn->List.rev@@full_name_aux(n:>t)letis_internal:[<t_pv]id->bool=funn->is_internal(n:>t)letreclabel_parent_aux=letopenIdinfun(n:non_src)->matchnwith|{iv=`Resulti;_}->label_parent_aux(i:>non_src)|{iv=`CoreType_;_}|{iv=`CoreException_;_}->assertfalse|{iv=`Root_;_}asp->(p:>label_parent)|{iv=`Page_;_}asp->(p:>label_parent)|{iv=`LeafPage_;_}asp->(p:>label_parent)|{iv=`Module(p,_);_}|{iv=`ModuleType(p,_);_}|{iv=`Parameter(p,_);_}|{iv=`Class(p,_);_}|{iv=`ClassType(p,_);_}|{iv=`Type(p,_);_}|{iv=`Extension(p,_);_}|{iv=`ExtensionDecl(p,_,_);_}|{iv=`Exception(p,_);_}|{iv=`Value(p,_);_}->(p:signature:>label_parent)|{iv=`Label(p,_);_}->p|{iv=`Method(p,_);_}|{iv=`InstanceVariable(p,_);_}->(p:class_signature:>label_parent)|{iv=`Constructor(p,_);_}->(p:datatype:>label_parent)|{iv=`Field(p,_);_}->(p:field_parent:>label_parent)letlabel_parentn=label_parent_aux(n:>Id.non_src)letequalxy=x.ihash=y.ihash&&x.ikey=y.ikeylethashx=x.ihashletcomparexy=comparex.ikeyy.ikeytypeany=ttypeany_pv=t_pvmoduletypeIdSig=sigtypettypet_pvvalequal:t->t->boolvalhash:t->intvalcompare:t->t->intendmoduleAny=structtypet=anytypet_pv=any_pvletequal=equallethash=hashletcompare=compareendmoduleSignature=structtypet=Id.signaturetypet_pv=Id.signature_pvletequal=equallethash=hashletcompare=compareendmoduleClassSignature=structtypet=Id.class_signaturetypet_pv=Id.class_signature_pvletequal=equallethash=hashletcompare=compareendmoduleDataType=structtypet=Id.datatypetypet_pv=Id.datatype_pvendmoduleFieldParent=structtypet=Paths_types.Identifier.field_parenttypet_pv=Paths_types.Identifier.field_parent_pvendmoduleLabelParent=structtypet=Id.label_parenttypet_pv=Id.label_parent_pvletequal=equallethash=hashletcompare=compareendmoduleRootModule=structtypet=Id.root_moduletypet_pv=Id.root_module_pvletequal=equallethash=hashletcompare=compareendmoduleModule=structtypet=Id.module_typet_pv=Id.module_pvletequal=equallethash=hashletcompare=compareendmoduleFunctorParameter=structtypet=Id.functor_parametertypet_pv=Id.functor_parameter_pvletequal=equallethash=hashletcompare=compareletfunctor_arg_pos{iv=`Parameter(p,_);_}=letrecinner_sig=function|`Result{iv=p;_}->1+inner_sigp|`Module_|`ModuleType_|`Root_|`Parameter_->1ininner_sigp.ivendmoduleFunctorResult=structtypet=Id.functor_resulttypet_pv=Id.functor_result_pvendmoduleModuleType=structtypet=Id.module_typetypet_pv=Id.module_type_pvletequal=equallethash=hashletcompare=compareendmoduleType=structtypet=Id.type_typet_pv=Id.type_pvletequal=equallethash=hashletcompare=compareendmoduleConstructor=structtypet=Id.constructortypet_pv=Id.constructor_pvendmoduleField=structtypet=Id.fieldtypet_pv=Id.field_pvendmoduleExtension=structtypet=Id.extensiontypet_pv=Id.extension_pvendmoduleExtensionDecl=structtypet=Paths_types.Identifier.extension_decltypet_pv=Paths_types.Identifier.extension_decl_pvletequal=equallethash=hashletcompare=compareendmoduleException=structtypet=Id.exception_typet_pv=Id.exception_pvendmoduleValue=structtypet=Id.valuetypet_pv=Id.value_pvendmoduleClass=structtypet=Id.class_typet_pv=Id.class_pvletequal=equallethash=hashletcompare=compareendmoduleClassType=structtypet=Id.class_typetypet_pv=Id.class_type_pvletequal=equallethash=hashletcompare=compareendmoduleMethod=structtypet=Id.method_typet_pv=Id.method_pvendmoduleInstanceVariable=structtypet=Id.instance_variabletypet_pv=Id.instance_variable_pvendmoduleLabel=structtypet=Paths_types.Identifier.labeltypet_pv=Paths_types.Identifier.label_pvletequal=equallethash=hashletcompare=compareendmodulePage=structtypet=Id.pagetypet_pv=Id.page_pvendmoduleContainerPage=structtypet=Id.container_pagetypet_pv=Id.container_page_pvendmoduleNonSrc=structtypet=Paths_types.Identifier.non_srctypet_pv=Paths_types.Identifier.non_src_pvendmoduleSourceDir=structtypet=Id.source_dirtypet_pv=Id.source_dir_pvletequal=equallethash=hashletcompare=compareendmoduleSourcePage=structtypet=Id.source_pagetypet_pv=Id.source_page_pvendmoduleSourceLocation=structtypet=Paths_types.Identifier.source_locationtypet_pv=Paths_types.Identifier.source_location_pvendmoduleAssetFile=structtypet=Id.asset_filetypet_pv=Id.asset_file_pvendmoduleOdocId=structtypet=Id.odoc_idtypet_pv=Id.odoc_id_pvendmodulePath=structmoduleModule=structtypet=Id.path_moduletypet_pv=Id.path_module_pvletequal=equallethash=hashletcompare=compareendmoduleModuleType=structtypet=Id.path_module_typetypet_pv=Id.module_type_pvletequal=equallethash=hashletcompare=compareendmoduleType=structtypet=Id.path_typetypet_pv=Id.path_type_pvletequal=equallethash=hashletcompare=compareendmoduleDataType=structtypet=Id.path_datatypetypet_pv=Id.path_datatype_pvletequal=equallethash=hashletcompare=compareendmoduleConstructor=structtypet=Id.path_constructortypet_pv=Id.constructor_pvletequal=equallethash=hashletcompare=compareendmoduleValue=structtypet=Id.path_valuetypet_pv=Id.value_pvletequal=equallethash=hashletcompare=compareendmoduleClassType=structtypet=Id.path_class_typetypet_pv=Id.path_class_type_pvletequal=equallethash=hashletcompare=compareendtypet=Id.path_anyendmoduleMaps=structmoduleAny=Map.Make(Any)moduleFunctorParameter=Map.Make(FunctorParameter)moduleModule=Map.Make(Module)moduleModuleType=Map.Make(ModuleType)moduleType=Map.Make(Type)moduleClass=Map.Make(Class)moduleClassType=Map.Make(ClassType)moduleLabel=Map.Make(Label)modulePath=structmoduleModule=Map.Make(Path.Module)moduleModuleType=Map.Make(Path.ModuleType)moduleType=Map.Make(Path.Type)moduleClassType=Map.Make(Path.ClassType)endendmoduleMk=structletmk_freshto_strtyfx=letikey=Printf.sprintf"%s_%s"ty(to_strx)inletihash=Hashtbl.hashikeyin{iv=fx;ihash;ikey}letmk_parentto_strtyf(parent,x)=letikey=Printf.sprintf"%s_%s.%s"ty(to_strx)parent.ikeyinletihash=Hashtbl.hashikeyin{iv=f(parent,x);ihash;ikey}letmk_parent_optto_strtyf(parent_opt,x)=letikey=matchparent_optwith|None->Printf.sprintf"%s_%s"ty(to_strx)|Somep->Printf.sprintf"%s_%s.%s"ty(to_strx)p.ikeyinletihash=Hashtbl.hashikeyin{iv=f(parent_opt,x);ihash;ikey}letpage:ContainerPage.toption*PageName.t->[>`PageofContainerPage.toption*PageName.t]id=mk_parent_optPageName.to_string"p"(fun(p,n)->`Page(p,n))letleaf_page:ContainerPage.toption*PageName.t->[>`LeafPageofContainerPage.toption*PageName.t]id=mk_parent_optPageName.to_string"lp"(fun(p,n)->`LeafPage(p,n))letasset_file:Page.t*string->AssetFile.t=mk_parent(funk->k)"asset"(fun(p,n)->`AssetFile(p,n))letsource_page(container_page,path)=letrecsource_dirdir=matchdirwith|[]->(container_page:ContainerPage.t:>SourceDir.t)|a::q->letparent=source_dirqinmk_parent(funk->k)"sd"(fun(p,dir)->`SourceDir(p,dir))(parent,a)inmatchList.revpathwith|[]->assertfalse|file::dir->letparent=source_dirdirinmk_parent(funx->x)"sp"(fun(p,rp)->`SourcePage(p,rp))(parent,file)letroot:ContainerPage.toption*ModuleName.t->[>`RootofContainerPage.toption*ModuleName.t]id=mk_parent_optModuleName.to_string"r"(fun(p,n)->`Root(p,n))letmodule_:Signature.t*ModuleName.t->[>`ModuleofSignature.t*ModuleName.t]id=mk_parentModuleName.to_string"m"(fun(p,n)->`Module(p,n))letparameter:Signature.t*ModuleName.t->[>`ParameterofSignature.t*ModuleName.t]id=mk_parentModuleName.to_string"p"(fun(p,n)->`Parameter(p,n))letresult:Signature.t->[>`ResultofSignature.t]id=funs->mk_parent(fun()->"__result__")""(fun(s,())->`Results)(s,())letmodule_type:Signature.t*ModuleTypeName.t->[>`ModuleTypeofSignature.t*ModuleTypeName.t]id=mk_parentModuleTypeName.to_string"mt"(fun(p,n)->`ModuleType(p,n))letclass_:Signature.t*ClassName.t->[>`ClassofSignature.t*ClassName.t]id=mk_parentClassName.to_string"c"(fun(p,n)->`Class(p,n))letclass_type:Signature.t*ClassTypeName.t->[>`ClassTypeofSignature.t*ClassTypeName.t]id=mk_parentClassTypeName.to_string"ct"(fun(p,n)->`ClassType(p,n))lettype_:Signature.t*TypeName.t->[>`TypeofSignature.t*TypeName.t]id=mk_parentTypeName.to_string"t"(fun(p,n)->`Type(p,n))letcore_type=mk_fresh(funs->s)"coret"(funs->`CoreType(TypeName.make_stds))letconstructor:DataType.t*ConstructorName.t->[>`ConstructorofDataType.t*ConstructorName.t]id=mk_parentConstructorName.to_string"ctor"(fun(p,n)->`Constructor(p,n))letfield:FieldParent.t*FieldName.t->[>`FieldofFieldParent.t*FieldName.t]id=mk_parentFieldName.to_string"fld"(fun(p,n)->`Field(p,n))letextension:Signature.t*ExtensionName.t->[>`ExtensionofSignature.t*ExtensionName.t]id=mk_parentExtensionName.to_string"extn"(fun(p,n)->`Extension(p,n))letextension_decl:Signature.t*(ExtensionName.t*ExtensionName.t)->[>`ExtensionDeclofSignature.t*ExtensionName.t*ExtensionName.t]id=mk_parent(fun(n,m)->ExtensionName.to_stringn^"."^ExtensionName.to_stringm)"extn-decl"(fun(p,(n,m))->`ExtensionDecl(p,n,m))letexception_:Signature.t*ExceptionName.t->[>`ExceptionofSignature.t*ExceptionName.t]id=mk_parentExceptionName.to_string"exn"(fun(p,n)->`Exception(p,n))letcore_exception=mk_fresh(funs->s)"coreexn"(funs->`CoreException(ExceptionName.make_stds))letvalue:Signature.t*ValueName.t->[>`ValueofSignature.t*ValueName.t]id=mk_parentValueName.to_string"v"(fun(p,n)->`Value(p,n))letmethod_:ClassSignature.t*MethodName.t->[>`MethodofClassSignature.t*MethodName.t]id=mk_parentMethodName.to_string"m"(fun(p,n)->`Method(p,n))letinstance_variable:ClassSignature.t*InstanceVariableName.t->[>`InstanceVariableofClassSignature.t*InstanceVariableName.t]id=mk_parentInstanceVariableName.to_string"iv"(fun(p,n)->`InstanceVariable(p,n))letlabel:LabelParent.t*LabelName.t->[>`LabelofLabelParent.t*LabelName.t]id=mk_parentLabelName.to_string"l"(fun(p,n)->`Label(p,n))letsource_location:SourcePage.t*DefName.t->[>`SourceLocationofSourcePage.t*DefName.t]id=mk_parentDefName.to_string"sl"(fun(p,n)->`SourceLocation(p,n))letsource_location_mod:SourcePage.t->[>`SourceLocationModofSourcePage.t]id=funs->mk_parent(fun()->"__slm__")""(fun(s,())->`SourceLocationMods)(s,())letsource_location_int:SourcePage.t*LocalName.t->[>`SourceLocationInternalofSourcePage.t*LocalName.t]id=mk_parentLocalName.to_string"sli"(fun(p,n)->`SourceLocationInternal(p,n))endendmodulePath=structtypet=Paths_types.Path.anyletrecis_resolved_hidden:weak_canonical_test:bool->Paths_types.Resolved_path.any->bool=fun~weak_canonical_testx->letopenPaths_types.Resolved_pathinletrecinner:Paths_types.Resolved_path.any->bool=function|`Identifier{iv=`ModuleType(_,m);_}whenNames.ModuleTypeName.is_internalm->true|`Identifier{iv=`Type(_,t);_}whenNames.TypeName.is_internalt->true|`Identifier{iv=`Module(_,m);_}whenNames.ModuleName.is_internalm->true|`Identifier_->false|`Canonical(_,`Resolved_)->false|`Canonical(x,_)->(notweak_canonical_test)&&inner(x:module_:>any)|`Hidden_->true|`Subst(p1,p2)->inner(p1:module_type:>any)||inner(p2:module_:>any)|`Module(p,_)->inner(p:module_:>any)|`Apply(p,_)->inner(p:module_:>any)|`ModuleType(_,m)whenNames.ModuleTypeName.is_internalm->true|`ModuleType(p,_)->inner(p:module_:>any)|`Type(_,t)whenNames.TypeName.is_internalt->true|`Type(p,_)->inner(p:module_:>any)|`Value(_,t)whenNames.ValueName.is_internalt->true|`Value(p,_)->inner(p:module_:>any)|`Constructor(p,_)->inner(p:datatype:>any)|`Class(p,_)->inner(p:module_:>any)|`ClassType(p,_)->inner(p:module_:>any)|`Alias(dest,`Resolvedsrc)->inner(dest:module_:>any)&&inner(src:module_:>any)|`Alias(dest,src)->inner(dest:module_:>any)&&is_path_hidden(src:>Paths_types.Path.any)|`AliasModuleType(p1,p2)->inner(p1:module_type:>any)&&inner(p2:module_type:>any)|`SubstT(p1,p2)->inner(p1:>any)||inner(p2:>any)|`CanonicalModuleType(_,`Resolved_)->false|`CanonicalModuleType(x,_)->inner(x:module_type:>any)|`CanonicalType(_,`Resolved_)->false|`CanonicalType(x,_)->inner(x:type_:>any)|`CanonicalDataType(_,`Resolved_)->false|`CanonicalDataType(x,_)->inner(x:datatype:>any)|`OpaqueModulem->inner(m:>any)|`OpaqueModuleTypemt->inner(mt:>any)ininnerxandcontains_double_underscores=letlen=String.lengthsinletrecauxi=ifi>len-2thenfalseelseifs.[i]='_'&&s.[i+1]='_'thentrueelseaux(i+1)inaux0andis_path_hidden:Paths_types.Path.any->bool=letopenPaths_types.Pathinfunction|`Resolvedr->is_resolved_hidden~weak_canonical_test:falser|`Identifier(_,hidden)->hidden|`Roots->contains_double_underscores|`Forward_->false|`Dot(p,_)->is_path_hidden(p:module_:>any)|`Apply(p1,p2)->is_path_hidden(p1:module_:>any)||is_path_hidden(p2:module_:>any)moduleResolved=structtypet=Paths_types.Resolved_path.anyletrecparent_module_type_identifier:Paths_types.Resolved_path.module_type->Identifier.Signature.t=function|`Identifierid->(id:Identifier.ModuleType.t:>Identifier.Signature.t)|`ModuleType(m,n)->Identifier.Mk.module_type(parent_module_identifierm,n)|`SubstT(m,_n)->parent_module_type_identifierm|`CanonicalModuleType(_,`Resolvedp)->parent_module_type_identifierp|`CanonicalModuleType(p,_)->parent_module_type_identifierp|`OpaqueModuleTypemt->parent_module_type_identifiermt|`AliasModuleType(sub,orig)->ifis_resolved_hidden~weak_canonical_test:false(sub:>t)thenparent_module_type_identifierorigelseparent_module_type_identifiersubandparent_module_identifier:Paths_types.Resolved_path.module_->Identifier.Signature.t=function|`Identifierid->(id:Identifier.Path.Module.t:>Identifier.Signature.t)|`Subst(sub,_)->parent_module_type_identifiersub|`Hiddenp->parent_module_identifierp|`Module(m,n)->Identifier.Mk.module_(parent_module_identifierm,n)|`Canonical(_,`Resolvedp)->parent_module_identifierp|`Canonical(p,_)->parent_module_identifierp|`Apply(m,_)->parent_module_identifierm|`Alias(dest,`Resolvedsrc)->ifis_resolved_hidden~weak_canonical_test:false(dest:>t)thenparent_module_identifiersrcelseparent_module_identifierdest|`Alias(dest,_src)->parent_module_identifierdest|`OpaqueModulem->parent_module_identifiermandparent_datatype_identifier:Paths_types.Resolved_path.datatype->Identifier.DataType.t=function|`Identifierid->(id:Identifier.Path.DataType.t:>Identifier.DataType.t)|`CanonicalDataType(_,`Resolvedp)->parent_datatype_identifierp|`CanonicalDataType(p,_)->parent_datatype_identifierp|`Type(m,n)->Identifier.Mk.type_(parent_module_identifierm,n)moduleModule=structtypet=Paths_types.Resolved_path.module_letis_hiddenm=is_resolved_hidden(m:t:>Paths_types.Resolved_path.any)endmoduleModuleType=structtypet=Paths_types.Resolved_path.module_typeendmoduleType=structtypet=Paths_types.Resolved_path.type_endmoduleDataType=structtypet=Paths_types.Resolved_path.datatypeendmoduleConstructor=structtypet=Paths_types.Resolved_path.constructorendmoduleValue=structtypet=Paths_types.Resolved_path.valueendmoduleClassType=structtypet=Paths_types.Resolved_path.class_typeendletrecidentifier:t->Identifier.t=function|`Identifierid->id|`Subst(sub,_)->identifier(sub:>t)|`Hiddenp->identifier(p:>t)|`Module(m,n)->Identifier.Mk.module_(parent_module_identifierm,n)|`Canonical(_,`Resolvedp)->identifier(p:>t)|`Canonical(p,_)->identifier(p:>t)|`Apply(m,_)->identifier(m:>t)|`Type(m,n)->Identifier.Mk.type_(parent_module_identifierm,n)|`Value(m,n)->Identifier.Mk.value(parent_module_identifierm,n)|`Constructor(m,n)->Identifier.Mk.constructor(parent_datatype_identifierm,n)|`ModuleType(m,n)->Identifier.Mk.module_type(parent_module_identifierm,n)|`Class(m,n)->Identifier.Mk.class_(parent_module_identifierm,n)|`ClassType(m,n)->Identifier.Mk.class_type(parent_module_identifierm,n)|`Alias(dest,`Resolvedsrc)->ifis_resolved_hidden~weak_canonical_test:false(dest:>t)thenidentifier(src:>t)elseidentifier(dest:>t)|`Alias(dest,_src)->identifier(dest:>t)|`AliasModuleType(sub,orig)->ifis_resolved_hidden~weak_canonical_test:false(sub:>t)thenidentifier(orig:>t)elseidentifier(sub:>t)|`SubstT(p,_)->identifier(p:>t)|`CanonicalModuleType(_,`Resolvedp)->identifier(p:>t)|`CanonicalModuleType(p,_)->identifier(p:>t)|`CanonicalType(_,`Resolvedp)->identifier(p:>t)|`CanonicalType(p,_)->identifier(p:>t)|`CanonicalDataType(_,`Resolvedp)->identifier(p:>t)|`CanonicalDataType(p,_)->identifier(p:>t)|`OpaqueModulem->identifier(m:>t)|`OpaqueModuleTypemt->identifier(mt:>t)letis_hiddenr=is_resolved_hidden~weak_canonical_test:falserendmoduleModule=structtypet=Paths_types.Path.module_endmoduleModuleType=structtypet=Paths_types.Path.module_typeendmoduleType=structtypet=Paths_types.Path.type_endmoduleDataType=structtypet=Paths_types.Path.datatypeendmoduleConstructor=structtypet=Paths_types.Path.constructorendmoduleValue=structtypet=Paths_types.Path.valueendmoduleClassType=structtypet=Paths_types.Path.class_typeendletis_hidden=is_path_hiddenendmoduleFragment=structmoduleResolved=structtypet=Paths_types.Resolved_fragment.anytyperoot=Paths_types.Resolved_fragment.rootmoduleSignature=structtypet=Paths_types.Resolved_fragment.signatureletrecsgidentifier:t->Identifier.Signature.t=function|`Root(`ModuleTypei)->Path.Resolved.parent_module_type_identifieri|`Root(`Modulei)->Path.Resolved.parent_module_identifieri|`Subst(s,_)->Path.Resolved.parent_module_type_identifiers|`Alias(i,_)->Path.Resolved.parent_module_identifieri|`Module(m,n)->Identifier.Mk.module_(sgidentifierm,n)|`OpaqueModulem->sgidentifier(m:>t)endmoduleModule=structtypet=Paths_types.Resolved_fragment.module_endmoduleModuleType=structtypet=Paths_types.Resolved_fragment.module_typeendmoduleType=structtypet=Paths_types.Resolved_fragment.type_endtypeleaf=Paths_types.Resolved_fragment.leafletrecidentifier:t->Identifier.t=function|`Root(`ModuleType_r)->assertfalse|`Root(`Module_r)->assertfalse|`Subst(s,_)->Path.Resolved.identifier(s:>Path.Resolved.t)|`Alias(p,_)->(Path.Resolved.parent_module_identifierp:>Identifier.t)|`Module(m,n)->Identifier.Mk.module_(Signature.sgidentifierm,n)|`Module_type(m,n)->Identifier.Mk.module_type(Signature.sgidentifierm,n)|`Type(m,n)->Identifier.Mk.type_(Signature.sgidentifierm,n)|`Class(m,n)->Identifier.Mk.class_(Signature.sgidentifierm,n)|`ClassType(m,n)->Identifier.Mk.class_type(Signature.sgidentifierm,n)|`OpaqueModulem->identifier(m:>t)letrecis_hidden:t->bool=function|`Root(`ModuleTyper)->Path.Resolved.(is_hidden(r:>t))|`Root(`Moduler)->Path.Resolved.(is_hidden(r:>t))|`Subst(s,_)->Path.Resolved.(is_hidden(s:>t))|`Alias(s,_)->Path.Resolved.(is_hidden(s:>t))|`Module(m,_)|`Module_type(m,_)|`Type(m,_)|`Class(m,_)|`ClassType(m,_)->is_hidden(m:>t)|`OpaqueModulem->is_hidden(m:>t)endtypet=Paths_types.Fragment.anymoduleSignature=structtypet=Paths_types.Fragment.signatureendmoduleModule=structtypet=Paths_types.Fragment.module_endmoduleModuleType=structtypet=Paths_types.Fragment.module_typeendmoduleType=structtypet=Paths_types.Fragment.type_endtypeleaf=Paths_types.Fragment.leafendmoduleReference=structmoduleResolved=structopenPaths_types.Resolved_referencetypet=Paths_types.Resolved_reference.anyletrecparent_signature_identifier:signature->Identifier.Signature.t=function|`Identifierid->id|`Hiddens->parent_signature_identifier(s:>signature)|`Alias(sub,orig)->ifPath.Resolved.(is_hidden(sub:>t))thenparent_signature_identifier(orig:>signature)else(Path.Resolved.parent_module_identifiersub:>Identifier.Signature.t)|`AliasModuleType(sub,orig)->ifPath.Resolved.(is_hidden(sub:>t))thenparent_signature_identifier(orig:>signature)else(Path.Resolved.parent_module_type_identifiersub:>Identifier.Signature.t)|`Module(m,n)->Identifier.Mk.module_(parent_signature_identifierm,n)|`ModuleType(m,s)->Identifier.Mk.module_type(parent_signature_identifierm,s)andparent_type_identifier:datatype->Identifier.DataType.t=function|`Identifierid->id|`Type(sg,s)->Identifier.Mk.type_(parent_signature_identifiersg,s)andparent_class_signature_identifier:class_signature->Identifier.ClassSignature.t=function|`Identifierid->id|`Class(sg,s)->Identifier.Mk.class_(parent_signature_identifiersg,s)|`ClassType(sg,s)->Identifier.Mk.class_type(parent_signature_identifiersg,s)andfield_parent_identifier:field_parent->Identifier.FieldParent.t=function|`Identifierid->id|(`Hidden_|`Alias_|`AliasModuleType_|`Module_|`ModuleType_)assg->(parent_signature_identifiersg:>Identifier.FieldParent.t)|`Type_ast->(parent_type_identifiert:>Identifier.FieldParent.t)andlabel_parent_identifier:label_parent->Identifier.LabelParent.t=function|`Identifierid->id|(`Class_|`ClassType_)asc->(parent_class_signature_identifierc:>Identifier.LabelParent.t)|(`Hidden_|`Alias_|`AliasModuleType_|`Module_|`ModuleType_|`Type_)asr->(field_parent_identifierr:>Identifier.LabelParent.t)andidentifier:t->Identifier.t=function|`Identifierid->id|(`Alias_|`AliasModuleType_|`Module_|`Hidden_|`Type_|`Class_|`ClassType_|`ModuleType_)asr->(label_parent_identifierr:>Identifier.t)|`Field(p,n)->Identifier.Mk.field(field_parent_identifierp,n)|`Constructor(s,n)->Identifier.Mk.constructor((parent_type_identifiers:>Identifier.DataType.t),n)|`Extension(p,q)->Identifier.Mk.extension(parent_signature_identifierp,q)|`ExtensionDecl(p,q,r)->Identifier.Mk.extension_decl(parent_signature_identifierp,(q,r))|`Exception(p,q)->Identifier.Mk.exception_(parent_signature_identifierp,q)|`Value(p,q)->Identifier.Mk.value(parent_signature_identifierp,q)|`Method(p,q)->Identifier.Mk.method_(parent_class_signature_identifierp,q)|`InstanceVariable(p,q)->Identifier.Mk.instance_variable(parent_class_signature_identifierp,q)|`Label(p,q)->Identifier.Mk.label(label_parent_identifierp,q)moduleSignature=structtypet=Paths_types.Resolved_reference.signatureendmoduleClassSignature=structtypet=Paths_types.Resolved_reference.class_signatureendmoduleDataType=structtypet=Paths_types.Resolved_reference.datatypeendmoduleFieldParent=structtypet=Paths_types.Resolved_reference.field_parentendmoduleLabelParent=structtypet=Paths_types.Resolved_reference.label_parentendmoduleModule=structtypet=Paths_types.Resolved_reference.module_endmoduleModuleType=structtypet=Paths_types.Resolved_reference.module_typeendmoduleType=structtypet=Paths_types.Resolved_reference.type_endmoduleConstructor=structtypet=Paths_types.Resolved_reference.constructorendmoduleField=structtypet=Paths_types.Resolved_reference.fieldendmoduleExtension=structtypet=Paths_types.Resolved_reference.extensionendmoduleExtensionDecl=structtypet=Paths_types.Resolved_reference.extension_declendmoduleException=structtypet=Paths_types.Resolved_reference.exception_endmoduleValue=structtypet=Paths_types.Resolved_reference.valueendmoduleClass=structtypet=Paths_types.Resolved_reference.class_endmoduleClassType=structtypet=Paths_types.Resolved_reference.class_typeendmoduleMethod=structtypet=Paths_types.Resolved_reference.method_endmoduleInstanceVariable=structtypet=Paths_types.Resolved_reference.instance_variableendmoduleLabel=structtypet=Paths_types.Resolved_reference.labelendmodulePage=structtypet=Paths_types.Resolved_reference.pageendendtypet=Paths_types.Reference.anytypetag_any=Paths_types.Reference.tag_anymoduleSignature=structtypet=Paths_types.Reference.signatureendmoduleClassSignature=structtypet=Paths_types.Reference.class_signatureendmoduleDataType=structtypet=Paths_types.Reference.datatypeendmoduleFragmentTypeParent=structtypet=Paths_types.Reference.fragment_type_parentendmoduleLabelParent=structtypet=Paths_types.Reference.label_parentendmoduleModule=structtypet=Paths_types.Reference.module_endmoduleModuleType=structtypet=Paths_types.Reference.module_typeendmoduleType=structtypet=Paths_types.Reference.type_endmoduleConstructor=structtypet=Paths_types.Reference.constructorendmoduleField=structtypet=Paths_types.Reference.fieldendmoduleExtension=structtypet=Paths_types.Reference.extensionendmoduleExtensionDecl=structtypet=Paths_types.Reference.extension_declendmoduleException=structtypet=Paths_types.Reference.exception_endmoduleValue=structtypet=Paths_types.Reference.valueendmoduleClass=structtypet=Paths_types.Reference.class_endmoduleClassType=structtypet=Paths_types.Reference.class_typeendmoduleMethod=structtypet=Paths_types.Reference.method_endmoduleInstanceVariable=structtypet=Paths_types.Reference.instance_variableendmoduleLabel=structtypet=Paths_types.Reference.labelendmodulePage=structtypet=Paths_types.Reference.pageendend