···2222module Identifier = struct
2323 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string }
24242525- type t = Paths_types.Identifier.any
2525+ module Id = Paths_types.Identifier
26262727- type t_pv = Paths_types.Identifier.any_pv
2727+ type t = Id.any
2828+2929+ type t_pv = Id.any_pv
28302931 let rec name_aux : t -> string =
3032 fun x ->
···52545355 let name : [< t_pv ] id -> string = fun n -> name_aux (n :> t)
54565555- let rec root id =
5656- match id.iv with
5757- | `Root _ as root -> Some { id with iv = root }
5858- | `Module (parent, _) -> root (parent :> t)
5959- | `Parameter (parent, _) -> root (parent :> t)
6060- | `Result x -> root (x :> t)
6161- | `ModuleType (parent, _) -> root (parent :> t)
6262- | `Type (parent, _) -> root (parent :> t)
6363- | `Constructor (parent, _) -> root (parent :> t)
6464- | `Field (parent, _) -> root (parent :> t)
6565- | `Extension (parent, _) -> root (parent :> t)
6666- | `Exception (parent, _) -> root (parent :> t)
6767- | `Value (parent, _) -> root (parent :> t)
6868- | `Class (parent, _) -> root (parent :> t)
6969- | `ClassType (parent, _) -> root (parent :> t)
7070- | `Method (parent, _) -> root (parent :> t)
7171- | `InstanceVariable (parent, _) -> root (parent :> t)
7272- | `Label (parent, _) -> root (parent :> t)
7373- | `Page _ | `LeafPage _ | `CoreType _ | `CoreException _ -> None
7474-7575- let root id = root (id :> t)
7676-7757 let rec label_parent_aux =
7878- let open Paths_types.Identifier in
7979- fun (n : any) ->
5858+ let open Id in
5959+ fun (n : t) ->
8060 match n with
8161 | { iv = `Result i; _ } -> label_parent_aux (i :> any)
8262 | { iv = `CoreType _; _ } | { iv = `CoreException _; _ } -> assert false
···1098911090 type any = t
111919292+ type any_pv = t_pv
9393+9494+ module type IdSig = sig
9595+ type t
9696+ type t_pv
9797+ val equal : t -> t -> bool
9898+ val hash : t -> int
9999+ val compare : t -> t -> int
100100+ end
101101+112102 module Any = struct
113103 type t = any
114114-104104+ type t_pv = any_pv
115105 let equal = equal
116116-117106 let hash = hash
118118-119107 let compare = compare
120108 end
121109122110 module Signature = struct
123123- type t = Paths_types.Identifier.signature
124124-125125- type t_pv = Paths_types.Identifier.signature_pv
126126-111111+ type t = Id.signature
112112+ type t_pv = Id.signature_pv
127113 let equal = equal
128128-129114 let hash = hash
130130-131115 let compare = compare
132132-133133- let rec root = function
134134- | { iv = `Root _; _ } as root -> root
135135- | {
136136- iv =
137137- ( `ModuleType (parent, _)
138138- | `Module (parent, _)
139139- | `Parameter (parent, _) );
140140- _;
141141- } ->
142142- root parent
143143- | { iv = `Result x; _ } -> root x
144144-145145- let root id = root (id :> t)
146116 end
147117148118 module ClassSignature = struct
149149- type t = Paths_types.Identifier.class_signature
150150-151151- type t_pv = Paths_types.Identifier.class_signature_pv
152152-119119+ type t = Id.class_signature
120120+ type t_pv = Id.class_signature_pv
153121 let equal = equal
154154-155122 let hash = hash
156156-157123 let compare = compare
158124 end
159125160126 module DataType = struct
161161- type t = Paths_types.Identifier.datatype
162162-163163- type t_pv = Paths_types.Identifier.datatype_pv
164164-165165- let equal = equal
166166-167167- let hash = hash
168168-169169- let compare = compare
127127+ type t = Id.datatype
128128+ type t_pv = Id.datatype_pv
170129 end
171130172131 module Parent = struct
173173- type t = Paths_types.Identifier.parent
174174-175175- type t_pv = Paths_types.Identifier.parent_pv
176176-177177- let equal = equal
178178-179179- let hash = hash
180180-181181- let compare = compare
132132+ type t = Id.parent
133133+ type t_pv = Id.parent_pv
182134 end
183135184136 module LabelParent = struct
185185- type t = Paths_types.Identifier.label_parent
186186-187187- type t_pv = Paths_types.Identifier.label_parent_pv
188188-137137+ type t = Id.label_parent
138138+ type t_pv = Id.label_parent_pv
189139 let equal = equal
190190-191140 let hash = hash
192192-193141 let compare = compare
194142 end
195143196144 module RootModule = struct
197197- type t = Paths_types.Identifier.root_module
198198-199199- type t_pv = Paths_types.Identifier.root_module_pv
200200-145145+ type t = Id.root_module
146146+ type t_pv = Id.root_module_pv
201147 let equal = equal
202202-203148 let hash = hash
204204-205149 let compare = compare
206206-207207- let name { iv = `Root (_, name); _ } = ModuleName.to_string name
208150 end
209151210152 module Module = struct
211211- type t = Paths_types.Identifier.module_
212212-213213- type t_pv = Paths_types.Identifier.module_pv
214214-153153+ type t = Id.module_
154154+ type t_pv = Id.module_pv
215155 let equal = equal
216216-217156 let hash = hash
218218-219157 let compare = compare
220220-221221- let root id = Signature.root (id :> Signature.t)
222158 end
223159224160 module FunctorParameter = struct
225225- type t = Paths_types.Identifier.functor_parameter
226226-227227- type t_pv = Paths_types.Identifier.functor_parameter_pv
228228-161161+ type t = Id.functor_parameter
162162+ type t_pv = Id.functor_parameter_pv
229163 let equal = equal
230230-231164 let hash = hash
232232-233165 let compare = compare
234166 end
235167236168 module FunctorResult = struct
237237- type t = Paths_types.Identifier.functor_result
238238-239239- type t_pv = Paths_types.Identifier.functor_result_pv
240240-241241- let equal = equal
242242-243243- let hash = hash
244244-245245- let compare = compare
169169+ type t = Id.functor_result
170170+ type t_pv = Id.functor_result_pv
246171 end
247172248173 module ModuleType = struct
249249- type t = Paths_types.Identifier.module_type
250250-251251- type t_pv = Paths_types.Identifier.module_type_pv
252252-174174+ type t = Id.module_type
175175+ type t_pv = Id.module_type_pv
253176 let equal = equal
254254-255177 let hash = hash
256256-257178 let compare = compare
258179 end
259180260181 module Type = struct
261261- type t = Paths_types.Identifier.type_
262262-263263- type t_pv = Paths_types.Identifier.type_pv
264264-182182+ type t = Id.type_
183183+ type t_pv = Id.type_pv
265184 let equal = equal
266266-267185 let hash = hash
268268-269186 let compare = compare
270187 end
271188272189 module Constructor = struct
273273- type t = Paths_types.Identifier.constructor
274274-275275- type t_pv = Paths_types.Identifier.constructor_pv
276276-277277- let equal = equal
278278-279279- let hash = hash
280280-281281- let compare = compare
190190+ type t = Id.constructor
191191+ type t_pv = Id.constructor_pv
282192 end
283193284194 module Field = struct
285285- type t = Paths_types.Identifier.field
286286-287287- type t_pv = Paths_types.Identifier.field_pv
288288-289289- let equal = equal
290290-291291- let hash = hash
292292-293293- let compare = compare
195195+ type t = Id.field
196196+ type t_pv = Id.field_pv
294197 end
295198296199 module Extension = struct
297297- type t = Paths_types.Identifier.extension
298298-299299- type t_pv = Paths_types.Identifier.extension_pv
300300-301301- let equal = equal
302302-303303- let hash = hash
304304-305305- let compare = compare
200200+ type t = Id.extension
201201+ type t_pv = Id.extension_pv
306202 end
307203308204 module Exception = struct
309309- type t = Paths_types.Identifier.exception_
310310-311311- type t_pv = Paths_types.Identifier.exception_pv
312312-313313- let equal = equal
314314-315315- let hash = hash
316316-317317- let compare = compare
205205+ type t = Id.exception_
206206+ type t_pv = Id.exception_pv
318207 end
319208320209 module Value = struct
321321- type t = Paths_types.Identifier.value
322322-323323- type t_pv = Paths_types.Identifier.value_pv
324324-325325- let equal = equal
326326-327327- let hash = hash
328328-329329- let compare = compare
210210+ type t = Id.value
211211+ type t_pv = Id.value_pv
330212 end
331213332214 module Class = struct
333333- type t = Paths_types.Identifier.class_
334334-335335- type t_pv = Paths_types.Identifier.class_pv
336336-215215+ type t = Id.class_
216216+ type t_pv = Id.class_pv
337217 let equal = equal
338338-339218 let hash = hash
340340-341219 let compare = compare
342220 end
343221344222 module ClassType = struct
345345- type t = Paths_types.Identifier.class_type
346346-347347- type t_pv = Paths_types.Identifier.class_type_pv
348348-223223+ type t = Id.class_type
224224+ type t_pv = Id.class_type_pv
349225 let equal = equal
350350-351226 let hash = hash
352352-353227 let compare = compare
354228 end
355229356230 module Method = struct
357357- type t = Paths_types.Identifier.method_
358358-359359- type t_pv = Paths_types.Identifier.method_pv
360360-361361- let equal = equal
362362-363363- let hash = hash
364364-365365- let compare = compare
231231+ type t = Id.method_
232232+ type t_pv = Id.method_pv
366233 end
367234368235 module InstanceVariable = struct
369369- type t = Paths_types.Identifier.instance_variable
370370-371371- type t_pv = Paths_types.Identifier.instance_variable_pv
372372-373373- let equal = equal
374374-375375- let hash = hash
376376-377377- let compare = compare
236236+ type t = Id.instance_variable
237237+ type t_pv = Id.instance_variable_pv
378238 end
379239380240 module Label = struct
381241 type t = Paths_types.Identifier.label
382382-383242 type t_pv = Paths_types.Identifier.label_pv
384384-385243 let equal = equal
386386-387244 let hash = hash
388388-389245 let compare = compare
390246 end
391247392248 module Page = struct
393393- type t = Paths_types.Identifier.page
394394-395395- type t_pv = Paths_types.Identifier.page_pv
396396-397397- let equal = equal
398398-399399- let hash = hash
400400-401401- let compare = compare
249249+ type t = Id.page
250250+ type t_pv = Id.page_pv
402251 end
403252404253 module ContainerPage = struct
405405- type t = Paths_types.Identifier.container_page
406406-407407- type t_pv = Paths_types.Identifier.container_page_pv
408408-409409- let equal = equal
410410-411411- let hash = hash
412412-413413- let compare = compare
254254+ type t = Id.container_page
255255+ type t_pv = Id.container_page_pv
414256 end
415257416258 module SourceDir = struct
417417- type t = Paths_types.Identifier.source_dir
418418- type t_pv = Paths_types.Identifier.source_dir_pv
259259+ type t = Id.source_dir
260260+ type t_pv = Id.source_dir_pv
419261 let equal = equal
420262 let hash = hash
421263 let compare = compare
···425267 end
426268427269 module SourcePage = struct
428428- type t = Paths_types.Identifier.source_page
429429- type t_pv = Paths_types.Identifier.source_page_pv
270270+ type t = Id.source_page
271271+ type t_pv = Id.source_page_pv
430272 let equal = equal
431431- let hash = hash
432432- let compare = compare
433273 let name { iv = `SourcePage (p, name); _ } = SourceDir.name p ^ name
274274+434275 end
435276436277 module OdocId = struct
437437- type t = Paths_types.Identifier.odoc_id
438438-439439- type t_pv = Paths_types.Identifier.odoc_id_pv
440440-441441- let equal = equal
442442-443443- let hash = hash
444444-445445- let compare = compare
278278+ type t = Id.odoc_id
279279+ type t_pv = Id.odoc_id_pv
446280 end
447281448282 module Path = struct
449283 module Module = struct
450450- type t = Paths_types.Identifier.path_module
451451-452452- type t_pv = Paths_types.Identifier.path_module_pv
453453-284284+ type t = Id.path_module
285285+ type t_pv = Id.path_module_pv
454286 let equal = equal
455455-456287 let hash = hash
457457-458288 let compare = compare
459459-460460- let root id = Signature.root (id :> Signature.t)
461289 end
462290463291 module ModuleType = struct
464464- type t = Paths_types.Identifier.path_module_type
465465-292292+ type t = Id.path_module_type
293293+ type t_pv = Id.module_type_pv
466294 let equal = equal
467467-468295 let hash = hash
469469-470296 let compare = compare
471297 end
472298473299 module Type = struct
474474- type t = Paths_types.Identifier.path_type
475475-476476- type t_pv = Paths_types.Identifier.path_type_pv
477477-300300+ type t = Id.path_type
301301+ type t_pv = Id.path_type_pv
478302 let equal = equal
479479-480303 let hash = hash
481481-482304 let compare = compare
483305 end
484306485307 module ClassType = struct
486486- type t = Paths_types.Identifier.path_class_type
487487-488488- type t_pv = Paths_types.Identifier.path_class_type_pv
489489-308308+ type t = Id.path_class_type
309309+ type t_pv = Id.path_class_type_pv
490310 let equal = equal
491491-492311 let hash = hash
493493-494312 let compare = compare
495313 end
496314497497- type t = Paths_types.Identifier.path_any
315315+ type t = Id.path_any
498316 end
499317500318 module Maps = struct
···774592775593 let is_hidden m =
776594 is_resolved_hidden (m : t :> Paths_types.Resolved_path.any)
777777-778778- let rec identifier : t -> Identifier.Path.Module.t =
779779- fun x ->
780780- let r = identifier in
781781- match x with
782782- | `Identifier id -> id
783783- | `Subst (_, x) -> r x
784784- | `Hidden p -> r p
785785- | `Module (m, n) -> Identifier.Mk.module_ (parent_module_identifier m, n)
786786- | `Canonical (p, _) -> r p
787787- | `Apply (m, _) -> r m
788788- | `Alias (dest, _src) -> r dest
789789- | `OpaqueModule m -> r m
790790-791791- let rec root : t -> string option = function
792792- | `Identifier id -> (
793793- match Identifier.root (id :> Identifier.t) with
794794- | Some root -> Some (Identifier.name root)
795795- | None -> None)
796796- | `Subst (_, p)
797797- | `Hidden p
798798- | `Module (p, _)
799799- | `Canonical (p, _)
800800- | `Apply (p, _)
801801- | `Alias (p, _)
802802- | `OpaqueModule p ->
803803- root p
804595 end
805596806597 module ModuleType = struct
807598 type t = Paths_types.Resolved_path.module_type
808808-809809- let is_hidden m =
810810- is_resolved_hidden (m : t :> Paths_types.Resolved_path.any)
811599 end
812600813601 module Type = struct
814602 type t = Paths_types.Resolved_path.type_
815815-816816- let of_ident id = `Identifier id
817817-818818- let is_hidden m =
819819- is_resolved_hidden ~weak_canonical_test:false
820820- (m : t :> Paths_types.Resolved_path.any)
821603 end
822604823605 module ClassType = struct
824606 type t = Paths_types.Resolved_path.class_type
825825-826826- let of_ident id = `Identifier id
827827-828828- let is_hidden m =
829829- is_resolved_hidden ~weak_canonical_test:false
830830- (m : t :> Paths_types.Resolved_path.any)
831607 end
832608833609 let rec identifier : t -> Identifier.t = function
···866642867643 module Module = struct
868644 type t = Paths_types.Path.module_
869869-870870- let rec root : t -> string option = function
871871- | `Resolved r -> Resolved.Module.root r
872872- | `Identifier (id, _) -> (
873873- match Identifier.root (id :> Identifier.t) with
874874- | Some root -> Some (Identifier.name root)
875875- | None -> None)
876876- | `Root s -> Some s
877877- | `Forward _ -> None
878878- | `Dot (p, _) | `Apply (p, _) -> root p
879645 end
880646881647 module ModuleType = struct
···899665900666 type root = Paths_types.Resolved_fragment.root
901667902902- let sig_of_mod m =
903903- let open Paths_types.Resolved_fragment in
904904- (m : module_ :> signature)
905905-906906- type base_name =
907907- | Base of root
908908- | Branch of ModuleName.t * Paths_types.Resolved_fragment.signature
909909-910910- let rec split_parent : Paths_types.Resolved_fragment.signature -> base_name
911911- = function
912912- | `Root i -> Base i
913913- | `Subst (_, p) -> split_parent (sig_of_mod p)
914914- | `Alias (_, p) -> split_parent (sig_of_mod p)
915915- | `OpaqueModule m -> split_parent (sig_of_mod m)
916916- | `Module (p, name) -> (
917917- match split_parent p with
918918- | Base i -> Branch (name, `Root i)
919919- | Branch (base, m) -> Branch (base, `Module (m, name)))
920920-921668 module Signature = struct
922669 type t = Paths_types.Resolved_fragment.signature
923670924924- let rec split : t -> string * t option = function
925925- | `Root _ -> ("", None)
926926- | `Subst (_, p) -> split (sig_of_mod p)
927927- | `Alias (_, p) -> split (sig_of_mod p)
928928- | `OpaqueModule m -> split (sig_of_mod m)
929929- | `Module (m, name) -> (
930930- match split_parent m with
931931- | Base _ -> (ModuleName.to_string name, None)
932932- | Branch (base, m) ->
933933- (ModuleName.to_string base, Some (`Module (m, name))))
934934-935935- let rec identifier : t -> Identifier.Signature.t = function
671671+ let rec sgidentifier : t -> Identifier.Signature.t = function
936672 | `Root (`ModuleType i) -> Path.Resolved.parent_module_type_identifier i
937673 | `Root (`Module i) -> Path.Resolved.parent_module_identifier i
938674 | `Subst (s, _) -> Path.Resolved.parent_module_type_identifier s
939675 | `Alias (i, _) -> Path.Resolved.parent_module_identifier i
940940- | `Module (m, n) -> Identifier.Mk.module_ (identifier m, n)
941941- | `OpaqueModule m -> identifier (sig_of_mod m)
676676+ | `Module (m, n) -> Identifier.Mk.module_ (sgidentifier m, n)
677677+ | `OpaqueModule m -> sgidentifier (m :> t)
942678 end
943679944680 module Module = struct
945681 type t = Paths_types.Resolved_fragment.module_
946946-947947- let rec split : t -> string * t option = function
948948- | `Subst (_, p) -> split p
949949- | `Alias (_, p) -> split p
950950- | `Module (m, name) -> (
951951- match split_parent m with
952952- | Base _ -> (ModuleName.to_string name, None)
953953- | Branch (base, m) ->
954954- (ModuleName.to_string base, Some (`Module (m, name))))
955955- | `OpaqueModule m -> split m
956682 end
957683958684 module ModuleType = struct
959685 type t = Paths_types.Resolved_fragment.module_type
960960-961961- let split : t -> string * t option = function
962962- | `Module_type (m, name) -> (
963963- match split_parent m with
964964- | Base _ -> (ModuleTypeName.to_string name, None)
965965- | Branch (base, m) ->
966966- (ModuleName.to_string base, Some (`Module_type (m, name))))
967686 end
968687969688 module Type = struct
970689 type t = Paths_types.Resolved_fragment.type_
971971-972972- let split : t -> string * t option = function
973973- | `Type (m, name) -> (
974974- match split_parent m with
975975- | Base _ -> (TypeName.to_string name, None)
976976- | Branch (base, m) ->
977977- (ModuleName.to_string base, Some (`Type (m, name))))
978978- | `Class (m, name) -> (
979979- match split_parent m with
980980- | Base _ -> (ClassName.to_string name, None)
981981- | Branch (base, m) ->
982982- (ModuleName.to_string base, Some (`Class (m, name))))
983983- | `ClassType (m, name) -> (
984984- match split_parent m with
985985- | Base _ -> (ClassTypeName.to_string name, None)
986986- | Branch (base, m) ->
987987- (ModuleName.to_string base, Some (`ClassType (m, name))))
988690 end
989691990692 type leaf = Paths_types.Resolved_fragment.leaf
···995697 | `Subst (s, _) -> Path.Resolved.identifier (s :> Path.Resolved.t)
996698 | `Alias (p, _) ->
997699 (Path.Resolved.parent_module_identifier p :> Identifier.t)
998998- | `Module (m, n) -> Identifier.Mk.module_ (Signature.identifier m, n)
700700+ | `Module (m, n) -> Identifier.Mk.module_ (Signature.sgidentifier m, n)
999701 | `Module_type (m, n) ->
10001000- Identifier.Mk.module_type (Signature.identifier m, n)
10011001- | `Type (m, n) -> Identifier.Mk.type_ (Signature.identifier m, n)
10021002- | `Class (m, n) -> Identifier.Mk.class_ (Signature.identifier m, n)
10031003- | `ClassType (m, n) -> Identifier.Mk.class_type (Signature.identifier m, n)
702702+ Identifier.Mk.module_type (Signature.sgidentifier m, n)
703703+ | `Type (m, n) -> Identifier.Mk.type_ (Signature.sgidentifier m, n)
704704+ | `Class (m, n) -> Identifier.Mk.class_ (Signature.sgidentifier m, n)
705705+ | `ClassType (m, n) ->
706706+ Identifier.Mk.class_type (Signature.sgidentifier m, n)
1004707 | `OpaqueModule m -> identifier (m :> t)
10057081006709 let rec is_hidden : t -> bool = function
10071007- | `Root (`ModuleType r) ->
10081008- Path.is_resolved_hidden ~weak_canonical_test:false
10091009- (r :> Path.Resolved.t)
10101010- | `Root (`Module r) ->
10111011- Path.is_resolved_hidden ~weak_canonical_test:false
10121012- (r :> Path.Resolved.t)
10131013- | `Subst (s, _) ->
10141014- Path.is_resolved_hidden ~weak_canonical_test:false
10151015- (s :> Path.Resolved.t)
10161016- | `Alias (s, _) ->
10171017- Path.is_resolved_hidden ~weak_canonical_test:false
10181018- (s :> Path.Resolved.t)
710710+ | `Root (`ModuleType r) -> Path.Resolved.(is_hidden (r :> t))
711711+ | `Root (`Module r) -> Path.Resolved.(is_hidden (r :> t))
712712+ | `Subst (s, _) -> Path.Resolved.(is_hidden (s :> t))
713713+ | `Alias (s, _) -> Path.Resolved.(is_hidden (s :> t))
1019714 | `Module (m, _)
1020715 | `Module_type (m, _)
1021716 | `Type (m, _)
···1026721 end
10277221028723 type t = Paths_types.Fragment.any
10291029-10301030- type base_name =
10311031- | Base of Resolved.root option
10321032- | Branch of ModuleName.t * Paths_types.Fragment.signature
10331033-10341034- let rec split_parent : Paths_types.Fragment.signature -> base_name = function
10351035- | `Root -> Base None
10361036- | `Resolved r -> (
10371037- match Resolved.split_parent r with
10381038- | Resolved.Base i -> Base (Some i)
10391039- | Resolved.Branch (base, m) -> Branch (base, `Resolved m))
10401040- | `Dot (m, name) -> (
10411041- match split_parent m with
10421042- | Base None -> Branch (ModuleName.make_std name, `Root)
10431043- | Base (Some i) -> Branch (ModuleName.make_std name, `Resolved (`Root i))
10441044- | Branch (base, m) -> Branch (base, `Dot (m, name)))
10457241046725 module Signature = struct
1047726 type t = Paths_types.Fragment.signature
10481048-10491049- let split : t -> string * t option = function
10501050- | `Root -> ("", None)
10511051- | `Resolved r ->
10521052- let base, m = Resolved.Signature.split r in
10531053- let m = match m with None -> None | Some m -> Some (`Resolved m) in
10541054- (base, m)
10551055- | `Dot (m, name) -> (
10561056- match split_parent m with
10571057- | Base _ -> (name, None)
10581058- | Branch (base, m) ->
10591059- (ModuleName.to_string base, Some (`Dot (m, name))))
1060727 end
10617281062729 module Module = struct
1063730 type t = Paths_types.Fragment.module_
10641064-10651065- let split : t -> string * t option = function
10661066- | `Resolved r ->
10671067- let base, m = Resolved.Module.split r in
10681068- let m = match m with None -> None | Some m -> Some (`Resolved m) in
10691069- (base, m)
10701070- | `Dot (m, name) -> (
10711071- match split_parent m with
10721072- | Base _ -> (name, None)
10731073- | Branch (base, m) ->
10741074- (ModuleName.to_string base, Some (`Dot (m, name))))
1075731 end
10767321077733 module ModuleType = struct
1078734 type t = Paths_types.Fragment.module_type
10791079-10801080- let split : t -> string * t option = function
10811081- | `Resolved r ->
10821082- let base, m = Resolved.ModuleType.split r in
10831083- let m = match m with None -> None | Some m -> Some (`Resolved m) in
10841084- (base, m)
10851085- | `Dot (m, name) -> (
10861086- match split_parent m with
10871087- | Base _ -> (name, None)
10881088- | Branch (base, m) ->
10891089- (ModuleName.to_string base, Some (`Dot (m, name))))
1090735 end
10917361092737 module Type = struct
1093738 type t = Paths_types.Fragment.type_
10941094-10951095- let split : t -> string * t option = function
10961096- | `Resolved r ->
10971097- let base, m = Resolved.Type.split r in
10981098- let m = match m with None -> None | Some m -> Some (`Resolved m) in
10991099- (base, m)
11001100- | `Dot (m, name) -> (
11011101- match split_parent m with
11021102- | Base _ -> (name, None)
11031103- | Branch (base, m) ->
11041104- (ModuleName.to_string base, Some (`Dot (m, name))))
1105739 end
11067401107741 type leaf = Paths_types.Fragment.leaf
···1118752 | `Identifier id -> id
1119753 | `Hidden s -> parent_signature_identifier (s :> signature)
1120754 | `Alias (sub, orig) ->
11211121- if Path.Resolved.Module.is_hidden ~weak_canonical_test:false sub then
755755+ if Path.Resolved.(is_hidden (sub :> t)) then
1122756 parent_signature_identifier (orig :> signature)
1123757 else
1124758 (Path.Resolved.parent_module_identifier sub
1125759 :> Identifier.Signature.t)
1126760 | `AliasModuleType (sub, orig) ->
11271127- if Path.Resolved.ModuleType.is_hidden ~weak_canonical_test:false sub
11281128- then parent_signature_identifier (orig :> signature)
761761+ if Path.Resolved.(is_hidden (sub :> t)) then
762762+ parent_signature_identifier (orig :> signature)
1129763 else
1130764 (Path.Resolved.parent_module_type_identifier sub
1131765 :> Identifier.Signature.t)
+82-333
src/model/paths.mli
···24242525 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string }
26262727- module Any : sig
2828- type t = Paths_types.Identifier.any
2929-2727+ module type IdSig = sig
2828+ type t
2929+ type t_pv
3030 val equal : t -> t -> bool
3131-3231 val hash : t -> int
3333-3432 val compare : t -> t -> int
3533 end
36343737- module RootModule : sig
3838- type t = Paths_types.Identifier.root_module
3535+ module Id = Paths_types.Identifier
39364040- type t_pv = Paths_types.Identifier.root_module_pv
3737+ module Any : IdSig with type t = Id.any and type t_pv = Id.any_pv
41384242- val equal : t -> t -> bool
3939+ module RootModule :
4040+ IdSig with type t = Id.root_module and type t_pv = Id.root_module_pv
43414444- val hash : t -> int
4242+ module Signature :
4343+ IdSig with type t = Id.signature and type t_pv = Id.signature_pv
45444646- val compare : t -> t -> int
4545+ module ClassSignature :
4646+ IdSig with type t = Id.class_signature and type t_pv = Id.class_signature_pv
47474848- val name : t -> string
4949- end
4848+ module LabelParent :
4949+ IdSig with type t = Id.label_parent and type t_pv = Id.label_parent_pv
50505151- module Signature : sig
5252- type t = Paths_types.Identifier.signature
5151+ module Module : IdSig with type t = Id.module_ and type t_pv = Id.module_pv
53525454- type t_pv = Paths_types.Identifier.signature_pv
5353+ module FunctorParameter :
5454+ IdSig
5555+ with type t = Id.functor_parameter
5656+ and type t_pv = Id.functor_parameter_pv
55575656- val equal : t -> t -> bool
5858+ module ModuleType :
5959+ IdSig with type t = Id.module_type and type t_pv = Id.module_type_pv
57605858- val hash : t -> int
6161+ module Type : IdSig with type t = Id.type_ and type t_pv = Id.type_pv
59626060- val compare : t -> t -> int
6363+ module SourceDir : sig
61646262- val root : [< t_pv ] id -> RootModule.t
6565+ include IdSig with type t = Id.source_dir and type t_pv = Id.source_dir_pv
6666+ val name : t -> string
6367 end
64686565- module ClassSignature : sig
6666- type t = Paths_types.Identifier.class_signature
6767-6868- type t_pv = Paths_types.Identifier.class_signature_pv
6969-7070- val equal : t -> t -> bool
7171-7272- val hash : t -> int
6969+ module Class : IdSig with type t = Id.class_ and type t_pv = Id.class_pv
73707474- val compare : t -> t -> int
7575- end
7171+ module ClassType :
7272+ IdSig with type t = Id.class_type and type t_pv = Id.class_type_pv
76737774 module DataType : sig
7878- type t = Paths_types.Identifier.datatype
7979-8080- type t_pv = Paths_types.Identifier.datatype_pv
8181-8282- val equal : t -> t -> bool
8383-8484- val hash : t -> int
8585-8686- val compare : t -> t -> int
7575+ type t = Id.datatype
7676+ type t_pv = Id.datatype_pv
8777 end
8888-8978 module Parent : sig
9090- type t = Paths_types.Identifier.parent
9191-9292- type t_pv = Paths_types.Identifier.parent_pv
9393-9494- val equal : t -> t -> bool
9595-9696- val hash : t -> int
9797-9898- val compare : t -> t -> int
9999- end
100100-101101- module LabelParent : sig
102102- type t = Paths_types.Identifier.label_parent
103103-104104- type t_pv = Paths_types.Identifier.label_parent_pv
105105-106106- val equal : t -> t -> bool
107107-108108- val hash : t -> int
109109-110110- val compare : t -> t -> int
111111- end
112112-113113- module Module : sig
114114- type t = Paths_types.Identifier.module_
115115-116116- type t_pv = Paths_types.Identifier.module_pv
117117-118118- val equal : t -> t -> bool
119119-120120- val hash : t -> int
121121-122122- val compare : t -> t -> int
123123-124124- val root : t -> RootModule.t
125125- end
126126-127127- module FunctorParameter : sig
128128- type t = Paths_types.Identifier.functor_parameter
129129-130130- type t_pv = Paths_types.Identifier.functor_parameter_pv
131131-132132- val equal : t -> t -> bool
133133-134134- val hash : t -> int
135135-136136- val compare : t -> t -> int
7979+ type t = Id.parent
8080+ type t_pv = Id.parent_pv
13781 end
1388213983 module FunctorResult : sig
140140- type t = Paths_types.Identifier.functor_result
141141-142142- type t_pv = Paths_types.Identifier.functor_result_pv
143143-144144- val equal : t -> t -> bool
145145-146146- val hash : t -> int
147147-148148- val compare : t -> t -> int
149149- end
150150-151151- module ModuleType : sig
152152- type t = Paths_types.Identifier.module_type
153153-154154- type t_pv = Paths_types.Identifier.module_type_pv
155155-156156- val equal : t -> t -> bool
157157-158158- val hash : t -> int
159159-160160- val compare : t -> t -> int
161161- end
162162-163163- module Type : sig
164164- type t = Paths_types.Identifier.type_
165165-166166- type t_pv = Paths_types.Identifier.type_pv
167167-168168- val equal : t -> t -> bool
169169-170170- val hash : t -> int
171171-172172- val compare : t -> t -> int
8484+ type t = Id.functor_result
8585+ type t_pv = Id.functor_result_pv
17386 end
1748717588 module Constructor : sig
176176- type t = Paths_types.Identifier.constructor
177177-178178- type t_pv = Paths_types.Identifier.constructor_pv
179179-180180- val equal : t -> t -> bool
181181-182182- val hash : t -> int
183183-184184- val compare : t -> t -> int
8989+ type t = Id.constructor
9090+ type t_pv = Id.constructor_pv
18591 end
1869218793 module Field : sig
188188- type t = Paths_types.Identifier.field
189189-190190- type t_pv = Paths_types.Identifier.field_pv
191191-192192- val equal : t -> t -> bool
193193-194194- val hash : t -> int
195195-196196- val compare : t -> t -> int
9494+ type t = Id.field
9595+ type t_pv = Id.field_pv
19796 end
1989719998 module Extension : sig
200200- type t = Paths_types.Identifier.extension
201201-202202- type t_pv = Paths_types.Identifier.extension_pv
203203-204204- val equal : t -> t -> bool
205205-206206- val hash : t -> int
207207-208208- val compare : t -> t -> int
9999+ type t = Id.extension
100100+ type t_pv = Id.extension_pv
209101 end
210102211103 module Exception : sig
212212- type t = Paths_types.Identifier.exception_
213213-214214- type t_pv = Paths_types.Identifier.exception_pv
215215-216216- val equal : t -> t -> bool
217217-218218- val hash : t -> int
219219-220220- val compare : t -> t -> int
104104+ type t = Id.exception_
105105+ type t_pv = Id.exception_pv
221106 end
222107223108 module Value : sig
224224- type t = Paths_types.Identifier.value
225225-226226- type t_pv = Paths_types.Identifier.value_pv
227227-228228- val equal : t -> t -> bool
229229-230230- val hash : t -> int
231231-232232- val compare : t -> t -> int
233233- end
234234-235235- module Class : sig
236236- type t = Paths_types.Identifier.class_
237237-238238- type t_pv = Paths_types.Identifier.class_pv
239239-240240- val equal : t -> t -> bool
241241-242242- val hash : t -> int
243243-244244- val compare : t -> t -> int
245245- end
246246-247247- module ClassType : sig
248248- type t = Paths_types.Identifier.class_type
249249-250250- type t_pv = Paths_types.Identifier.class_type_pv
251251-252252- val equal : t -> t -> bool
253253-254254- val hash : t -> int
255255-256256- val compare : t -> t -> int
109109+ type t = Id.value
110110+ type t_pv = Id.value_pv
257111 end
258112259113 module Method : sig
260260- type t = Paths_types.Identifier.method_
261261-262262- type t_pv = Paths_types.Identifier.method_pv
263263-264264- val equal : t -> t -> bool
265265-266266- val hash : t -> int
267267-268268- val compare : t -> t -> int
114114+ type t = Id.method_
115115+ type t_pv = Id.method_pv
269116 end
270117271118 module InstanceVariable : sig
272272- type t = Paths_types.Identifier.instance_variable
273273-274274- type t_pv = Paths_types.Identifier.instance_variable_pv
275275-276276- val equal : t -> t -> bool
277277-278278- val hash : t -> int
279279-280280- val compare : t -> t -> int
281281- end
282282-283283- module Label : sig
284284- type t = Paths_types.Identifier.label
285285-286286- type t_pv = Paths_types.Identifier.label_pv
287287-288288- val equal : t -> t -> bool
289289-290290- val hash : t -> int
291291-292292- val compare : t -> t -> int
119119+ type t = Id.instance_variable
120120+ type t_pv = Id.instance_variable_pv
293121 end
122122+ module Label :
123123+ IdSig
124124+ with type t = Paths_types.Identifier.label
125125+ and type t_pv = Paths_types.Identifier.label_pv
294126295127 module Page : sig
296296- type t = Paths_types.Identifier.page
297297-298298- type t_pv = Paths_types.Identifier.page_pv
299299-300300- val equal : t -> t -> bool
301301-302302- val hash : t -> int
303303-304304- val compare : t -> t -> int
128128+ type t = Id.page
129129+ type t_pv = Id.page_pv
305130 end
306131307132 module ContainerPage : sig
308308- type t = Paths_types.Identifier.container_page
309309-310310- type t_pv = Paths_types.Identifier.container_page_pv
311311-312312- val equal : t -> t -> bool
313313-314314- val hash : t -> int
315315-316316- val compare : t -> t -> int
317317- end
318318-319319- module SourceDir : sig
320320- type t = Paths_types.Identifier.source_dir
321321- type t_pv = Paths_types.Identifier.source_dir_pv
322322- val equal : t -> t -> bool
323323- val hash : t -> int
324324- val compare : t -> t -> int
325325- val name : t -> string
133133+ type t = Id.container_page
134134+ type t_pv = Id.container_page_pv
326135 end
327136328137 module SourcePage : sig
329329- type t = Paths_types.Identifier.source_page
330330- type t_pv = Paths_types.Identifier.source_page_pv
138138+ type t = Id.source_page
139139+ type t_pv = Id.source_page_pv
140140+ val name : t -> string
331141 val equal : t -> t -> bool
332332- val hash : t -> int
333333- val compare : t -> t -> int
334334- val name : t -> string
335142 end
336336-337143 module OdocId : sig
338338- type t = Paths_types.Identifier.odoc_id
339339-340340- type t_pv = Paths_types.Identifier.odoc_id_pv
341341-342342- val equal : t -> t -> bool
343343-344344- val hash : t -> int
345345-346346- val compare : t -> t -> int
144144+ type t = Id.odoc_id
145145+ type t_pv = Id.odoc_id_pv
347146 end
348147349148 module Path : sig
350350- module Module : sig
351351- type t = Paths_types.Identifier.path_module
352352-353353- type t_pv = Paths_types.Identifier.path_module_pv
354354-355355- val equal : t -> t -> bool
356356-357357- val hash : t -> int
358358-359359- val compare : t -> t -> int
360360-361361- val root : t -> RootModule.t
362362- end
363363-364364- module ModuleType : sig
365365- type t = Paths_types.Identifier.path_module_type
366366-367367- val equal : t -> t -> bool
368368-369369- val hash : t -> int
370370-371371- val compare : t -> t -> int
372372- end
373373-374374- module Type : sig
375375- type t = Paths_types.Identifier.path_type
376376-377377- type t_pv = Paths_types.Identifier.path_type_pv
149149+ module Module :
150150+ IdSig with type t = Id.path_module and type t_pv = Id.path_module_pv
378151379379- val equal : t -> t -> bool
152152+ module ModuleType :
153153+ IdSig with type t = Id.path_module_type and type t_pv = Id.module_type_pv
380154381381- val hash : t -> int
155155+ module Type :
156156+ IdSig with type t = Id.path_type and type t_pv = Id.path_type_pv
382157383383- val compare : t -> t -> int
384384- end
158158+ module ClassType :
159159+ IdSig
160160+ with type t = Id.path_class_type
161161+ and type t_pv = Id.path_class_type_pv
385162386386- module ClassType : sig
387387- type t = Paths_types.Identifier.path_class_type
388388-389389- type t_pv = Paths_types.Identifier.path_class_type_pv
390390-391391- val equal : t -> t -> bool
392392-393393- val hash : t -> int
394394-395395- val compare : t -> t -> int
396396- end
397397-398398- type t = Paths_types.Identifier.path_any
163163+ type t = Id.path_any
399164 end
400165401401- type t_pv = Paths_types.Identifier.any_pv
166166+ type t = Id.any
402167403403- type t = Paths_types.Identifier.any
168168+ type t_pv = Id.any_pv
404169405170 val hash : t -> int
406171407172 val name : [< t_pv ] id -> string
408173409409- val root : [< t_pv ] id -> RootModule.t_pv id option
174174+ (* val root : [< t_pv ] id -> RootModule.t_pv id option *)
410175411176 val compare : t -> t -> int
412177···523288524289 val is_hidden : t -> weak_canonical_test:bool -> bool
525290526526- val identifier : t -> Identifier.Path.Module.t
291291+ (* val identifier : t -> Identifier.Path.Module.t *)
527292528528- val root : t -> string option
293293+ (* val root : t -> string option *)
529294 end
530295531296 module ModuleType : sig
532297 type t = Paths_types.Resolved_path.module_type
533298534534- val is_hidden : t -> weak_canonical_test:bool -> bool
299299+ (* val is_hidden : t -> weak_canonical_test:bool -> bool *)
535300536301 (* val identifier : t -> Identifier.Path.ModuleType.t *)
537302 end
···539304 module Type : sig
540305 type t = Paths_types.Resolved_path.type_
541306542542- val of_ident : Identifier.Path.Type.t -> t
307307+ (* val of_ident : Identifier.Path.Type.t -> t *)
543308544544- val is_hidden : t -> bool
309309+ (* val is_hidden : t -> bool *)
545310546311 (* val identifier : t -> Identifier.Path.Type.t *)
547312 end
···549314 module ClassType : sig
550315 type t = Paths_types.Resolved_path.class_type
551316552552- val of_ident : Identifier.Path.ClassType.t -> t
317317+ (* val of_ident : Identifier.Path.ClassType.t -> t *)
553318554554- val is_hidden : t -> bool
319319+ (* val is_hidden : t -> bool *)
555320 end
556321557322 type t = Paths_types.Resolved_path.any
···564329 module Module : sig
565330 type t = Paths_types.Path.module_
566331567567- val root : t -> string option
332332+ (* val root : t -> string option *)
568333 end
569334570335 module ModuleType : sig
···589354 module Resolved : sig
590355 module Signature : sig
591356 type t = Paths_types.Resolved_fragment.signature
592592-593593- val split : t -> string * t option
594357 end
595358596359 module Module : sig
597360 type t = Paths_types.Resolved_fragment.module_
598598-599599- val split : t -> string * t option
600361 end
601362602363 module ModuleType : sig
603364 type t = Paths_types.Resolved_fragment.module_type
604604-605605- val split : t -> string * t option
606365 end
607366608367 module Type : sig
609368 type t = Paths_types.Resolved_fragment.type_
610610-611611- val split : t -> string * t option
612369 end
613370614371 type leaf = Paths_types.Resolved_fragment.leaf
···624381625382 module Signature : sig
626383 type t = Paths_types.Fragment.signature
627627-628628- val split : t -> string * t option
629384 end
630385631386 module Module : sig
632387 type t = Paths_types.Fragment.module_
633633-634634- val split : t -> string * t option
635388 end
636389637390 module ModuleType : sig
638391 type t = Paths_types.Fragment.module_type
639639-640640- val split : t -> string * t option
641392 end
642393643394 module Type : sig
644395 type t = Paths_types.Fragment.type_
645645-646646- val split : t -> string * t option
647396 end
648397649398 type leaf = Paths_types.Fragment.leaf
+1-3
src/odoc/compile.ml
···309309 | { Paths.Identifier.iv = `Page _; _ } as parent_id ->
310310 let name = Paths.Identifier.Mk.source_page (parent_id, name) in
311311 if
312312- List.exists
313313- (Paths.Identifier.SourcePage.equal name)
314314- page.source_children
312312+ List.exists (Paths.Identifier.SourcePage.equal name) page.source_children
315313 then Ok (Some name)
316314 else err_not_parent ()
317315 | { iv = `LeafPage _; _ } -> err_not_parent ())
+3-5
src/xref2/cpath.ml
···219219220220and is_resolved_module_type_hidden : Resolved.module_type -> bool = function
221221 | `Local _ -> false
222222- | `Gpath p ->
223223- Odoc_model.Paths.Path.Resolved.ModuleType.is_hidden
224224- ~weak_canonical_test:false p
222222+ | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t))
225223 | `Substituted p -> is_resolved_module_type_hidden p
226224 | `ModuleType (p, _) -> is_resolved_parent_hidden ~weak_canonical_test:false p
227225 | `SubstT (p1, p2) ->
···247245248246and is_resolved_type_hidden : Resolved.type_ -> bool = function
249247 | `Local _ -> false
250250- | `Gpath p -> Odoc_model.Paths.Path.Resolved.Type.is_hidden p
248248+ | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t))
251249 | `Substituted p -> is_resolved_type_hidden p
252250 | `CanonicalType (_, `Resolved _) -> false
253251 | `CanonicalType (p, _) -> is_resolved_type_hidden p
···256254257255and is_resolved_class_type_hidden : Resolved.class_type -> bool = function
258256 | `Local _ -> false
259259- | `Gpath p -> Odoc_model.Paths.Path.Resolved.ClassType.is_hidden p
257257+ | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t))
260258 | `Substituted p -> is_resolved_class_type_hidden p
261259 | `Class (p, _) | `ClassType (p, _) ->
262260 is_resolved_parent_hidden ~weak_canonical_test:false p
+1-1
src/xref2/link.ml
···847847 let hidden_path =
848848 match equation.Equation.manifest with
849849 | Some (Constr (`Resolved path, params))
850850- when Paths.Path.Resolved.Type.is_hidden path
850850+ when Paths.Path.Resolved.(is_hidden (path :> t))
851851 || Paths.Path.Resolved.(identifier (path :> t))
852852 = (t.id :> Paths.Identifier.t) ->
853853 Some (path, params)