123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223openOdoc_model.LangopenOdoc_model.Pathsletlist_concat_mapfl=letrecauxfacc=function|[]->List.revacc|x::l->letxs=fxinauxf(List.rev_appendxsacc)linauxf[]ltypetype_decl_entry={canonical:Path.Type.toption;equation:TypeDecl.Equation.t;representation:TypeDecl.Representation.toption;}typeclass_type_entry={virtual_:bool;params:TypeDecl.paramlist}typemethod_entry={private_:bool;virtual_:bool;type_:TypeExpr.t}typeclass_entry={virtual_:bool;params:TypeDecl.paramlist}typetype_extension_entry={type_path:Path.Type.t;type_params:TypeDecl.paramlist;private_:bool;}typeconstructor_entry={args:TypeDecl.Constructor.argument;res:TypeExpr.t;}typefield_entry={mutable_:bool;type_:TypeExpr.t;parent_type:TypeExpr.t;}typeinstance_variable_entry={mutable_:bool;virtual_:bool;type_:TypeExpr.t;}typedoc_entry=Paragraph|Heading|CodeBlock|MathBlock|Verbatimtypevalue_entry={value:Value.value;type_:TypeExpr.t}typekind=|TypeDecloftype_decl_entry|Module|Valueofvalue_entry|Docofdoc_entry|Exceptionofconstructor_entry|Class_typeofclass_type_entry|Methodofmethod_entry|Classofclass_entry|TypeExtensionoftype_extension_entry|ExtensionConstructorofconstructor_entry|ModuleType|Constructorofconstructor_entry|Fieldoffield_entrymoduleHtml=Tyxml.Htmltypet={id:Odoc_model.Paths.Identifier.Any.t;doc:Odoc_model.Comment.docs;kind:kind;}letentry~id~doc~kind=letid=(id:>Odoc_model.Paths.Identifier.Any.t)in{id;kind;doc}letvarify_params=List.mapi(funiparam->matchparam.TypeDecl.descwith|Varname->TypeExpr.Varname|Any->Var(Printf.sprintf"tv_%i"i))letentry_of_constructorid_parentparams(constructor:TypeDecl.Constructor.t)=letargs=constructor.argsinletres=matchconstructor.reswith|Someres->res|None->letparams=varify_paramsparamsinTypeExpr.Constr(`Identifier((id_parent:>Odoc_model.Paths.Identifier.Path.Type.t),false),params)inletkind=Constructor{args;res}inentry~id:constructor.id~doc:constructor.doc~kindletentry_of_extension_constructorid_parentparams(constructor:Extension.Constructor.t)=letargs=constructor.argsinletres=matchconstructor.reswith|Someres->res|None->letparams=varify_paramsparamsinTypeExpr.Constr(id_parent,params)inletkind=ExtensionConstructor{args;res}inentry~id:constructor.id~doc:constructor.doc~kindletentry_of_fieldid_parentparams(field:TypeDecl.Field.t)=letparams=varify_paramsparamsinletparent_type=TypeExpr.Constr(`Identifier((id_parent:>Odoc_model.Paths.Identifier.Path.Type.t),false),params)inletkind=Field{mutable_=field.mutable_;type_=field.type_;parent_type}inentry~id:field.id~doc:field.doc~kindletrecentries_of_docsid(d:Odoc_model.Comment.docs)=list_concat_map(entries_of_docid)dandentries_of_docidd=matchd.valuewith|`Paragraph_->[entry~id~doc:[d]~kind:(DocParagraph)]|`Tag_->[]|`List(_,ds)->list_concat_map(entries_of_docsid)(ds:>Odoc_model.Comment.docslist)|`Heading(_,lbl,_)->[entry~id:lbl~doc:[d]~kind:(DocHeading)]|`Modules_->[]|`Code_block(_,_,o)->leto=matchowith|None->[]|Someo->entries_of_docsid(o:>Odoc_model.Comment.docs)inentry~id~doc:[d]~kind:(DocCodeBlock)::o|`Verbatim_->[entry~id~doc:[d]~kind:(DocVerbatim)]|`Math_block_->[entry~id~doc:[d]~kind:(DocMathBlock)]|`Table_->[]letentries_of_itemid(x:Odoc_model.Fold.item)=matchxwith|CompilationUnitu->(matchu.contentwith|Modulem->[entry~id:u.id~doc:m.doc~kind:Module]|Pack_->[])|TypeDecltd->letkind=TypeDecl{canonical=td.canonical;equation=td.equation;representation=td.representation;}inlettd_entry=entry~id:td.id~doc:td.doc~kindinletsubtype_entries=matchtd.representationwith|None->[]|Some(Variantli)->List.map(entry_of_constructortd.idtd.equation.params)li|Some(Recordfields)->List.map(entry_of_fieldtd.idtd.equation.params)fields|SomeExtensible->[]intd_entry::subtype_entries|Modulem->[entry~id:m.id~doc:m.doc~kind:Module]|Valuev->letkind=Value{value=v.value;type_=v.type_}in[entry~id:v.id~doc:v.doc~kind]|Exceptionexc->letres=matchexc.reswith|None->TypeExpr.Constr(Odoc_model.Predefined.exn_path,[])|Somex->xinletkind=Exception{args=exc.args;res}in[entry~id:exc.id~doc:exc.doc~kind]|ClassTypect->letkind=Class_type{virtual_=ct.virtual_;params=ct.params}in[entry~id:ct.id~doc:ct.doc~kind]|Methodm->letkind=Method{virtual_=m.virtual_;private_=m.private_;type_=m.type_}in[entry~id:m.id~doc:m.doc~kind]|Classcl->letkind=Class{virtual_=cl.virtual_;params=cl.params}in[entry~id:cl.id~doc:cl.doc~kind]|Extensionte->(matchte.constructorswith|[]->[]|c::_->(* Type extension do not have an ID yet... we use the first
constructor for the url. Unfortunately, this breaks the uniqueness
of the ID in the search index... *)lettype_entry=letkind=TypeExtension{type_path=te.type_path;type_params=te.type_params;private_=te.private_;}inentry~id:c.id~doc:te.doc~kindintype_entry::List.map(entry_of_extension_constructorte.type_pathte.type_params)te.constructors)|ModuleTypemt->[entry~id:mt.id~doc:mt.doc~kind:ModuleType]|Doc`Stop->[]|Doc(`Docsd)->entries_of_docsidd