123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368openOdoc_model.NamesopenComponenttypemodule_=[`FModuleofModuleName.t*Module.t]typemodule_type=[`FModuleTypeofModuleTypeName.t*ModuleType.t]typedatatype=[`FTypeofTypeName.t*TypeDecl.t]typeclass_=[`FClassofClassName.t*Class.t|`FClassTypeofClassTypeName.t*ClassType.t]typevalue=[`FValueofValueName.t*Value.t]typelabel=[`FLabelofLabel.t]typeexception_=[`FExnofExceptionName.t*Exception.t]typeextension=[`FExtofExtension.t*Extension.Constructor.t]typesubstitution=[`FModule_substofModuleSubstitution.t|`FType_substofTypeDecl.t|`FModuleType_substofModuleTypeSubstitution.t]typesignature=[module_|module_type]typetype_=[datatype|class_]typelabel_parent=[signature|type_]typeconstructor=[`FConstructorofTypeDecl.Constructor.t]typefield=[`FFieldofTypeDecl.Field.t]typeany_in_type=[constructor|field]typeany_in_type_in_sig=[`In_typeofOdoc_model.Names.TypeName.t*TypeDecl.t*any_in_type]typeany_in_sig=[label_parent|value|label|exception_|extension|substitution|any_in_type_in_sig]typeinstance_variable=[`FInstance_variableofInstanceVariableName.t*InstanceVariable.t]typemethod_=[`FMethodofMethodName.t*Method.t]typeany_in_class_sig=[instance_variable|method_]moduleN=Ident.Nameletrecfind_mapf=function|hd::tl->(matchfhdwithSome_asx->x|None->find_mapftl)|[]->Noneletfind_in_sigsgf=letrecinnerf=function|Signature.Includei::tl->(matchinnerfi.Include.expansion_.itemswith|Some_asx->x|None->innerftl)|hd::tl->(matchfhdwithSome_asx->x|None->innerftl)|[]->Noneininnerfsg.Signature.itemsletfilter_in_sigsgf=letrecinnerf=function|Signature.Includei::tl->innerfi.Include.expansion_.items@innerftl|hd::tl->(matchfhdwithSomex->x::innerftl|None->innerftl)|[]->[]ininnerfsg.Signature.items(** Returns the last element of a list. Used to implement [_unambiguous]
functions. *)letrecdisambiguate=function|[x]->Somex|[]->None|_::tl->disambiguatetlletmodule_in_sigsgname=find_in_sigsg(function|Signature.Module(id,_,m)whenN.module_id=name->Some(`FModule(N.typed_moduleid,Delayed.getm))|_->None)letmodule_type_in_sigsgname=find_in_sigsg(function|Signature.ModuleType(id,mt)whenN.module_typeid=name->Some(`FModuleType(N.typed_module_typeid,Delayed.getmt))|_->None)lettype_in_sigsgname=find_in_sigsg(function|Signature.Type(id,_,m)whenN.type_id=name->Some(`FType(N.type'id,Delayed.getm))|Class(id,_,c)whenN.class_id=name->Some(`FClass(N.class'id,c))|ClassType(id,_,c)whenN.class_typeid=name->Some(`FClassType(N.class_type'id,c))|_->None)letdatatype_in_sigsgname=find_in_sigsg(function|Signature.Type(id,_,m)whenN.type_id=name->Some(`FType(N.type'id,Delayed.getm))|_->None)typeremoved_type=[`FType_removedofTypeName.t*TypeExpr.t*TypeDecl.Equation.t]typecareful_module=[module_|`FModule_removedofCpath.Resolved.module_]typecareful_module_type=[module_type|`FModuleType_removedofModuleType.expr]typecareful_type=[type_|removed_type]typecareful_datatype=[datatype|removed_type]typecareful_class=[class_|removed_type]letcareful_module_in_sigsgname=letremoved_module=function|Signature.RModule(id,p)whenN.module_id=name->Some(`FModule_removedp)|_->Noneinmatchmodule_in_sigsgnamewith|Some_asx->x|None->find_mapremoved_modulesg.Signature.removedletcareful_module_type_in_sigsgname=letremoved_module_type=function|Signature.RModuleType(id,p)whenN.module_typeid=name->Some(`FModuleType_removedp)|_->Noneinmatchmodule_type_in_sigsgnamewith|Some_asx->x|None->find_mapremoved_module_typesg.Signature.removedletremoved_type_in_sigsgname=letremoved_type=function|Signature.RType(id,p,eq)whenN.type_id=name->Some(`FType_removed(N.type'id,p,eq))|_->Noneinfind_mapremoved_typesg.Signature.removedletcareful_type_in_sigsgname=matchtype_in_sigsgnamewith|Some_asx->x|None->removed_type_in_sigsgnameletcareful_datatype_in_sigsgname=matchdatatype_in_sigsgnamewith|Some_asx->x|None->removed_type_in_sigsgnameletclass_in_sigsgname=filter_in_sigsg(function|Signature.Class(id,_,c)whenN.class_id=name->Some(`FClass(N.class'id,c))|Signature.ClassType(id,_,c)whenN.class_typeid=name->Some(`FClassType(N.class_type'id,c))|_->None)letclass_in_sig_unambiguoussgname=disambiguate(class_in_sigsgname)letcareful_class_in_sigsgname=matchclass_in_sig_unambiguoussgnamewith|Some_asx->x|None->removed_type_in_sigsgnameletconstructor_in_type(typ:TypeDecl.t)name=letrecfind_cons=function|({TypeDecl.Constructor.name=name';_}ascons)::_whenname'=name->Some(`FConstructorcons)|_::tl->find_constl|[]->Noneinmatchtyp.representationwith|Some(Variantcons)->find_conscons|Some(Record_)|SomeExtensible|None->Noneletany_in_type(typ:TypeDecl.t)name=letrecfind_cons=function|({TypeDecl.Constructor.name=name';_}ascons)::_whenname'=name->Some(`FConstructorcons)|_::tl->find_constl|[]->Noneinletrecfind_field=function|({TypeDecl.Field.name=name';_}asfield)::_whenname'=name->Some(`FFieldfield)|_::tl->find_fieldtl|[]->Noneinmatchtyp.representationwith|Some(Variantcons)->find_conscons|Some(Recordfields)->find_fieldfields|SomeExtensible|None->Noneletany_in_typext(typext:Extension.t)name=letrecinner=function|({Extension.Constructor.name=name';_}ascons)::_whenname'=name->Some(`FExt(typext,cons))|_::tl->innertl|[]->Noneininnertypext.constructorsletany_in_commentdname=letrecinnerxs=matchxswith|elt::rest->(matchelt.Odoc_model.Location_.valuewith|`HeadinglblwhenIdent.Name.labellbl.Label.label=name->Some(`FLabellbl)|_->innerrest)|[]->Noneininnerdletany_in_sigsgname=filter_in_sigsg(function|Signature.Module(id,_,m)whenN.module_id=name->Some(`FModule(N.typed_moduleid,Delayed.getm))|ModuleSubstitution(id,ms)whenN.module_id=name->Some(`FModule_substms)|ModuleType(id,mt)whenN.module_typeid=name->Some(`FModuleType(N.typed_module_typeid,Delayed.getmt))|Type(id,_,t)whenN.type_id=name->Some(`FType(N.type'id,Delayed.gett))|TypeSubstitution(id,ts)whenN.type_id=name->Some(`FType_substts)|Exception(id,exc)whenN.exception_id=name->Some(`FExn(N.typed_exceptionid,exc))|Value(id,v)whenN.valueid=name->Some(`FValue(N.typed_valueid,Delayed.getv))|Class(id,_,c)whenN.class_id=name->Some(`FClass(N.class'id,c))|ClassType(id,_,ct)whenN.class_typeid=name->Some(`FClassType(N.class_type'id,ct))|Type(id,_,t)->(lettyp=Delayed.gettinmatchany_in_typetypnamewith|Somer->Some(`In_type(N.type'id,typ,r))|None->None)|TypExttypext->any_in_typexttypextname|Comment(`Docsd)->any_in_commentdname|_->None)letsignature_in_sigsgname=filter_in_sigsg(function|Signature.Module(id,_,m)whenN.module_id=name->Some(`FModule(N.typed_moduleid,Delayed.getm))|ModuleType(id,mt)whenN.module_typeid=name->Some(`FModuleType(N.typed_module_typeid,Delayed.getmt))|_->None)letmodule_type_in_sigsgname=find_in_sigsg(function|Signature.ModuleType(id,m)whenN.module_typeid=name->Some(`FModuleType(N.typed_module_typeid,Delayed.getm))|_->None)letvalue_in_sigsgname=filter_in_sigsg(function|Signature.Value(id,m)whenN.valueid=name->Some(`FValue(N.typed_valueid,Delayed.getm))|_->None)letvalue_in_sig_unambiguoussgname=disambiguate(value_in_sigsgname)letlabel_in_sigsgname=filter_in_sigsg(function|Signature.Comment(`Docsd)->any_in_commentdname|_->None)letexception_in_sigsgname=find_in_sigsg(function|Signature.Exception(id,e)whenN.exception_id=name->Some(`FExn(N.typed_exceptionid,e))|_->None)letextension_in_sigsgname=letrecinnert=function|ec::_whenec.Extension.Constructor.name=name->Some(`FExt(t,ec))|_::tl->innerttl|[]->Noneinfind_in_sigsg(function|Signature.TypExtt->innertt.Extension.constructors|_->None)letlabel_parent_in_sigsgname=filter_in_sigsg(function|Signature.Module(id,_,m)whenN.module_id=name->Some(`FModule(N.typed_moduleid,Component.Delayed.getm))|ModuleType(id,mt)whenN.module_typeid=name->Some(`FModuleType(N.typed_module_typeid,Component.Delayed.getmt))|Type(id,_,t)whenN.type_id=name->Some(`FType(N.type'id,Component.Delayed.gett))|Class(id,_,c)whenN.class_id=name->Some(`FClass(N.class'id,c))|ClassType(id,_,c)whenN.class_typeid=name->Some(`FClassType(N.class_type'id,c))|_->None)letany_in_type_in_sigsgname=filter_in_sigsg(function|Signature.Type(id,_,t)->(lett=Delayed.gettinmatchany_in_typetnamewith|Somex->Some(`In_type(N.type'id,t,x))|None->None)|_->None)letfilter_in_class_signaturecsf=letrecinner=function|ClassSignature.Inherit{expr;_}::tl->inner_inheritexpr@innertl|it::tl->(matchfitwithSomex->x::innertl|None->innertl)|[]->[]andinner_inherit=function|Constr_->[]|Signaturecs->innercs.itemsininnercs.ClassSignature.itemsletfind_in_class_signaturecsf=matchfilter_in_class_signaturecsfwith[]->None|x::_->Somexletany_in_class_signaturecsname=filter_in_class_signaturecs(function|ClassSignature.Method(id,m)whenN.method_id=name->Some(`FMethod(N.typed_methodid,m))|InstanceVariable(id,iv)whenN.instance_variableid=name->Some(`FInstance_variable(N.typed_instance_variableid,iv))|_->None)letmethod_in_class_signaturecsname=find_in_class_signaturecs(function|ClassSignature.Method(id,m)whenN.method_id=name->Some(`FMethod(N.typed_methodid,m))|_->None)letinstance_variable_in_class_signaturecsname=find_in_class_signaturecs(function|ClassSignature.InstanceVariable(id,iv)whenN.instance_variableid=name->Some(`FInstance_variable(N.typed_instance_variableid,iv))|_->None)