diff --git a/doc/driver.md b/doc/driver.md index 79e8246d28..de618d0a72 100644 --- a/doc/driver.md +++ b/doc/driver.md @@ -607,254 +607,6 @@ Let's see if there was any output from the `odoc` invocations: "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"map.mli\", line 331, characters 16-24:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).map Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 248, characters 16-36:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 242, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_binding Couldn't find \"S\""; - "odoc_model.odoc: File \"map.mli\", line 223, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; - "odoc_model.odoc: File \"set.mli\", line 208, characters 16-32:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 204, characters 16-28:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt Couldn't find \"S\""; - "odoc_model.odoc: File \"set.mli\", line 189, characters 16-23:"; - "odoc_model.odoc: Warning: Failed to resolve reference unresolvedroot(Make) Couldn't find \"Make\""; "'../src/odoc/bin/main.exe' 'link' 'odoc_examples.odoc' '-I' '.'"; "odoc_examples.odoc: File \"set.mli\", line 208, characters 16-32:"; "odoc_examples.odoc: Warning: Failed to resolve reference unresolvedroot(S).min_elt_opt Couldn't find \"S\""; @@ -879,5 +631,5 @@ Let's see if there was any output from the `odoc` invocations: "'../src/odoc/bin/main.exe' 'html-generate' 'odoc_document.odocl' '-o' 'html' '--theme-uri' 'odoc' '--support-uri' 'odoc'"; "odoc_document.odocl: Warning, resolved hidden path: Odoc_document__Types.Inline.one"; "'../src/odoc/bin/main.exe' 'html-generate' 'odoc_examples.odocl' '-o' 'html' '--theme-uri' 'odoc' '--support-uri' 'odoc'"; - "odoc_examples.odocl: Warning, resolved hidden path: Odoc_examples__Unexposed.t"] + "odoc_examples.odocl: Warning, resolved hidden path: Odoc_examples__.Unexposed.t"] ``` diff --git a/src/document/comment.ml b/src/document/comment.ml index b1e11c4376..a2cd4e8fc8 100644 --- a/src/document/comment.ml +++ b/src/document/comment.ml @@ -301,7 +301,7 @@ let heading_level_to_int = function | `Paragraph -> 4 | `Subparagraph -> 5 -let heading (attrs, `Label (_, label), text) = +let heading (attrs, { Odoc_model.Paths.iv = `Label (_, label); _ }, text) = let label = Odoc_model.Names.LabelName.to_string label in let title = non_link_inline_element_list text in let level = heading_level_to_int attrs.Comment.heading_level in diff --git a/src/document/generator.ml b/src/document/generator.ml index f246c7f947..d9b97db3c3 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1091,37 +1091,37 @@ module Make (Syntax : SYNTAX) = struct end = struct let internal_module m = let open Lang.Module in - match m.id with + match m.id.iv with | `Module (_, name) when ModuleName.is_internal name -> true | _ -> false let internal_type t = let open Lang.TypeDecl in - match t.id with + match t.id.iv with | `Type (_, name) when TypeName.is_internal name -> true | _ -> false let internal_value v = let open Lang.Value in - match v.id with + match v.id.iv with | `Value (_, name) when ValueName.is_internal name -> true | _ -> false let internal_module_type t = let open Lang.ModuleType in - match t.id with + match t.id.iv with | `ModuleType (_, name) when ModuleTypeName.is_internal name -> true | _ -> false let internal_module_substitution t = let open Lang.ModuleSubstitution in - match t.id with + match t.id.iv with | `Module (_, name) when ModuleName.is_internal name -> true | _ -> false let internal_module_type_substitution t = let open Lang.ModuleTypeSubstitution in - match t.id with + match t.id.iv with | `ModuleType (_, name) when ModuleTypeName.is_internal name -> true | _ -> false @@ -1684,7 +1684,7 @@ module Make (Syntax : SYNTAX) = struct let page (t : Odoc_model.Lang.Page.t) : Page.t = let name = - match t.name with `Page (_, name) | `LeafPage (_, name) -> name + match t.name.iv with `Page (_, name) | `LeafPage (_, name) -> name in let title = Odoc_model.Names.PageName.to_string name in let url = Url.Path.from_identifier t.name in diff --git a/src/document/url.ml b/src/document/url.ml index 72990e5d34..eb0c146a5f 100644 --- a/src/document/url.ml +++ b/src/document/url.ml @@ -3,12 +3,13 @@ open Odoc_model.Paths open Odoc_model.Names module Root = Odoc_model.Root -let functor_arg_pos (`Parameter (p, _)) = +let functor_arg_pos : Odoc_model.Paths.Identifier.FunctorParameter.t -> int = + fun { Odoc_model.Paths.iv = `Parameter (p, _); _ } -> let rec inner_sig = function - | `Result p -> 1 + inner_sig p + | `Result { Odoc_model.Paths.iv = p; _ } -> 1 + inner_sig p | `Module _ | `ModuleType _ | `Root _ | `Parameter _ -> 1 in - inner_sig p + inner_sig p.Odoc_model.Paths.iv let render_path : Odoc_model.Paths.Path.t -> string = let open Odoc_model.Paths.Path in @@ -20,13 +21,21 @@ let render_path : Odoc_model.Paths.Path.t -> string = | `OpaqueModuleType p -> render_resolved (p :> t) | `Subst (_, p) -> render_resolved (p :> t) | `SubstT (_, p) -> render_resolved (p :> t) - | `Alias (p1, p2) -> - if Odoc_model.Paths.Path.is_hidden (`Resolved (p2 :> t)) then - render_resolved (p1 :> t) - else render_resolved (p2 :> t) + | `Alias (dest, `Resolved src) -> + if + Odoc_model.Paths.Path.Resolved.Module.is_hidden + ~weak_canonical_test:false src + then render_resolved (dest :> t) + else render_resolved (src :> t) + | `Alias (dest, src) -> + if Odoc_model.Paths.Path.is_hidden (src :> Path.t) then + render_resolved (dest :> t) + else render_path (src :> Path.t) | `AliasModuleType (p1, p2) -> - if Odoc_model.Paths.Path.is_hidden (`Resolved (p2 :> t)) then - render_resolved (p1 :> t) + if + Odoc_model.Paths.Path.Resolved.ModuleType.is_hidden + ~weak_canonical_test:false p2 + then render_resolved (p1 :> t) else render_resolved (p2 :> t) | `Hidden p -> render_resolved (p :> t) | `Module (p, s) -> render_resolved (p :> t) ^ "." ^ ModuleName.to_string s @@ -47,7 +56,9 @@ let render_path : Odoc_model.Paths.Path.t -> string = | `Class (p, s) -> render_resolved (p :> t) ^ "." ^ ClassName.to_string s | `ClassType (p, s) -> render_resolved (p :> t) ^ "." ^ ClassTypeName.to_string s - and render_path : Odoc_model.Paths.Path.t -> string = function + and render_path : Odoc_model.Paths.Path.t -> string = + fun x -> + match x with | `Identifier (id, _) -> Identifier.name id | `Root root -> root | `Forward root -> root @@ -74,8 +85,12 @@ end let ( >>= ) x f = match x with Ok x -> f x | Error _ as e -> e module Path = struct - type source = - [ Identifier.Page.t | Identifier.Signature.t | Identifier.ClassSignature.t ] + type source_pv = + [ Identifier.Page.t_pv + | Identifier.Signature.t_pv + | Identifier.ClassSignature.t_pv ] + + and source = source_pv Odoc_model.Paths.id type kind = [ `Module @@ -103,8 +118,10 @@ module Path = struct let mk ?parent kind name = { kind; parent; name } - let rec from_identifier : source -> t = function - | `Root (parent, unit_name) -> + let rec from_identifier : source -> t = + fun x -> + match x with + | { iv = `Root (parent, unit_name); _ } -> let parent = match parent with | Some p -> Some (from_identifier (p :> source)) @@ -113,7 +130,7 @@ module Path = struct let kind = `Module in let page = ModuleName.to_string unit_name in mk ?parent kind page - | `Page (parent, page_name) -> + | { iv = `Page (parent, page_name); _ } -> let parent = match parent with | Some p -> Some (from_identifier (p :> source)) @@ -122,7 +139,7 @@ module Path = struct let kind = `Page in let page = PageName.to_string page_name in mk ?parent kind page - | `LeafPage (parent, page_name) -> + | { iv = `LeafPage (parent, page_name); _ } -> let parent = match parent with | Some p -> Some (from_identifier (p :> source)) @@ -131,12 +148,12 @@ module Path = struct let kind = `LeafPage in let page = PageName.to_string page_name in mk ?parent kind page - | `Module (parent, mod_name) -> + | { iv = `Module (parent, mod_name); _ } -> let parent = from_identifier (parent :> source) in let kind = `Module in let page = ModuleName.to_string mod_name in mk ~parent kind page - | `Parameter (functor_id, arg_name) as p -> + | { iv = `Parameter (functor_id, arg_name); _ } as p -> let parent = from_identifier (functor_id :> source) in let kind = `Argument in let arg_num = functor_arg_pos p in @@ -144,24 +161,25 @@ module Path = struct Printf.sprintf "%d-%s" arg_num (ParameterName.to_string arg_name) in mk ~parent kind page - | `ModuleType (parent, modt_name) -> + | { iv = `ModuleType (parent, modt_name); _ } -> let parent = from_identifier (parent :> source) in let kind = `ModuleType in let page = ModuleTypeName.to_string modt_name in mk ~parent kind page - | `Class (parent, name) -> + | { iv = `Class (parent, name); _ } -> let parent = from_identifier (parent :> source) in let kind = `Class in let page = ClassName.to_string name in mk ~parent kind page - | `ClassType (parent, name) -> + | { iv = `ClassType (parent, name); _ } -> let parent = from_identifier (parent :> source) in let kind = `ClassType in let page = ClassTypeName.to_string name in mk ~parent kind page - | `Result p -> from_identifier (p :> source) + | { iv = `Result p; _ } -> from_identifier (p :> source) - let from_identifier p = from_identifier (p : [< source ] :> source) + let from_identifier p = + from_identifier (p : [< source_pv ] Odoc_model.Paths.id :> source) let to_list url = let rec loop acc { parent; name; kind } = @@ -239,7 +257,7 @@ module Anchor = struct let rec from_identifier : Identifier.t -> (t, Error.t) result = let open Error in function - | `Module (parent, mod_name) -> + | { iv = `Module (parent, mod_name); _ } -> let parent = Path.from_identifier (parent :> Path.source) in let kind = `Module in let anchor = @@ -247,20 +265,22 @@ module Anchor = struct (ModuleName.to_string mod_name) in Ok { page = parent; anchor; kind } - | `Root _ as p -> + | { iv = `Root _; _ } as p -> let page = Path.from_identifier (p :> Path.source) in Ok { page; kind = `Module; anchor = "" } - | `Page _ as p -> + | { iv = `Page _; _ } as p -> let page = Path.from_identifier (p :> Path.source) in Ok { page; kind = `Page; anchor = "" } - | `LeafPage _ as p -> + | { iv = `LeafPage _; _ } as p -> let page = Path.from_identifier (p :> Path.source) in Ok { page; kind = `LeafPage; anchor = "" } (* For all these identifiers, page names and anchors are the same *) - | (`Parameter _ | `Result _ | `ModuleType _ | `Class _ | `ClassType _) as p - -> + | { + iv = `Parameter _ | `Result _ | `ModuleType _ | `Class _ | `ClassType _; + _; + } as p -> Ok (anchorify_path @@ Path.from_identifier p) - | `Type (parent, type_name) -> + | { iv = `Type (parent, type_name); _ } -> let page = Path.from_identifier (parent :> Path.source) in let kind = `Type in Ok @@ -271,9 +291,9 @@ module Anchor = struct (TypeName.to_string type_name); kind; } - | `CoreType ty_name -> + | { iv = `CoreType ty_name; _ } -> Error (Not_linkable ("core_type:" ^ TypeName.to_string ty_name)) - | `Extension (parent, name) -> + | { iv = `Extension (parent, name); _ } -> let page = Path.from_identifier (parent :> Path.source) in let kind = `Extension in Ok @@ -284,7 +304,7 @@ module Anchor = struct (ExtensionName.to_string name); kind; } - | `Exception (parent, name) -> + | { iv = `Exception (parent, name); _ } -> let page = Path.from_identifier (parent :> Path.source) in let kind = `Exception in Ok @@ -295,9 +315,9 @@ module Anchor = struct (ExceptionName.to_string name); kind; } - | `CoreException name -> + | { iv = `CoreException name; _ } -> Error (Not_linkable ("core_exception:" ^ ExceptionName.to_string name)) - | `Value (parent, name) -> + | { iv = `Value (parent, name); _ } -> let page = Path.from_identifier (parent :> Path.source) in let kind = `Val in Ok @@ -307,37 +327,39 @@ module Anchor = struct Format.asprintf "%a-%s" pp_kind kind (ValueName.to_string name); kind; } - | `Method (parent, name) -> + | { iv = `Method (parent, name); _ } -> let str_name = MethodName.to_string name in let page = Path.from_identifier (parent :> Path.source) in let kind = `Method in Ok { page; anchor = Format.asprintf "%a-%s" pp_kind kind str_name; kind } - | `InstanceVariable (parent, name) -> + | { iv = `InstanceVariable (parent, name); _ } -> let str_name = InstanceVariableName.to_string name in let page = Path.from_identifier (parent :> Path.source) in let kind = `Val in Ok { page; anchor = Format.asprintf "%a-%s" pp_kind kind str_name; kind } - | `Constructor (parent, name) -> + | { iv = `Constructor (parent, name); _ } -> from_identifier (parent :> Identifier.t) >>= fun page -> let kind = `Constructor in let suffix = ConstructorName.to_string name in Ok (add_suffix ~kind page suffix) - | `Field (parent, name) -> + | { iv = `Field (parent, name); _ } -> from_identifier (parent :> Identifier.t) >>= fun page -> let kind = `Field in let suffix = FieldName.to_string name in Ok (add_suffix ~kind page suffix) - | `Label (parent, anchor) -> ( + | { iv = `Label (parent, anchor); _ } -> ( let str_name = LabelName.to_string anchor in (* [Identifier.LabelParent.t] contains datatypes. [`CoreType] can't happen, [`Type] may not happen either but just in case, use the grand-parent. *) match parent with - | #Path.source as parent -> mk ~kind:`Section parent str_name - | `CoreType _ -> Error (Unexpected_anchor "core_type label parent") - | `Type (gp, _) -> mk ~kind:`Section gp str_name) + | { iv = #Path.source_pv; _ } as parent -> + mk ~kind:`Section parent str_name + | { iv = `CoreType _; _ } -> + Error (Unexpected_anchor "core_type label parent") + | { iv = `Type (gp, _); _ } -> mk ~kind:`Section gp str_name) let polymorphic_variant ~type_ident elt = let name_of_type_constr te = @@ -379,7 +401,7 @@ let from_path page = { Anchor.page; anchor = ""; kind = (page.kind :> Anchor.kind) } let from_identifier ~stop_before = function - | #Path.source as p when not stop_before -> + | { Odoc_model.Paths.iv = #Path.source_pv; _ } as p when not stop_before -> Ok (from_path @@ Path.from_identifier p) | p -> Anchor.from_identifier p diff --git a/src/document/url.mli b/src/document/url.mli index 338519f7f2..bb0995c70b 100644 --- a/src/document/url.mli +++ b/src/document/url.mli @@ -28,10 +28,14 @@ module Path : sig type t = { kind : kind; parent : t option; name : string } - type source = - [ Identifier.Page.t | Identifier.Signature.t | Identifier.ClassSignature.t ] + type source_pv = + [ Identifier.Page.t_pv + | Identifier.Signature.t_pv + | Identifier.ClassSignature.t_pv ] - val from_identifier : [< source ] -> t + and source = source_pv Odoc_model.Paths.id + + val from_identifier : [< source_pv ] Odoc_model.Paths.id -> t val to_list : t -> (kind * string) list diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index d8c104e8b2..8140a8e792 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -602,7 +602,7 @@ let read_value_description env parent id vd = let read_label_declaration env parent ld = let open TypeDecl.Field in let name = Ident.name ld.ld_id in - let id = `Field(parent, Odoc_model.Names.FieldName.make_std name) in + let id = Identifier.Mk.field (parent, Odoc_model.Names.FieldName.make_std name) in let doc = Doc_attr.attached_no_tag (parent :> Identifier.LabelParent.t) ld.ld_attributes @@ -628,7 +628,7 @@ let read_constructor_declaration_arguments env parent arg = let read_constructor_declaration env parent cd = let open TypeDecl.Constructor in let name = Ident.name cd.cd_id in - let id = `Constructor(parent, Odoc_model.Names.ConstructorName.make_std name) in + let id = Identifier.Mk.constructor (parent, Odoc_model.Names.ConstructorName.make_std name) in let container = (parent : Identifier.DataType.t :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag container cd.cd_attributes in let args = @@ -729,7 +729,7 @@ let read_type_declaration env parent id decl = let read_extension_constructor env parent id ext = let open Extension.Constructor in let name = Ident.name id in - let id = `Extension(parent, Odoc_model.Names.ExtensionName.make_std name) in + let id = Identifier.Mk.extension(parent, Odoc_model.Names.ExtensionName.make_std name) in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag container ext.ext_attributes in let args = @@ -762,7 +762,7 @@ let read_type_extension env parent id ext rest = let read_exception env parent id ext = let open Exception in let name = Ident.name id in - let id = `Exception(parent, Odoc_model.Names.ExceptionName.make_std name) in + let id = Identifier.Mk.exception_(parent, Odoc_model.Names.ExceptionName.make_std name) in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag container ext.ext_attributes in mark_exception ext; @@ -775,7 +775,7 @@ let read_exception env parent id ext = let read_method env parent concrete (name, kind, typ) = let open Method in - let id = `Method(parent, Odoc_model.Names.MethodName.make_std name) in + let id = Identifier.Mk.method_(parent, Odoc_model.Names.MethodName.make_std name) in let doc = Doc_attr.empty in let private_ = (Compat.field_kind_repr kind) <> Compat.field_public in let virtual_ = not (Compat.concr_mem name concrete) in @@ -784,7 +784,7 @@ let read_method env parent concrete (name, kind, typ) = let read_instance_variable env parent (name, mutable_, virtual_, typ) = let open InstanceVariable in - let id = `InstanceVariable(parent, Odoc_model.Names.InstanceVariableName.make_std name) in + let id = Identifier.Mk.instance_variable(parent, Odoc_model.Names.InstanceVariableName.make_std name) in let doc = Doc_attr.empty in let mutable_ = (mutable_ = Mutable) in let virtual_ = (virtual_ = Virtual) in @@ -924,11 +924,11 @@ let rec read_module_type env parent (mty : Odoc_model.Compat.module_type) = | Some id -> Ident.name id, Env.add_parameter parent id (ParameterName.of_ident id) env | None -> "_", env in - let id = `Parameter(parent, Odoc_model.Names.ParameterName.make_std name) in + let id = Identifier.Mk.parameter(parent, Odoc_model.Names.ParameterName.make_std name) in let arg = read_module_type env id arg in Odoc_model.Lang.FunctorParameter.Named ({ FunctorParameter. id; expr = arg }), env in - let res = read_module_type env (`Result parent) res in + let res = read_module_type env (Identifier.Mk.result parent) res in Functor( f_parameter, res) | Mty_alias _ -> assert false @@ -1066,6 +1066,6 @@ and read_signature env parent (items : Odoc_model.Compat.signature) = let read_interface root name intf = - let id = `Root (root, Odoc_model.Names.ModuleName.make_std name) in + let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in let items = read_signature Env.empty id intf in (id, items) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 7704635fae..50e99ed6c6 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -133,14 +133,14 @@ let rec read_class_type_field env parent ctf = match ctf.ctf_desc with | Tctf_val(name, mutable_, virtual_, typ) -> let open InstanceVariable in - let id = `InstanceVariable(parent, InstanceVariableName.make_std name) in + let id = Identifier.Mk.instance_variable(parent, InstanceVariableName.make_std name) in let mutable_ = (mutable_ = Mutable) in let virtual_ = (virtual_ = Virtual) in let type_ = read_core_type env typ in Some (InstanceVariable {id; doc; mutable_; virtual_; type_}) | Tctf_method(name, private_, virtual_, typ) -> let open Method in - let id = `Method(parent, MethodName.make_std name) in + let id = Identifier.Mk.method_(parent, MethodName.make_std name) in let private_ = (private_ = Private) in let virtual_ = (virtual_ = Virtual) in let type_ = read_core_type env typ in @@ -220,7 +220,7 @@ let rec read_class_field env parent cf = match cf.cf_desc with | Tcf_val({txt = name; _}, mutable_, _, kind, _) -> let open InstanceVariable in - let id = `InstanceVariable(parent, InstanceVariableName.make_std name) in + let id = Identifier.Mk.instance_variable(parent, InstanceVariableName.make_std name) in let mutable_ = (mutable_ = Mutable) in let virtual_, type_ = match kind with @@ -232,7 +232,7 @@ let rec read_class_field env parent cf = Some (InstanceVariable {id; doc; mutable_; virtual_; type_}) | Tcf_method({txt = name; _}, private_, kind) -> let open Method in - let id = `Method(parent, MethodName.make_std name) in + let id = Identifier.Mk.method_(parent, MethodName.make_std name) in let private_ = (private_ = Private) in let virtual_, type_ = match kind with @@ -369,12 +369,12 @@ let rec read_module_expr env parent label_parent mexpr = | Some id -> Ident.name id, Env.add_parameter parent id (ParameterName.of_ident id) env | None -> "_", env in - let id = `Parameter(parent, Odoc_model.Names.ParameterName.make_std name) in + let id = Identifier.Mk.parameter (parent, Odoc_model.Names.ParameterName.make_std name) in let arg = Cmti.read_module_type env id label_parent arg in Named { id; expr=arg }, env in - let res = read_module_expr env (`Result parent) label_parent res in + let res = read_module_expr env (Identifier.Mk.result parent) label_parent res in Functor (f_parameter, res) #else | Tmod_functor(id, _, arg, res) -> @@ -383,12 +383,12 @@ let rec read_module_expr env parent label_parent mexpr = | None -> FunctorParameter.Unit | Some arg -> let name = Ident.name id in - let id = `Parameter(parent, ParameterName.make_std name) in + let id = Identifier.Mk.parameter (parent, ParameterName.make_std name) in let arg = Cmti.read_module_type env id label_parent arg in Named { FunctorParameter. id; expr = arg; } in let env = Env.add_parameter parent id (ParameterName.of_ident id) env in - let res = read_module_expr env (`Result parent) label_parent res in + let res = read_module_expr env (Identifier.Mk.result parent) label_parent res in Functor(f_parameter, res) #endif | Tmod_apply _ -> @@ -593,7 +593,7 @@ and read_structure : ({ Signature.items = Comment (`Docs doc_post) :: items; compiled=false; doc }, tags) let read_implementation root name impl = - let id = `Root (root, Odoc_model.Names.ModuleName.make_std name) in + let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in let sg, canonical = read_structure Odoc_model.Semantics.Expect_canonical Env.empty id impl in diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index a13a7a786b..6422ddb6a6 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -192,7 +192,7 @@ let read_label_declaration env parent label_parent ld = let open TypeDecl.Field in let open Odoc_model.Names in let name = Ident.name ld.ld_id in - let id = `Field(parent, FieldName.make_std name) in + let id = Identifier.Mk.field(parent, FieldName.make_std name) in let doc = Doc_attr.attached_no_tag label_parent ld.ld_attributes in let mutable_ = (ld.ld_mutable = Mutable) in let type_ = read_core_type env label_parent ld.ld_type in @@ -214,7 +214,7 @@ let read_constructor_declaration env parent cd = let open TypeDecl.Constructor in let open Odoc_model.Names in let name = Ident.name cd.cd_id in - let id = `Constructor(parent, ConstructorName.make_std name) in + let id = Identifier.Mk.constructor(parent, ConstructorName.make_std name) in let container = (parent : Identifier.DataType.t :> Identifier.Parent.t) in let label_container = (container :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag label_container cd.cd_attributes in @@ -292,7 +292,7 @@ let read_extension_constructor env parent ext = let open Extension.Constructor in let open Odoc_model.Names in let name = Ident.name ext.ext_id in - let id = `Extension(parent, ExtensionName.make_std name) in + let id = Identifier.Mk.extension(parent, ExtensionName.make_std name) in let container = (parent : Identifier.Signature.t :> Identifier.Parent.t) in let label_container = (container :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag label_container ext.ext_attributes in @@ -326,7 +326,7 @@ let read_exception env parent (ext : extension_constructor) = let open Exception in let open Odoc_model.Names in let name = Ident.name ext.ext_id in - let id = `Exception(parent, ExceptionName.make_std name) in + let id = Identifier.Mk.exception_(parent, ExceptionName.make_std name) in let container = (parent : Identifier.Signature.t :> Identifier.Parent.t) in let label_container = (container :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag label_container ext.ext_attributes in @@ -353,14 +353,14 @@ let rec read_class_type_field env parent ctf = match ctf.ctf_desc with | Tctf_val(name, mutable_, virtual_, typ) -> let open InstanceVariable in - let id = `InstanceVariable(parent, InstanceVariableName.make_std name) in + let id = Identifier.Mk.instance_variable(parent, InstanceVariableName.make_std name) in let mutable_ = (mutable_ = Mutable) in let virtual_ = (virtual_ = Virtual) in let type_ = read_core_type env container typ in Some (InstanceVariable {id; doc; mutable_; virtual_; type_}) | Tctf_method(name, private_, virtual_, typ) -> let open Method in - let id = `Method(parent, MethodName.make_std name) in + let id = Identifier.Mk.method_(parent, MethodName.make_std name) in let private_ = (private_ = Private) in let virtual_ = (virtual_ = Virtual) in let type_ = read_core_type env container typ in @@ -523,11 +523,11 @@ and read_module_type env parent label_parent mty = Ident.name id, Env.add_parameter parent id (ParameterName.of_ident id) env | None -> "_", env in - let id = `Parameter(parent, ParameterName.make_std name) in + let id = Identifier.Mk.parameter (parent, ParameterName.make_std name) in let arg = read_module_type env id label_parent arg in Named { id; expr = arg; }, env in - let res = read_module_type env (`Result parent) label_parent res in + let res = read_module_type env (Identifier.Mk.result parent) label_parent res in Functor (f_parameter, res) #else | Tmty_functor(id, _, arg, res) -> @@ -536,12 +536,12 @@ and read_module_type env parent label_parent mty = | None -> Odoc_model.Lang.FunctorParameter.Unit | Some arg -> let name = Ident.name id in - let id = `Parameter(parent, Odoc_model.Names.ParameterName.make_std name) in + let id = Identifier.Mk.parameter (parent, Odoc_model.Names.ParameterName.make_std name) in let arg = read_module_type env id label_parent arg in Named { FunctorParameter. id; expr = arg } in let env = Env.add_parameter parent id (ParameterName.of_ident id) env in - let res = read_module_type env (`Result parent) label_parent res in + let res = read_module_type env (Identifier.Mk.result parent) label_parent res in Functor( f_parameter, res) #endif | Tmty_with(body, subs) -> ( @@ -795,7 +795,7 @@ and read_signature : ({ Signature.items = Comment (`Docs doc_post) :: items; compiled=false; doc }, tags) let read_interface root name intf = - let id = `Root (root, Odoc_model.Names.ModuleName.make_std name) in + let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in let sg, canonical = read_signature Odoc_model.Semantics.Expect_canonical Env.empty id intf in diff --git a/src/loader/ident_env.cppo.ml b/src/loader/ident_env.cppo.ml index 369e46b7d1..c8335393bc 100644 --- a/src/loader/ident_env.cppo.ml +++ b/src/loader/ident_env.cppo.ml @@ -382,6 +382,7 @@ let class_type_name_exists name items = List.exists (function | `ClassType (id',_,_,_) when Ident.name id' = name -> true | _ -> false) items let env_of_items parent items env = + let open Odoc_model.Paths.Identifier in let rec inner items env = match items with | `Type (t, is_hidden_item) :: rest -> @@ -389,8 +390,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || type_name_exists name rest in let identifier, hidden = if is_hidden - then `Type(parent, TypeName.internal_of_string name), t :: env.hidden - else `Type(parent, TypeName.make_std name), env.hidden + then Mk.type_(parent, TypeName.internal_of_string name), t :: env.hidden + else Mk.type_(parent, TypeName.make_std name), env.hidden in let types = Ident.add t identifier env.types in inner rest { env with types; hidden } @@ -400,8 +401,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || value_name_exists name rest in let identifier, hidden = if is_hidden - then `Value(parent, ValueName.internal_of_string name), t :: env.hidden - else `Value(parent, ValueName.make_std name), env.hidden + then Mk.value(parent, ValueName.internal_of_string name), t :: env.hidden + else Mk.value(parent, ValueName.make_std name), env.hidden in let values = Ident.add t identifier env.values in inner rest { env with values; hidden } @@ -411,8 +412,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || module_type_name_exists name rest in let identifier, hidden = if is_hidden - then `ModuleType(parent, ModuleTypeName.internal_of_string name), t :: env.hidden - else `ModuleType(parent, ModuleTypeName.make_std name), env.hidden + then Mk.module_type(parent, ModuleTypeName.internal_of_string name), t :: env.hidden + else Mk.module_type(parent, ModuleTypeName.make_std name), env.hidden in let module_types = Ident.add t identifier env.module_types in inner rest { env with module_types; hidden } @@ -423,8 +424,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || module_name_exists name rest || double_underscore in let identifier, hidden = if is_hidden - then `Module(parent, ModuleName.internal_of_string name), t :: env.hidden - else `Module(parent, ModuleName.make_std name), env.hidden + then Mk.module_(parent, ModuleName.internal_of_string name), t :: env.hidden + else Mk.module_(parent, ModuleName.make_std name), env.hidden in let path = `Identifier(identifier, is_hidden) in let modules = Ident.add t identifier env.modules in @@ -436,8 +437,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || class_name_exists name rest in let identifier, hidden = if is_hidden - then `Class(parent, ClassName.internal_of_string name), t :: t2 :: t3 :: t4 :: env.hidden - else `Class(parent, ClassName.make_std name), env.hidden + then Mk.class_(parent, ClassName.internal_of_string name), t :: t2 :: t3 :: t4 :: env.hidden + else Mk.class_(parent, ClassName.make_std name), env.hidden in let classes = List.fold_right (fun id classes -> Ident.add id identifier classes) @@ -449,8 +450,8 @@ let env_of_items parent items env = let is_hidden = is_hidden_item || class_type_name_exists name rest in let identifier, hidden = if is_hidden - then `ClassType(parent, ClassTypeName.internal_of_string name), t :: t2 :: t3 :: env.hidden - else `ClassType(parent, ClassTypeName.make_std name), env.hidden + then Mk.class_type(parent, ClassTypeName.internal_of_string name), t :: t2 :: t3 :: env.hidden + else Mk.class_type(parent, ClassTypeName.make_std name), env.hidden in let class_types = List.fold_right (fun id class_types -> Ident.add id identifier class_types) @@ -477,8 +478,9 @@ let handle_signature_type_items : Paths.Identifier.Signature.t -> Compat.signatu env_of_items parent items env let add_parameter parent id name env = + let hidden = ParameterName.is_hidden name in - let path = `Identifier (`Parameter(parent, name), hidden) in + let path = `Identifier (Odoc_model.Paths.Identifier.Mk.parameter(parent, name), hidden) in let module_paths = Ident.add id path env.module_paths in { env with module_paths } diff --git a/src/loader/odoc_loader.ml b/src/loader/odoc_loader.ml index 3fc0957552..38c7d08371 100644 --- a/src/loader/odoc_loader.ml +++ b/src/loader/odoc_loader.ml @@ -115,7 +115,10 @@ let read_cmt ~make_root ~parent ~filename () = let imports = cmt_info.cmt_imports in match cmt_info.cmt_annots with | Packed (_, files) -> - let id = `Root (parent, Odoc_model.Names.ModuleName.make_std name) in + let id = + Odoc_model.Paths.Identifier.Mk.root + (parent, Odoc_model.Names.ModuleName.make_std name) + in let items = List.map (fun file -> @@ -128,7 +131,8 @@ let read_cmt ~make_root ~parent ~filename () = List.map (fun name -> let id = - `Module (id, Odoc_model.Names.ModuleName.make_std name) + Odoc_model.Paths.Identifier.Mk.module_ + (id, Odoc_model.Names.ModuleName.make_std name) in let path = `Root name in { Odoc_model.Lang.Compilation_unit.Packed.id; path }) diff --git a/src/model/dune b/src/model/dune index bfe82fb9ea..a40505e7b3 100644 --- a/src/model/dune +++ b/src/model/dune @@ -10,6 +10,8 @@ (library (name odoc_model) (public_name odoc.model) + (flags + (:standard -w -50)) (instrumentation (backend bisect_ppx)) (libraries result compiler-libs.common odoc-parser)) diff --git a/src/model/paths.ml b/src/model/paths.ml index 6873b50071..2f94622f8b 100644 --- a/src/model/paths.ml +++ b/src/model/paths.ml @@ -16,10 +16,16 @@ open Names +type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } + module Identifier = struct type t = Paths_types.Identifier.any - let rec name_aux : t -> string = function + type t_pv = Paths_types.Identifier.any_pv + + let rec name_aux : t -> string = + fun x -> + match x.iv with | `Root (_, name) -> ModuleName.to_string name | `Page (_, name) -> PageName.to_string name | `LeafPage (_, name) -> PageName.to_string name @@ -41,40 +47,40 @@ module Identifier = struct | `InstanceVariable (_, name) -> InstanceVariableName.to_string name | `Label (_, name) -> LabelName.to_string name - let name : [< t ] -> string = fun n -> name_aux (n :> t) + let name : [< t_pv ] id -> string = fun n -> name_aux (n :> t) let rec label_parent_aux = let open Paths_types.Identifier in fun (n : any) -> match n with - | `Result i -> label_parent_aux (i :> any) - | `CoreType _ | `CoreException _ -> assert false - | `Root _ as p -> (p :> label_parent) - | `Page _ as p -> (p :> label_parent) - | `LeafPage _ as p -> (p :> label_parent) - | `Module (p, _) - | `ModuleType (p, _) - | `Parameter (p, _) - | `Class (p, _) - | `ClassType (p, _) - | `Type (p, _) - | `Extension (p, _) - | `Exception (p, _) - | `Value (p, _) -> + | { iv = `Result i; _ } -> label_parent_aux (i :> any) + | { iv = `CoreType _; _ } | { iv = `CoreException _; _ } -> assert false + | { iv = `Root _; _ } as p -> (p :> label_parent) + | { iv = `Page _; _ } as p -> (p :> label_parent) + | { iv = `LeafPage _; _ } as p -> (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 = `Exception (p, _); _ } + | { iv = `Value (p, _); _ } -> (p : signature :> label_parent) - | `Label (p, _) -> p - | `Method (p, _) | `InstanceVariable (p, _) -> + | { iv = `Label (p, _); _ } -> p + | { iv = `Method (p, _); _ } | { iv = `InstanceVariable (p, _); _ } -> (p : class_signature :> label_parent) - | `Constructor (p, _) -> (p : datatype :> label_parent) - | `Field (p, _) -> (p : parent :> label_parent) + | { iv = `Constructor (p, _); _ } -> (p : datatype :> label_parent) + | { iv = `Field (p, _); _ } -> (p : parent :> label_parent) let label_parent n = label_parent_aux (n :> t) - let equal = ( = ) + let equal x y = x.ihash = y.ihash && x.ikey = y.ikey - let hash = Hashtbl.hash + let hash x = x.ihash - let compare = compare + let compare x y = compare x.ikey y.ikey type any = t @@ -91,343 +97,324 @@ module Identifier = struct module Signature = struct type t = Paths_types.Identifier.signature - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.signature_pv + + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module ClassSignature = struct type t = Paths_types.Identifier.class_signature - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.class_signature_pv - let hash = Hashtbl.hash + let equal = equal - let compare x y = compare (x :> any) (y :> any) + let hash = hash + + let compare = compare end module DataType = struct type t = Paths_types.Identifier.datatype - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.datatype_pv - let hash = Hashtbl.hash + let equal = equal - let compare x y = compare (x :> any) (y :> any) + let hash = hash + + let compare = compare end module Parent = struct type t = Paths_types.Identifier.parent - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.parent_pv - let hash = Hashtbl.hash + let equal = equal + + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module LabelParent = struct type t = Paths_types.Identifier.label_parent - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.label_parent_pv - let hash = Hashtbl.hash + let equal = equal + + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module RootModule = struct type t = Paths_types.Identifier.root_module - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Module = struct type t = Paths_types.Identifier.module_ - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.module_pv - let hash = Hashtbl.hash + let equal = equal + + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module FunctorParameter = struct type t = Paths_types.Identifier.functor_parameter - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.functor_parameter_pv + + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module FunctorResult = struct type t = Paths_types.Identifier.functor_result - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash x = hash (x :> any) + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module ModuleType = struct type t = Paths_types.Identifier.module_type - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.module_type_pv - let hash = Hashtbl.hash + let equal = equal + + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Type = struct type t = Paths_types.Identifier.type_ - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.type_pv - let hash = Hashtbl.hash + let equal = equal + + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Constructor = struct type t = Paths_types.Identifier.constructor - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Field = struct type t = Paths_types.Identifier.field - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Extension = struct type t = Paths_types.Identifier.extension - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Exception = struct type t = Paths_types.Identifier.exception_ - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Value = struct type t = Paths_types.Identifier.value - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Class = struct type t = Paths_types.Identifier.class_ - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module ClassType = struct type t = Paths_types.Identifier.class_type - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Method = struct type t = Paths_types.Identifier.method_ - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module InstanceVariable = struct type t = Paths_types.Identifier.instance_variable - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Label = struct type t = Paths_types.Identifier.label - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.label_pv - let hash = Hashtbl.hash + let equal = equal - let compare x y = compare (x :> any) (y :> any) + let hash = hash + + let compare = compare end module Page = struct type t = Paths_types.Identifier.page - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.page_pv - let hash = Hashtbl.hash + let equal = equal - let compare x y = compare (x :> any) (y :> any) + let hash = hash + + let compare = compare end module ContainerPage = struct type t = Paths_types.Identifier.container_page - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module OdocId = struct type t = Paths_types.Identifier.odoc_id - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Path = struct module Module = struct type t = Paths_types.Identifier.path_module - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.path_module_pv + + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module ModuleType = struct type t = Paths_types.Identifier.path_module_type - let equal x y = equal (x :> any) (y :> any) + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end module Type = struct type t = Paths_types.Identifier.path_type - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.path_type_pv - let hash = Hashtbl.hash + let equal = equal - let compare x y = compare (x :> any) (y :> any) + let hash = hash + + let compare = compare end module ClassType = struct type t = Paths_types.Identifier.path_class_type - let equal x y = equal (x :> any) (y :> any) + type t_pv = Paths_types.Identifier.path_class_type_pv + + let equal = equal - let hash = Hashtbl.hash + let hash = hash - let compare x y = compare (x :> any) (y :> any) + let compare = compare end type t = Paths_types.Identifier.path_any end - module Sets = struct - module Signature = Set.Make (Signature) - module ClassSignature = Set.Make (ClassSignature) - module DataType = Set.Make (DataType) - module Parent = Set.Make (Parent) - module LabelParent = Set.Make (LabelParent) - module RootModule = Set.Make (RootModule) - module FunctorParameter = Set.Make (FunctorParameter) - module Module = Set.Make (Module) - module ModuleType = Set.Make (ModuleType) - module Type = Set.Make (Type) - module Constructor = Set.Make (Constructor) - module Field = Set.Make (Field) - module Extension = Set.Make (Extension) - module Exception = Set.Make (Exception) - module Value = Set.Make (Value) - module Class = Set.Make (Class) - module ClassType = Set.Make (ClassType) - module Method = Set.Make (Method) - module InstanceVariable = Set.Make (InstanceVariable) - module Label = Set.Make (Label) - module Page = Set.Make (Page) - module ContainerPage = Set.Make (ContainerPage) - - module Path = struct - module Module = Set.Make (Path.Module) - module ModuleType = Set.Make (Path.ModuleType) - module Type = Set.Make (Path.Type) - module ClassType = Set.Make (Path.ClassType) - end - end - module Maps = struct module Any = Map.Make (Any) - module Signature = Map.Make (Signature) - module ClassSignature = Map.Make (ClassSignature) - module DataType = Map.Make (DataType) - module Parent = Map.Make (Parent) - module LabelParent = Map.Make (LabelParent) - module RootModule = Map.Make (RootModule) module FunctorParameter = Map.Make (FunctorParameter) module Module = Map.Make (Module) module ModuleType = Map.Make (ModuleType) module Type = Map.Make (Type) - module Constructor = Map.Make (Constructor) - module Field = Map.Make (Field) - module Extension = Map.Make (Extension) - module Exception = Map.Make (Exception) - module Value = Map.Make (Value) module Class = Map.Make (Class) module ClassType = Map.Make (ClassType) - module Method = Map.Make (Method) - module InstanceVariable = Map.Make (InstanceVariable) module Label = Map.Make (Label) - module Page = Map.Make (Page) - module ContainerPage = Map.Make (ContainerPage) module Path = struct module Module = Map.Make (Path.Module) @@ -436,23 +423,149 @@ module Identifier = struct module ClassType = Map.Make (Path.ClassType) end end + + module Mk = struct + let mk_fresh to_str ty f x = + let ikey = Printf.sprintf "%s_%s" ty (to_str x) in + let ihash = Hashtbl.hash ikey in + { iv = f x; ihash; ikey } + + let mk_parent to_str ty f (parent, x) = + let ikey = Printf.sprintf "%s_%s.%s" ty (to_str x) parent.ikey in + let ihash = Hashtbl.hash ikey in + + { iv = f (parent, x); ihash; ikey } + + let mk_parent_opt to_str ty f (parent_opt, x) = + let ikey = + match parent_opt with + | None -> Printf.sprintf "%s_%s" ty (to_str x) + | Some p -> Printf.sprintf "%s_%s.%s" ty (to_str x) p.ikey + in + let ihash = Hashtbl.hash ikey in + { iv = f (parent_opt, x); ihash; ikey } + + let page : + ContainerPage.t option * PageName.t -> + [> `Page of ContainerPage.t option * PageName.t ] id = + mk_parent_opt PageName.to_string "p" (fun (p, n) -> `Page (p, n)) + + let leaf_page : + ContainerPage.t option * PageName.t -> + [> `LeafPage of ContainerPage.t option * PageName.t ] id = + mk_parent_opt PageName.to_string "lp" (fun (p, n) -> `LeafPage (p, n)) + + let root : + ContainerPage.t option * ModuleName.t -> + [> `Root of ContainerPage.t option * ModuleName.t ] id = + mk_parent_opt ModuleName.to_string "r" (fun (p, n) -> `Root (p, n)) + + let module_ : + Signature.t * ModuleName.t -> + [> `Module of Signature.t * ModuleName.t ] id = + mk_parent ModuleName.to_string "m" (fun (p, n) -> `Module (p, n)) + + let parameter : + Signature.t * ParameterName.t -> + [> `Parameter of Signature.t * ParameterName.t ] id = + mk_parent ParameterName.to_string "p" (fun (p, n) -> `Parameter (p, n)) + + let result : Signature.t -> [> `Result of Signature.t ] id = + fun s -> + mk_parent (fun () -> "__result__") "" (fun (s, ()) -> `Result s) (s, ()) + + let module_type : + Signature.t * ModuleTypeName.t -> + [> `ModuleType of Signature.t * ModuleTypeName.t ] id = + mk_parent ModuleTypeName.to_string "mt" (fun (p, n) -> `ModuleType (p, n)) + + let class_ : + Signature.t * ClassName.t -> [> `Class of Signature.t * ClassName.t ] id + = + mk_parent ClassName.to_string "c" (fun (p, n) -> `Class (p, n)) + + let class_type : + Signature.t * ClassTypeName.t -> + [> `ClassType of Signature.t * ClassTypeName.t ] id = + mk_parent ClassTypeName.to_string "ct" (fun (p, n) -> `ClassType (p, n)) + + let type_ : + Signature.t * TypeName.t -> [> `Type of Signature.t * TypeName.t ] id = + mk_parent TypeName.to_string "t" (fun (p, n) -> `Type (p, n)) + + let core_type = + mk_fresh (fun s -> s) "coret" (fun s -> `CoreType (TypeName.make_std s)) + + let constructor : + Type.t * ConstructorName.t -> + [> `Constructor of Type.t * ConstructorName.t ] id = + mk_parent ConstructorName.to_string "ctor" (fun (p, n) -> + `Constructor (p, n)) + + let field : + Parent.t * FieldName.t -> [> `Field of Parent.t * FieldName.t ] id = + mk_parent FieldName.to_string "fld" (fun (p, n) -> `Field (p, n)) + + let extension : + Signature.t * ExtensionName.t -> + [> `Extension of Signature.t * ExtensionName.t ] id = + mk_parent ExtensionName.to_string "extn" (fun (p, n) -> `Extension (p, n)) + + let exception_ : + Signature.t * ExceptionName.t -> + [> `Exception of Signature.t * ExceptionName.t ] id = + mk_parent ExceptionName.to_string "exn" (fun (p, n) -> `Exception (p, n)) + + let core_exception = + mk_fresh + (fun s -> s) + "coreexn" + (fun s -> `CoreException (ExceptionName.make_std s)) + + let value : + Signature.t * ValueName.t -> [> `Value of Signature.t * ValueName.t ] id + = + mk_parent ValueName.to_string "v" (fun (p, n) -> `Value (p, n)) + + let method_ : + ClassSignature.t * MethodName.t -> + [> `Method of ClassSignature.t * MethodName.t ] id = + mk_parent MethodName.to_string "m" (fun (p, n) -> `Method (p, n)) + + let instance_variable : + ClassSignature.t * InstanceVariableName.t -> + [> `InstanceVariable of ClassSignature.t * InstanceVariableName.t ] id = + mk_parent InstanceVariableName.to_string "iv" (fun (p, n) -> + `InstanceVariable (p, n)) + + let label : + LabelParent.t * LabelName.t -> + [> `Label of LabelParent.t * LabelName.t ] id = + mk_parent LabelName.to_string "l" (fun (p, n) -> `Label (p, n)) + end end module Path = struct type t = Paths_types.Path.any - let rec is_resolved_hidden : Paths_types.Resolved_path.any -> bool = - fun x -> + let rec is_resolved_hidden : + weak_canonical_test:bool -> Paths_types.Resolved_path.any -> bool = + fun ~weak_canonical_test x -> let open Paths_types.Resolved_path in - let rec inner = function - | `Identifier (`ModuleType (_, m)) when Names.ModuleTypeName.is_internal m + let rec inner : Paths_types.Resolved_path.any -> bool = function + | `Identifier { iv = `ModuleType (_, m); _ } + when Names.ModuleTypeName.is_internal m -> + true + | `Identifier { iv = `Type (_, t); _ } when Names.TypeName.is_internal t -> true - | `Identifier (`Type (_, t)) when Names.TypeName.is_internal t -> true - | `Identifier (`Module (_, m)) when Names.ModuleName.is_internal m -> true + | `Identifier { iv = `Module (_, m); _ } + when Names.ModuleName.is_internal m -> + true | `Identifier _ -> false | `Canonical (_, `Resolved _) -> false - | `Canonical (x, _) -> inner (x : module_ :> any) + | `Canonical (x, _) -> + (not weak_canonical_test) && inner (x : module_ :> any) | `Hidden _ -> true | `Subst (p1, p2) -> inner (p1 : module_type :> any) || inner (p2 : module_ :> any) @@ -464,8 +577,11 @@ module Path = struct | `Type (p, _) -> inner (p : module_ :> any) | `Class (p, _) -> inner (p : module_ :> any) | `ClassType (p, _) -> inner (p : module_ :> any) - | `Alias (p1, p2) -> - inner (p1 : module_ :> any) && inner (p2 : module_ :> any) + | `Alias (dest, `Resolved src) -> + 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) @@ -478,12 +594,21 @@ module Path = struct in inner x + and contains_double_underscore s = + let len = String.length s in + let rec aux i = + if i > len - 2 then false + else if s.[i] = '_' && s.[i + 1] = '_' then true + else aux (i + 1) + in + aux 0 + and is_path_hidden : Paths_types.Path.any -> bool = let open Paths_types.Path in function - | `Resolved r -> is_resolved_hidden r + | `Resolved r -> is_resolved_hidden ~weak_canonical_test:false r | `Identifier (_, hidden) -> hidden - | `Root _ -> false + | `Root s -> contains_double_underscore s | `Forward _ -> false | `Dot (p, _) -> is_path_hidden (p : module_ :> any) | `Apply (p1, p2) -> @@ -498,13 +623,14 @@ module Path = struct function | `Identifier id -> (id : Identifier.ModuleType.t :> Identifier.Signature.t) - | `ModuleType (m, n) -> `ModuleType (parent_module_identifier m, n) + | `ModuleType (m, n) -> + Identifier.Mk.module_type (parent_module_identifier m, n) | `SubstT (m, _n) -> parent_module_type_identifier m | `CanonicalModuleType (_, `Resolved p) -> parent_module_type_identifier p | `CanonicalModuleType (p, _) -> parent_module_type_identifier p | `OpaqueModuleType mt -> parent_module_type_identifier mt | `AliasModuleType (sub, orig) -> - if is_path_hidden (`Resolved (sub :> t)) then + if is_resolved_hidden ~weak_canonical_test:false (sub :> t) then parent_module_type_identifier orig else parent_module_type_identifier sub @@ -514,84 +640,29 @@ module Path = struct (id : Identifier.Path.Module.t :> Identifier.Signature.t) | `Subst (sub, _) -> parent_module_type_identifier sub | `Hidden p -> parent_module_identifier p - | `Module (m, n) -> `Module (parent_module_identifier m, n) + | `Module (m, n) -> Identifier.Mk.module_ (parent_module_identifier m, n) | `Canonical (_, `Resolved p) -> parent_module_identifier p | `Canonical (p, _) -> parent_module_identifier p | `Apply (m, _) -> parent_module_identifier m - | `Alias (sub, orig) -> - if is_path_hidden (`Resolved (sub :> t)) then - parent_module_identifier orig - else parent_module_identifier sub + | `Alias (dest, `Resolved src) -> + if is_resolved_hidden ~weak_canonical_test:false (dest :> t) then + parent_module_identifier src + else parent_module_identifier dest + | `Alias (dest, _src) -> parent_module_identifier dest | `OpaqueModule m -> parent_module_identifier m module Module = struct type t = Paths_types.Resolved_path.module_ - let of_ident id = `Identifier id - let is_hidden m = is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) - - let rec identifier : t -> Identifier.Path.Module.t = function - | `Identifier id -> id - | `Subst (_, p) -> identifier p - | `Hidden p -> identifier p - | `Module (m, n) -> `Module (parent_module_identifier m, n) - | `Canonical (_, `Resolved p) -> identifier p - | `Canonical (p, _) -> identifier p - | `Apply (m, _) -> identifier m - | `Alias (sub, orig) -> - if is_path_hidden (`Resolved (sub :> Paths_types.Resolved_path.any)) - then identifier orig - else identifier sub - | `OpaqueModule m -> identifier m - - let rec canonical_ident : t -> Identifier.Path.Module.t option = function - | `Identifier _id -> None - | `Subst (_, _) -> None - | `Hidden p -> canonical_ident p - | `Module (p, n) -> ( - match canonical_ident p with - | Some x -> Some (`Module ((x :> Identifier.Signature.t), n)) - | None -> None) - | `Canonical (_, `Resolved p) -> Some (identifier p) - | `Canonical (_, _) -> None - | `Apply (_, _) -> None - | `Alias (_, _) -> None - | `OpaqueModule m -> canonical_ident m end module ModuleType = struct type t = Paths_types.Resolved_path.module_type - let of_ident id = `Identifier id - let is_hidden m = is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) - - let rec identifier : t -> Identifier.ModuleType.t = function - | `Identifier id -> id - | `ModuleType (m, n) -> `ModuleType (parent_module_identifier m, n) - | `SubstT (s, _) -> identifier s - | `CanonicalModuleType (_, `Resolved p) -> identifier p - | `CanonicalModuleType (p, _) -> identifier p - | `OpaqueModuleType mt -> identifier mt - | `AliasModuleType (sub, orig) -> - if is_path_hidden (`Resolved (sub :> Paths_types.Resolved_path.any)) - then identifier orig - else identifier sub - - let rec canonical_ident : t -> Identifier.ModuleType.t option = function - | `Identifier _id -> None - | `ModuleType (p, n) -> ( - match Module.canonical_ident p with - | Some x -> Some (`ModuleType ((x :> Identifier.Signature.t), n)) - | None -> None) - | `SubstT (_, _) -> None - | `AliasModuleType (_, _) -> None - | `CanonicalModuleType (_, `Resolved p) -> Some (identifier p) - | `CanonicalModuleType (_, _) -> None - | `OpaqueModuleType m -> canonical_ident (m :> t) end module Type = struct @@ -600,30 +671,8 @@ module Path = struct let of_ident id = `Identifier id let is_hidden m = - is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) - - let rec identifier : t -> Identifier.Path.Type.t = function - | `Identifier id -> id - | `CanonicalType (_, `Resolved t) -> identifier t - | `CanonicalType (t, _) -> identifier t - | `Type (m, n) -> `Type (parent_module_identifier m, n) - | `Class (m, n) -> `Class (parent_module_identifier m, n) - | `ClassType (m, n) -> `ClassType (parent_module_identifier m, n) - - let canonical_ident : t -> Identifier.Path.Type.t option = - let parent m default fn = - match Module.canonical_ident m with - | Some x -> fn (x :> Identifier.Signature.t) - | None -> default - in - function - | `Identifier _ -> None - | `CanonicalType (_, `Resolved t) -> Some (identifier t) - | `CanonicalType (_, _) -> None - | `Type (m, n) -> parent m None (fun sg -> Some (`Type (sg, n))) - | `Class (m, n) -> parent m None (fun sg -> Some (`Class (sg, n))) - | `ClassType (m, n) -> - parent m None (fun sg -> Some (`ClassType (sg, n))) + is_resolved_hidden ~weak_canonical_test:false + (m : t :> Paths_types.Resolved_path.any) end module ClassType = struct @@ -632,31 +681,32 @@ module Path = struct let of_ident id = `Identifier id let is_hidden m = - is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) - - let identifier = function - | `Identifier id -> id - | `Class (m, n) -> `Class (parent_module_identifier m, n) - | `ClassType (m, n) -> `ClassType (parent_module_identifier m, n) + is_resolved_hidden ~weak_canonical_test:false + (m : t :> Paths_types.Resolved_path.any) end let rec identifier : t -> Identifier.t = function | `Identifier id -> id - | `Subst (_, p) -> identifier (p :> t) + | `Subst (sub, _) -> identifier (sub :> t) | `Hidden p -> identifier (p :> t) - | `Module (m, n) -> `Module (parent_module_identifier m, n) + | `Module (m, n) -> Identifier.Mk.module_ (parent_module_identifier m, n) | `Canonical (_, `Resolved p) -> identifier (p :> t) | `Canonical (p, _) -> identifier (p :> t) | `Apply (m, _) -> identifier (m :> t) - | `Type (m, n) -> `Type (parent_module_identifier m, n) - | `ModuleType (m, n) -> `ModuleType (parent_module_identifier m, n) - | `Class (m, n) -> `Class (parent_module_identifier m, n) - | `ClassType (m, n) -> `ClassType (parent_module_identifier m, n) - | `Alias (sub, orig) -> - if is_path_hidden (`Resolved (sub :> t)) then identifier (orig :> t) - else identifier (sub :> t) + | `Type (m, n) -> Identifier.Mk.type_ (parent_module_identifier m, n) + | `ModuleType (m, n) -> + Identifier.Mk.module_type (parent_module_identifier m, n) + | `Class (m, n) -> Identifier.Mk.class_ (parent_module_identifier m, n) + | `ClassType (m, n) -> + Identifier.Mk.class_type (parent_module_identifier m, n) + | `Alias (dest, `Resolved src) -> + if is_resolved_hidden ~weak_canonical_test:false (dest :> t) then + identifier (src :> t) + else identifier (dest :> t) + | `Alias (dest, _src) -> identifier (dest :> t) | `AliasModuleType (sub, orig) -> - if is_path_hidden (`Resolved (sub :> t)) then identifier (orig :> t) + if is_resolved_hidden ~weak_canonical_test:false (sub :> t) then + identifier (orig :> t) else identifier (sub :> t) | `SubstT (p, _) -> identifier (p :> t) | `CanonicalModuleType (_, `Resolved p) -> identifier (p :> t) @@ -726,15 +776,11 @@ module Fragment = struct (ModuleName.to_string base, Some (`Module (m, name)))) let rec identifier : t -> Identifier.Signature.t = function - | `Root (`ModuleType i) -> - (Path.Resolved.ModuleType.identifier i :> Identifier.Signature.t) - | `Root (`Module i) -> - (Path.Resolved.Module.identifier i :> Identifier.Signature.t) - | `Subst (s, _) -> - (Path.Resolved.ModuleType.identifier s :> Identifier.Signature.t) - | `Alias (i, _) -> - (Path.Resolved.Module.identifier i :> Identifier.Signature.t) - | `Module (m, n) -> `Module (identifier m, n) + | `Root (`ModuleType i) -> Path.Resolved.parent_module_type_identifier i + | `Root (`Module i) -> Path.Resolved.parent_module_identifier i + | `Subst (s, _) -> Path.Resolved.parent_module_type_identifier s + | `Alias (i, _) -> Path.Resolved.parent_module_identifier i + | `Module (m, n) -> Identifier.Mk.module_ (identifier m, n) | `OpaqueModule m -> identifier (sig_of_mod m) end @@ -790,19 +836,29 @@ module Fragment = struct | `Root (`ModuleType _r) -> assert false | `Root (`Module _r) -> assert false | `Subst (s, _) -> Path.Resolved.identifier (s :> Path.Resolved.t) - | `Alias (p, _) -> (Path.Resolved.Module.identifier p :> Identifier.t) - | `Module (m, n) -> `Module (Signature.identifier m, n) - | `Module_type (m, n) -> `ModuleType (Signature.identifier m, n) - | `Type (m, n) -> `Type (Signature.identifier m, n) - | `Class (m, n) -> `Class (Signature.identifier m, n) - | `ClassType (m, n) -> `ClassType (Signature.identifier m, n) + | `Alias (p, _) -> + (Path.Resolved.parent_module_identifier p :> Identifier.t) + | `Module (m, n) -> Identifier.Mk.module_ (Signature.identifier m, n) + | `Module_type (m, n) -> + Identifier.Mk.module_type (Signature.identifier m, n) + | `Type (m, n) -> Identifier.Mk.type_ (Signature.identifier m, n) + | `Class (m, n) -> Identifier.Mk.class_ (Signature.identifier m, n) + | `ClassType (m, n) -> Identifier.Mk.class_type (Signature.identifier m, n) | `OpaqueModule m -> identifier (m :> t) let rec is_hidden : t -> bool = function - | `Root (`ModuleType r) -> Path.is_resolved_hidden (r :> Path.Resolved.t) - | `Root (`Module r) -> Path.is_resolved_hidden (r :> Path.Resolved.t) - | `Subst (s, _) -> Path.is_resolved_hidden (s :> Path.Resolved.t) - | `Alias (s, _) -> Path.is_resolved_hidden (s :> Path.Resolved.t) + | `Root (`ModuleType r) -> + Path.is_resolved_hidden ~weak_canonical_test:false + (r :> Path.Resolved.t) + | `Root (`Module r) -> + Path.is_resolved_hidden ~weak_canonical_test:false + (r :> Path.Resolved.t) + | `Subst (s, _) -> + Path.is_resolved_hidden ~weak_canonical_test:false + (s :> Path.Resolved.t) + | `Alias (s, _) -> + Path.is_resolved_hidden ~weak_canonical_test:false + (s :> Path.Resolved.t) | `Module (m, _) | `Module_type (m, _) | `Type (m, _) @@ -905,26 +961,33 @@ module Reference = struct | `Identifier id -> id | `Hidden s -> parent_signature_identifier (s :> signature) | `Alias (sub, orig) -> - if Path.Resolved.Module.is_hidden sub then + if Path.Resolved.Module.is_hidden ~weak_canonical_test:false sub then parent_signature_identifier (orig :> signature) - else (Path.Resolved.Module.identifier sub :> Identifier.Signature.t) + else + (Path.Resolved.parent_module_identifier sub + :> Identifier.Signature.t) | `AliasModuleType (sub, orig) -> - if Path.Resolved.ModuleType.is_hidden sub then - parent_signature_identifier (orig :> signature) + if Path.Resolved.ModuleType.is_hidden ~weak_canonical_test:false sub + then parent_signature_identifier (orig :> signature) else - (Path.Resolved.ModuleType.identifier sub :> Identifier.Signature.t) - | `Module (m, n) -> `Module (parent_signature_identifier m, n) - | `ModuleType (m, s) -> `ModuleType (parent_signature_identifier m, s) + (Path.Resolved.parent_module_type_identifier sub + :> Identifier.Signature.t) + | `Module (m, n) -> + Identifier.Mk.module_ (parent_signature_identifier m, n) + | `ModuleType (m, s) -> + Identifier.Mk.module_type (parent_signature_identifier m, s) and parent_type_identifier : datatype -> Identifier.DataType.t = function | `Identifier id -> id - | `Type (sg, s) -> `Type (parent_signature_identifier sg, s) + | `Type (sg, s) -> Identifier.Mk.type_ (parent_signature_identifier sg, s) and parent_class_signature_identifier : class_signature -> Identifier.ClassSignature.t = function | `Identifier id -> id - | `Class (sg, s) -> `Class (parent_signature_identifier sg, s) - | `ClassType (sg, s) -> `ClassType (parent_signature_identifier sg, s) + | `Class (sg, s) -> + Identifier.Mk.class_ (parent_signature_identifier sg, s) + | `ClassType (sg, s) -> + Identifier.Mk.class_type (parent_signature_identifier sg, s) and parent_identifier : parent -> Identifier.Parent.t = function | `Identifier id -> id @@ -947,15 +1010,20 @@ module Reference = struct | ( `Alias _ | `AliasModuleType _ | `Module _ | `Hidden _ | `Type _ | `Class _ | `ClassType _ | `ModuleType _ ) as r -> (label_parent_identifier r :> Identifier.t) - | `Field (p, n) -> `Field (parent_identifier p, n) - | `Constructor (s, n) -> `Constructor (parent_type_identifier s, n) - | `Extension (p, q) -> `Extension (parent_signature_identifier p, q) - | `Exception (p, q) -> `Exception (parent_signature_identifier p, q) - | `Value (p, q) -> `Value (parent_signature_identifier p, q) - | `Method (p, q) -> `Method (parent_class_signature_identifier p, q) + | `Field (p, n) -> Identifier.Mk.field (parent_identifier p, n) + | `Constructor (s, n) -> + Identifier.Mk.constructor (parent_type_identifier s, n) + | `Extension (p, q) -> + Identifier.Mk.extension (parent_signature_identifier p, q) + | `Exception (p, q) -> + Identifier.Mk.exception_ (parent_signature_identifier p, q) + | `Value (p, q) -> Identifier.Mk.value (parent_signature_identifier p, q) + | `Method (p, q) -> + Identifier.Mk.method_ (parent_class_signature_identifier p, q) | `InstanceVariable (p, q) -> - `InstanceVariable (parent_class_signature_identifier p, q) - | `Label (p, q) -> `Label (label_parent_identifier p, q) + Identifier.Mk.instance_variable + (parent_class_signature_identifier p, q) + | `Label (p, q) -> Identifier.Mk.label (label_parent_identifier p, q) module Signature = struct type t = Paths_types.Resolved_reference.signature diff --git a/src/model/paths.mli b/src/model/paths.mli index d51f850ea2..71302b6a19 100644 --- a/src/model/paths.mli +++ b/src/model/paths.mli @@ -16,6 +16,8 @@ (** Identifiers for definitions *) +type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } + module Identifier : sig (** {2 Generic operations} *) @@ -32,6 +34,8 @@ module Identifier : sig module Signature : sig type t = Paths_types.Identifier.signature + type t_pv = Paths_types.Identifier.signature_pv + val equal : t -> t -> bool val hash : t -> int @@ -42,6 +46,8 @@ module Identifier : sig module ClassSignature : sig type t = Paths_types.Identifier.class_signature + type t_pv = Paths_types.Identifier.class_signature_pv + val equal : t -> t -> bool val hash : t -> int @@ -52,6 +58,8 @@ module Identifier : sig module DataType : sig type t = Paths_types.Identifier.datatype + type t_pv = Paths_types.Identifier.datatype_pv + val equal : t -> t -> bool val hash : t -> int @@ -62,6 +70,8 @@ module Identifier : sig module Parent : sig type t = Paths_types.Identifier.parent + type t_pv = Paths_types.Identifier.parent_pv + val equal : t -> t -> bool val hash : t -> int @@ -72,6 +82,8 @@ module Identifier : sig module LabelParent : sig type t = Paths_types.Identifier.label_parent + type t_pv = Paths_types.Identifier.label_parent_pv + val equal : t -> t -> bool val hash : t -> int @@ -92,6 +104,8 @@ module Identifier : sig module Module : sig type t = Paths_types.Identifier.module_ + type t_pv = Paths_types.Identifier.module_pv + val equal : t -> t -> bool val hash : t -> int @@ -102,6 +116,8 @@ module Identifier : sig module FunctorParameter : sig type t = Paths_types.Identifier.functor_parameter + type t_pv = Paths_types.Identifier.functor_parameter_pv + val equal : t -> t -> bool val hash : t -> int @@ -122,6 +138,8 @@ module Identifier : sig module ModuleType : sig type t = Paths_types.Identifier.module_type + type t_pv = Paths_types.Identifier.module_type_pv + val equal : t -> t -> bool val hash : t -> int @@ -132,6 +150,8 @@ module Identifier : sig module Type : sig type t = Paths_types.Identifier.type_ + type t_pv = Paths_types.Identifier.type_pv + val equal : t -> t -> bool val hash : t -> int @@ -232,6 +252,8 @@ module Identifier : sig module Label : sig type t = Paths_types.Identifier.label + type t_pv = Paths_types.Identifier.label_pv + val equal : t -> t -> bool val hash : t -> int @@ -242,6 +264,8 @@ module Identifier : sig module Page : sig type t = Paths_types.Identifier.page + type t_pv = Paths_types.Identifier.page_pv + val equal : t -> t -> bool val hash : t -> int @@ -273,6 +297,8 @@ module Identifier : sig module Module : sig type t = Paths_types.Identifier.path_module + type t_pv = Paths_types.Identifier.path_module_pv + val equal : t -> t -> bool val hash : t -> int @@ -293,6 +319,8 @@ module Identifier : sig module Type : sig type t = Paths_types.Identifier.path_type + type t_pv = Paths_types.Identifier.path_type_pv + val equal : t -> t -> bool val hash : t -> int @@ -303,6 +331,8 @@ module Identifier : sig module ClassType : sig type t = Paths_types.Identifier.path_class_type + type t_pv = Paths_types.Identifier.path_class_type_pv + val equal : t -> t -> bool val hash : t -> int @@ -315,112 +345,114 @@ module Identifier : sig type t = Paths_types.Identifier.any + type t_pv = Paths_types.Identifier.any_pv + val hash : t -> int - val name : [< t ] -> string + val name : [< t_pv ] id -> string val compare : t -> t -> int - val equal : ([< t ] as 'a) -> 'a -> bool - - val label_parent : [< t ] -> LabelParent.t + val equal : ([< t_pv ] id as 'a) -> 'a -> bool - module Sets : sig - module Signature : Set.S with type elt = Signature.t + val label_parent : [< t_pv ] id -> LabelParent.t - module ClassSignature : Set.S with type elt = ClassSignature.t - - module DataType : Set.S with type elt = DataType.t - - module Parent : Set.S with type elt = Parent.t - - module LabelParent : Set.S with type elt = LabelParent.t - - module Module : Set.S with type elt = Module.t - - module ModuleType : Set.S with type elt = ModuleType.t - - module Type : Set.S with type elt = Type.t - - module Constructor : Set.S with type elt = Constructor.t - - module Field : Set.S with type elt = Field.t - - module Extension : Set.S with type elt = Extension.t + module Maps : sig + module Any : Map.S with type key = Any.t - module Exception : Set.S with type elt = Exception.t + module FunctorParameter : Map.S with type key = FunctorParameter.t - module Value : Set.S with type elt = Value.t + module Module : Map.S with type key = Module.t - module Class : Set.S with type elt = Class.t + module ModuleType : Map.S with type key = ModuleType.t - module ClassType : Set.S with type elt = ClassType.t + module Type : Map.S with type key = Type.t - module Method : Set.S with type elt = Method.t + module Class : Map.S with type key = Class.t - module InstanceVariable : Set.S with type elt = InstanceVariable.t + module ClassType : Map.S with type key = ClassType.t - module Label : Set.S with type elt = Label.t + module Label : Map.S with type key = Label.t - module Page : Set.S with type elt = Page.t + module Path : sig + module Type : Map.S with type key = Path.Type.t - module ContainerPage : Set.S with type elt = ContainerPage.t + module ClassType : Map.S with type key = Path.ClassType.t + end end - module Maps : sig - module Any : Map.S with type key = Any.t - - module Signature : Map.S with type key = Signature.t - - module ClassSignature : Map.S with type key = ClassSignature.t - - module DataType : Map.S with type key = DataType.t - - module Parent : Map.S with type key = Parent.t + module Mk : sig + open Names - module LabelParent : Map.S with type key = LabelParent.t + val page : + ContainerPage.t option * PageName.t -> + [> `Page of ContainerPage.t option * PageName.t ] id - module FunctorParameter : Map.S with type key = FunctorParameter.t - - module Module : Map.S with type key = Module.t + val leaf_page : + ContainerPage.t option * PageName.t -> + [> `LeafPage of ContainerPage.t option * PageName.t ] id - module ModuleType : Map.S with type key = ModuleType.t + val root : + ContainerPage.t option * ModuleName.t -> + [> `Root of ContainerPage.t option * ModuleName.t ] id - module Type : Map.S with type key = Type.t + val module_ : + Signature.t * ModuleName.t -> + [> `Module of Signature.t * ModuleName.t ] id - module Constructor : Map.S with type key = Constructor.t + val parameter : + Signature.t * ParameterName.t -> + [> `Parameter of Signature.t * ParameterName.t ] id - module Field : Map.S with type key = Field.t + val result : Signature.t -> [> `Result of Signature.t ] id - module Extension : Map.S with type key = Extension.t + val module_type : + Signature.t * ModuleTypeName.t -> + [> `ModuleType of Signature.t * ModuleTypeName.t ] id - module Exception : Map.S with type key = Exception.t + val class_ : + Signature.t * ClassName.t -> [> `Class of Signature.t * ClassName.t ] id - module Value : Map.S with type key = Value.t + val class_type : + Signature.t * ClassTypeName.t -> + [> `ClassType of Signature.t * ClassTypeName.t ] id - module Class : Map.S with type key = Class.t + val type_ : + Signature.t * TypeName.t -> [> `Type of Signature.t * TypeName.t ] id - module ClassType : Map.S with type key = ClassType.t + val core_type : string -> [> `CoreType of TypeName.t ] id - module Method : Map.S with type key = Method.t + val constructor : + Type.t * ConstructorName.t -> + [> `Constructor of Type.t * ConstructorName.t ] id - module InstanceVariable : Map.S with type key = InstanceVariable.t + val field : + Parent.t * FieldName.t -> [> `Field of Parent.t * FieldName.t ] id - module Label : Map.S with type key = Label.t + val extension : + Signature.t * ExtensionName.t -> + [> `Extension of Signature.t * ExtensionName.t ] id - module Page : Map.S with type key = Page.t + val exception_ : + Signature.t * ExceptionName.t -> + [> `Exception of Signature.t * ExceptionName.t ] id - module ContainerPage : Map.S with type key = ContainerPage.t + val core_exception : string -> [> `CoreException of ExceptionName.t ] id - module Path : sig - module Module : Map.S with type key = Path.Module.t + val value : + Signature.t * ValueName.t -> [> `Value of Signature.t * ValueName.t ] id - module ModuleType : Map.S with type key = Path.ModuleType.t + val method_ : + ClassSignature.t * MethodName.t -> + [> `Method of ClassSignature.t * MethodName.t ] id - module Type : Map.S with type key = Path.Type.t + val instance_variable : + ClassSignature.t * InstanceVariableName.t -> + [> `InstanceVariable of ClassSignature.t * InstanceVariableName.t ] id - module ClassType : Map.S with type key = Path.ClassType.t - end + val label : + LabelParent.t * LabelName.t -> + [> `Label of LabelParent.t * LabelName.t ] id end end @@ -430,25 +462,17 @@ module rec Path : sig module Module : sig type t = Paths_types.Resolved_path.module_ - val of_ident : Identifier.Path.Module.t -> t + val is_hidden : t -> weak_canonical_test:bool -> bool - val is_hidden : t -> bool - - val identifier : t -> Identifier.Path.Module.t - - val canonical_ident : t -> Identifier.Path.Module.t option + (* val identifier : t -> Identifier.Path.Module.t *) end module ModuleType : sig type t = Paths_types.Resolved_path.module_type - val of_ident : Identifier.Path.ModuleType.t -> t - - val is_hidden : t -> bool - - val identifier : t -> Identifier.Path.ModuleType.t + val is_hidden : t -> weak_canonical_test:bool -> bool - val canonical_ident : t -> Identifier.Path.ModuleType.t option + (* val identifier : t -> Identifier.Path.ModuleType.t *) end module Type : sig @@ -458,9 +482,7 @@ module rec Path : sig val is_hidden : t -> bool - val identifier : t -> Identifier.Path.Type.t - - val canonical_ident : t -> Identifier.Path.Type.t option + (* val identifier : t -> Identifier.Path.Type.t *) end module ClassType : sig @@ -469,8 +491,6 @@ module rec Path : sig val of_ident : Identifier.Path.ClassType.t -> t val is_hidden : t -> bool - - val identifier : t -> Identifier.Path.ClassType.t end type t = Paths_types.Resolved_path.any diff --git a/src/model/paths_types.ml b/src/model/paths_types.ml index 242f846fc6..fa052bf562 100644 --- a/src/model/paths_types.ml +++ b/src/model/paths_types.ml @@ -1,128 +1,187 @@ open Names (** {1 Paths} *) +type 'a id = { iv : 'a; ihash : int; ikey : string } + module Identifier = struct - type container_page = [ `Page of container_page option * PageName.t ] + type container_page_pv = [ `Page of container_page option * PageName.t ] + + and container_page = container_page_pv id (** @canonical Odoc_model.Paths.Identifier.ContainerPage.t *) - type page = - [ container_page | `LeafPage of container_page option * PageName.t ] + type page_pv = + [ container_page_pv | `LeafPage of container_page option * PageName.t ] + + and page = page_pv id (** @canonical Odoc_model.Paths.Identifier.Page.t *) - type odoc_id = [ page | `Root of container_page option * ModuleName.t ] + type odoc_id_pv = [ page_pv | `Root of container_page option * ModuleName.t ] + + and odoc_id = odoc_id_pv id (** @canonical Odoc_model.Paths.Identifier.OdocId.t *) - type signature = + type signature_pv = [ `Root of container_page option * ModuleName.t | `Module of signature * ModuleName.t | `Parameter of signature * ParameterName.t | `Result of signature | `ModuleType of signature * ModuleTypeName.t ] + + and signature = signature_pv id (** @canonical Odoc_model.Paths.Identifier.Signature.t *) - type class_signature = + type class_signature_pv = [ `Class of signature * ClassName.t | `ClassType of signature * ClassTypeName.t ] + + and class_signature = class_signature_pv id (** @canonical Odoc_model.Paths.Identifier.ClassSignature.t *) - type datatype = [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] + type datatype_pv = + [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] + + and datatype = datatype_pv id (** @canonical Odoc_model.Paths.Identifier.DataType.t *) - type parent = [ signature | datatype | class_signature ] + type parent_pv = [ signature_pv | datatype_pv | class_signature_pv ] + + and parent = parent_pv id (** @canonical Odoc_model.Paths.Identifier.Parent.t *) - type label_parent = [ parent | page ] + type label_parent_pv = [ parent_pv | page_pv ] + + and label_parent = label_parent_pv id (** @canonical Odoc_model.Paths.Identifier.LabelParent.t *) - type root_module = [ `Root of container_page option * ModuleName.t ] + type root_module_pv = [ `Root of container_page option * ModuleName.t ] + + and root_module = root_module_pv id (** @canonical Odoc_model.Paths.Identifier.RootModule.t *) - type module_ = [ root_module | `Module of signature * ModuleName.t ] + type module_pv = [ root_module_pv | `Module of signature * ModuleName.t ] + + and module_ = module_pv id (** @canonical Odoc_model.Paths.Identifier.Module.t *) - type functor_parameter = [ `Parameter of signature * ParameterName.t ] + type functor_parameter_pv = [ `Parameter of signature * ParameterName.t ] + + and functor_parameter = functor_parameter_pv id (** @canonical Odoc_model.Paths.Identifier.FunctorParameter.t *) - type functor_result = [ `Result of signature ] + type functor_result_pv = [ `Result of signature ] + + and functor_result = functor_result_pv id (** @canonical Odoc_model.Paths.Identifier.FunctorResult.t *) - type module_type = [ `ModuleType of signature * ModuleTypeName.t ] + type module_type_pv = [ `ModuleType of signature * ModuleTypeName.t ] + + and module_type = module_type_pv id (** @canonical Odoc_model.Paths.Identifier.ModuleType.t *) - type type_ = [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] + type type_pv = [ `Type of signature * TypeName.t | `CoreType of TypeName.t ] + + and type_ = type_pv id (** @canonical Odoc_model.Paths.Identifier.Type.t *) - type constructor = [ `Constructor of type_ * ConstructorName.t ] + type constructor_pv = [ `Constructor of type_ * ConstructorName.t ] + + and constructor = constructor_pv id (** @canonical Odoc_model.Paths.Identifier.Constructor.t *) - type field = [ `Field of parent * FieldName.t ] + type field_pv = [ `Field of parent * FieldName.t ] + + and field = field_pv id (** @canonical Odoc_model.Paths.Identifier.Field.t *) - type extension = [ `Extension of signature * ExtensionName.t ] + type extension_pv = [ `Extension of signature * ExtensionName.t ] + + and extension = extension_pv id (** @canonical Odoc_model.Paths.Identifier.Extension.t *) - type exception_ = + type exception_pv = [ `Exception of signature * ExceptionName.t | `CoreException of ExceptionName.t ] + + and exception_ = exception_pv id (** @canonical Odoc_model.Paths.Identifier.Exception.t *) - type value = [ `Value of signature * ValueName.t ] + type value_pv = [ `Value of signature * ValueName.t ] + + and value = value_pv id (** @canonical Odoc_model.Paths.Identifier.Value.t *) - type class_ = [ `Class of signature * ClassName.t ] + type class_pv = [ `Class of signature * ClassName.t ] + + and class_ = class_pv id (** @canonical Odoc_model.Paths.Identifier.Class.t *) - type class_type = [ `ClassType of signature * ClassTypeName.t ] + type class_type_pv = [ `ClassType of signature * ClassTypeName.t ] + + and class_type = class_type_pv id (** @canonical Odoc_model.Paths.Identifier.ClassType.t *) - type method_ = [ `Method of class_signature * MethodName.t ] + type method_pv = [ `Method of class_signature * MethodName.t ] + + and method_ = method_pv id (** @canonical Odoc_model.Paths.Identifier.Method.t *) - type instance_variable = + type instance_variable_pv = [ `InstanceVariable of class_signature * InstanceVariableName.t ] + + and instance_variable = instance_variable_pv id (** @canonical Odoc_model.Paths.Identifier.InstanceVariable.t *) - type label = [ `Label of label_parent * LabelName.t ] + type label_pv = [ `Label of label_parent * LabelName.t ] + + and label = label_pv id (** @canonical Odoc_model.Paths.Identifier.Label.t *) - type any = - [ signature - | class_signature - | datatype - | parent - | label_parent - | module_ - | functor_parameter - | functor_result - | module_type - | type_ - | constructor - | field - | extension - | exception_ - | value - | class_ - | class_type - | method_ - | instance_variable - | label - | page ] + type any_pv = + [ signature_pv + | class_signature_pv + | datatype_pv + | parent_pv + | label_parent_pv + | module_pv + | functor_parameter_pv + | functor_result_pv + | module_type_pv + | type_pv + | constructor_pv + | field_pv + | extension_pv + | exception_pv + | value_pv + | class_pv + | class_type_pv + | method_pv + | instance_variable_pv + | label_pv + | page_pv ] + + and any = any_pv id (** @canonical Odoc_model.Paths.Identifier.t *) - type path_module = [ module_ | functor_parameter | functor_result ] + type path_module_pv = [ module_pv | functor_parameter_pv | functor_result_pv ] + + and path_module = path_module_pv id (** @canonical Odoc_model.Paths.Identifier.Path.Module.t *) type path_module_type = module_type (** @canonical Odoc_model.Paths.Identifier.Path.ModuleType.t *) - type path_type = [ type_ | class_ | class_type ] + type path_type_pv = [ type_pv | class_pv | class_type_pv ] + + and path_type = path_type_pv id (** @canonical Odoc_model.Paths.Identifier.Path.Type.t *) - type path_class_type = [ class_ | class_type ] + type path_class_type_pv = [ class_pv | class_type_pv ] + + and path_class_type = path_class_type_pv id (** @canonical Odoc_model.Paths.Identifier.Path.ClassType.t *) type path_any = - [ path_module | path_module_type | path_type | path_class_type ] + [ path_module_pv | module_type_pv | path_type_pv | path_class_type_pv ] id (** @canonical Odoc_model.Paths.Identifier.Path.t *) type fragment_module = path_module @@ -131,15 +190,16 @@ module Identifier = struct type reference_module = path_module - type reference_module_type = path_module_type + type reference_module_type = module_type type reference_type = path_type - type reference_constructor = [ constructor | extension | exception_ ] + type reference_constructor = + [ constructor_pv | extension_pv | exception_pv ] id type reference_field = field - type reference_extension = [ extension | exception_ ] + type reference_extension = [ extension_pv | exception_pv ] id type reference_exception = exception_ @@ -147,7 +207,7 @@ module Identifier = struct type reference_class = class_ - type reference_class_type = [ class_ | class_type ] + type reference_class_type = [ class_pv | class_type_pv ] id type reference_method = method_ @@ -203,9 +263,9 @@ and Resolved_path : sig | `Subst of module_type * module_ | `Hidden of module_ | `Module of module_ * ModuleName.t - | `Canonical of module_ * Path.module_ - | `Apply of module_ * module_ - | `Alias of module_ * module_ + | `Canonical of module_ * Path.module_ (** [`Canonical (mod, canonical)] *) + | `Apply of module_ * module_ (** [`Apply (functor, argument)] *) + | `Alias of module_ * Path.module_ (** Resolved dest *) | `OpaqueModule of module_ ] (** @canonical Odoc_model.Paths.Path.Resolved.Module.t *) @@ -238,7 +298,7 @@ and Resolved_path : sig | `Module of module_ * ModuleName.t | `Canonical of module_ * Path.module_ | `Apply of module_ * module_ - | `Alias of module_ * module_ + | `Alias of module_ * Path.module_ | `AliasModuleType of module_type * module_type | `OpaqueModule of module_ | `ModuleType of module_ * ModuleTypeName.t diff --git a/src/model/predefined.ml b/src/model/predefined.ml index 531780b28a..90b2a87a88 100644 --- a/src/model/predefined.ml +++ b/src/model/predefined.ml @@ -51,94 +51,87 @@ let invariant_equation = let constraints = [] in { params; private_; manifest; constraints } -let bool_identifier = `CoreType (TypeName.make_std "bool") +module Mk = Paths.Identifier.Mk -let int_identifier = `CoreType (TypeName.make_std "int") +let bool_identifier = Mk.core_type "bool" -let char_identifier = `CoreType (TypeName.make_std "char") +let int_identifier = Mk.core_type "int" -let bytes_identifier = `CoreType (TypeName.make_std "bytes") +let char_identifier = Mk.core_type "char" -let string_identifier = `CoreType (TypeName.make_std "string") +let bytes_identifier = Mk.core_type "bytes" -let float_identifier = `CoreType (TypeName.make_std "float") +let string_identifier = Mk.core_type "string" -let unit_identifier = `CoreType (TypeName.make_std "unit") +let float_identifier = Mk.core_type "float" -let exn_identifier = `CoreType (TypeName.make_std "exn") +let unit_identifier = Mk.core_type "unit" -let array_identifier = `CoreType (TypeName.make_std "array") +let exn_identifier = Mk.core_type "exn" -let list_identifier = `CoreType (TypeName.make_std "list") +let array_identifier = Mk.core_type "array" -let option_identifier = `CoreType (TypeName.make_std "option") +let list_identifier = Mk.core_type "list" -let int32_identifier = `CoreType (TypeName.make_std "int32") +let option_identifier = Mk.core_type "option" -let int64_identifier = `CoreType (TypeName.make_std "int64") +let int32_identifier = Mk.core_type "int32" -let nativeint_identifier = `CoreType (TypeName.make_std "nativeint") +let int64_identifier = Mk.core_type "int64" -let lazy_t_identifier = `CoreType (TypeName.make_std "lazy_t") +let nativeint_identifier = Mk.core_type "nativeint" -let extension_constructor_identifier = - `CoreType (TypeName.make_std "extension_constructor") +let lazy_t_identifier = Mk.core_type "lazy_t" -let floatarray_identifier = `CoreType (TypeName.make_std "floatarray") +let extension_constructor_identifier = Mk.core_type "extension_constructor" + +let floatarray_identifier = Mk.core_type "floatarray" let false_identifier = - `Constructor (bool_identifier, ConstructorName.make_std "false") + Mk.constructor (bool_identifier, ConstructorName.make_std "false") let true_identifier = - `Constructor (bool_identifier, ConstructorName.make_std "true") + Mk.constructor (bool_identifier, ConstructorName.make_std "true") let void_identifier = - `Constructor (unit_identifier, ConstructorName.make_std "()") + Mk.constructor (unit_identifier, ConstructorName.make_std "()") let nil_identifier = - `Constructor (list_identifier, ConstructorName.make_std "([])") + Mk.constructor (list_identifier, ConstructorName.make_std "([])") let cons_identifier = - `Constructor (list_identifier, ConstructorName.make_std "(::)") + Mk.constructor (list_identifier, ConstructorName.make_std "(::)") let none_identifier = - `Constructor (option_identifier, ConstructorName.make_std "None") + Mk.constructor (option_identifier, ConstructorName.make_std "None") let some_identifier = - `Constructor (option_identifier, ConstructorName.make_std "Some") + Mk.constructor (option_identifier, ConstructorName.make_std "Some") -let match_failure_identifier = - `CoreException (ExceptionName.make_std "Match_failure") +let match_failure_identifier = Mk.core_exception "Match_failure" -let assert_failure_identifier = - `CoreException (ExceptionName.make_std "Assert_failure") +let assert_failure_identifier = Mk.core_exception "Assert_failure" -let invalid_argument_identifier = - `CoreException (ExceptionName.make_std "Invalid_argument") +let invalid_argument_identifier = Mk.core_exception "Invalid_argument" -let failure_identifier = `CoreException (ExceptionName.make_std "Failure") +let failure_identifier = Mk.core_exception "Failure" -let not_found_identifier = `CoreException (ExceptionName.make_std "Not_found") +let not_found_identifier = Mk.core_exception "Not_found" -let out_of_memory_identifier = - `CoreException (ExceptionName.make_std "Out_of_memory") +let out_of_memory_identifier = Mk.core_exception "Out_of_memory" -let stack_overflow_identifier = - `CoreException (ExceptionName.make_std "Stack_overflow") +let stack_overflow_identifier = Mk.core_exception "Stack_overflow" -let sys_error_identifier = `CoreException (ExceptionName.make_std "Sys_error") +let sys_error_identifier = Mk.core_exception "Sys_error" -let end_of_file_identifier = - `CoreException (ExceptionName.make_std "End_of_file") +let end_of_file_identifier = Mk.core_exception "End_of_file" -let division_by_zero_identifier = - `CoreException (ExceptionName.make_std "Division_by_zero") +let division_by_zero_identifier = Mk.core_exception "Division_by_zero" -let sys_blocked_io_identifier = - `CoreException (ExceptionName.make_std "Sys_blocked_io") +let sys_blocked_io_identifier = Mk.core_exception "Sys_blocked_io" let undefined_recursive_module_identifier = - `CoreException (ExceptionName.make_std "Undefined_recursive_module") + Mk.core_exception "Undefined_recursive_module" let core_type_identifier = function | "int" -> Some int_identifier diff --git a/src/model/root.ml b/src/model/root.ml index 744b5e1184..99ea13add7 100644 --- a/src/model/root.ml +++ b/src/model/root.ml @@ -63,7 +63,7 @@ let hash : t -> int = Hashtbl.hash let to_string t = let rec pp fmt (id : Paths.Identifier.OdocId.t) = - match id with + match id.iv with | `LeafPage (parent, name) | `Page (parent, name) -> ( match parent with | Some p -> diff --git a/src/model/semantics.ml b/src/model/semantics.ml index 1f0a06ebbf..a44124b4fb 100644 --- a/src/model/semantics.ml +++ b/src/model/semantics.ml @@ -347,7 +347,8 @@ let section_heading : | None -> (false, generate_heading_label text) in let label = - `Label (status.parent_of_sections, Names.LabelName.make_std label) + Paths.Identifier.Mk.label + (status.parent_of_sections, Names.LabelName.make_std label) in let mk_heading heading_level = @@ -396,7 +397,7 @@ let section_heading : mk_heading level' let validate_first_page_heading status ast_element = - match status.parent_of_sections with + match status.parent_of_sections.iv with | `Page (_, name) | `LeafPage (_, name) -> ( match ast_element with | { Location.value = `Heading (_, _, _); _ } -> () @@ -446,7 +447,7 @@ let top_level_block_elements status ast_elements = in let top_heading_level = (* Non-page documents have a generated title. *) - match status.parent_of_sections with + match status.parent_of_sections.iv with | `Page _ | `LeafPage _ -> None | _parent_with_generated_title -> Some 0 in diff --git a/src/model_desc/paths_desc.ml b/src/model_desc/paths_desc.ml index ead78c4f52..f1e2c83575 100644 --- a/src/model_desc/paths_desc.ml +++ b/src/model_desc/paths_desc.ml @@ -60,95 +60,96 @@ module General_paths = struct let rec identifier : Paths.Identifier.t t = Variant - (function - | `Page (parent, name) -> - C - ( "`Page", - ((parent :> id_t option), name), - Pair (Option identifier, Names.pagename) ) - | `LeafPage (parent, name) -> - C - ( "`LeafPage", - ((parent :> id_t option), name), - Pair (Option identifier, Names.pagename) ) - | `Root (parent, name) -> - C - ( "`Root", - ((parent :> id_t option), name), - Pair (Option identifier, Names.modulename) ) - | `Module (parent, name) -> - C - ( "`Module", - ((parent :> id_t), name), - Pair (identifier, Names.modulename) ) - | `Parameter (parent, name) -> - C - ( "`Parameter", - ((parent :> id_t), name), - Pair (identifier, Names.parametername) ) - | `Result r -> C ("`Result", (r :> id_t), identifier) - | `ModuleType (parent, name) -> - C - ( "`ModuleType", - ((parent :> id_t), name), - Pair (identifier, Names.moduletypename) ) - | `Class (parent, name) -> - C - ( "`Class", - ((parent :> id_t), name), - Pair (identifier, Names.classname) ) - | `ClassType (parent, name) -> - C - ( "`ClassType", - ((parent :> id_t), name), - Pair (identifier, Names.classtypename) ) - | `Type (parent, name) -> - C - ( "`Type", - ((parent :> id_t), name), - Pair (identifier, Names.typename) ) - | `CoreType name -> C ("`CoreType", name, Names.typename) - | `Constructor (parent, name) -> - C - ( "`Constructor", - ((parent :> id_t), name), - Pair (identifier, Names.constructorname) ) - | `Field (parent, name) -> - C - ( "`Field", - ((parent :> id_t), name), - Pair (identifier, Names.fieldname) ) - | `Extension (parent, name) -> - C - ( "`Extension", - ((parent :> id_t), name), - Pair (identifier, Names.extensionname) ) - | `Exception (parent, name) -> - C - ( "`Exception", - ((parent :> id_t), name), - Pair (identifier, Names.exceptionname) ) - | `CoreException name -> C ("`CoreException", name, Names.exceptionname) - | `Value (parent, name) -> - C - ( "`Value", - ((parent :> id_t), name), - Pair (identifier, Names.valuename) ) - | `Method (parent, name) -> - C - ( "`Method", - ((parent :> id_t), name), - Pair (identifier, Names.methodname) ) - | `InstanceVariable (parent, name) -> - C - ( "`InstanceVariable", - ((parent :> id_t), name), - Pair (identifier, Names.instancevariablename) ) - | `Label (parent, name) -> - C - ( "`Label", - ((parent :> id_t), name), - Pair (identifier, Names.labelname) )) + (fun x -> + match x.iv with + | `Page (parent, name) -> + C + ( "`Page", + ((parent :> id_t option), name), + Pair (Option identifier, Names.pagename) ) + | `LeafPage (parent, name) -> + C + ( "`LeafPage", + ((parent :> id_t option), name), + Pair (Option identifier, Names.pagename) ) + | `Root (parent, name) -> + C + ( "`Root", + ((parent :> id_t option), name), + Pair (Option identifier, Names.modulename) ) + | `Module (parent, name) -> + C + ( "`Module", + ((parent :> id_t), name), + Pair (identifier, Names.modulename) ) + | `Parameter (parent, name) -> + C + ( "`Parameter", + ((parent :> id_t), name), + Pair (identifier, Names.parametername) ) + | `Result r -> C ("`Result", (r :> id_t), identifier) + | `ModuleType (parent, name) -> + C + ( "`ModuleType", + ((parent :> id_t), name), + Pair (identifier, Names.moduletypename) ) + | `Class (parent, name) -> + C + ( "`Class", + ((parent :> id_t), name), + Pair (identifier, Names.classname) ) + | `ClassType (parent, name) -> + C + ( "`ClassType", + ((parent :> id_t), name), + Pair (identifier, Names.classtypename) ) + | `Type (parent, name) -> + C + ( "`Type", + ((parent :> id_t), name), + Pair (identifier, Names.typename) ) + | `CoreType name -> C ("`CoreType", name, Names.typename) + | `Constructor (parent, name) -> + C + ( "`Constructor", + ((parent :> id_t), name), + Pair (identifier, Names.constructorname) ) + | `Field (parent, name) -> + C + ( "`Field", + ((parent :> id_t), name), + Pair (identifier, Names.fieldname) ) + | `Extension (parent, name) -> + C + ( "`Extension", + ((parent :> id_t), name), + Pair (identifier, Names.extensionname) ) + | `Exception (parent, name) -> + C + ( "`Exception", + ((parent :> id_t), name), + Pair (identifier, Names.exceptionname) ) + | `CoreException name -> C ("`CoreException", name, Names.exceptionname) + | `Value (parent, name) -> + C + ( "`Value", + ((parent :> id_t), name), + Pair (identifier, Names.valuename) ) + | `Method (parent, name) -> + C + ( "`Method", + ((parent :> id_t), name), + Pair (identifier, Names.methodname) ) + | `InstanceVariable (parent, name) -> + C + ( "`InstanceVariable", + ((parent :> id_t), name), + Pair (identifier, Names.instancevariablename) ) + | `Label (parent, name) -> + C + ( "`Label", + ((parent :> id_t), name), + Pair (identifier, Names.labelname) )) let reference_tag : tag t = Variant @@ -202,11 +203,8 @@ module General_paths = struct ( "`Apply", ((x1 :> rp), (x2 :> rp)), Pair (resolved_path, resolved_path) ) - | `Alias (x1, x2) -> - C - ( "`Alias", - ((x1 :> rp), (x2 :> rp)), - Pair (resolved_path, resolved_path) ) + | `Alias (dest, src) -> + C ("`Alias", ((dest :> rp), (src :> p)), Pair (resolved_path, path)) | `AliasModuleType (x1, x2) -> C ( "`AliasModuleType", @@ -433,7 +431,7 @@ let root = Root.t let modulename = Names.modulename (* Indirection seems to be required to make the type open. *) -let identifier : [< Paths.Identifier.t ] Type_desc.t = +let identifier : [< Paths.Identifier.t_pv ] Paths.id Type_desc.t = Indirect ((fun n -> (n :> Paths.Identifier.t)), General_paths.identifier) let resolved_path : [< Paths.Path.Resolved.t ] Type_desc.t = diff --git a/src/model_desc/paths_desc.mli b/src/model_desc/paths_desc.mli index a36e0930d2..a2937b8ee1 100644 --- a/src/model_desc/paths_desc.mli +++ b/src/model_desc/paths_desc.mli @@ -4,7 +4,7 @@ val root : Odoc_model.Root.t Type_desc.t val modulename : Odoc_model.Names.ModuleName.t Type_desc.t -val identifier : [< Identifier.t ] Type_desc.t +val identifier : [< Identifier.t_pv ] Odoc_model.Paths.id Type_desc.t val resolved_path : [< Path.Resolved.t ] Type_desc.t diff --git a/src/odoc/bin/main.ml b/src/odoc/bin/main.ml index d0833c5621..ad8df58aee 100644 --- a/src/odoc/bin/main.ml +++ b/src/odoc/bin/main.ml @@ -652,7 +652,7 @@ module Depends = struct module Link = struct let rec fmt_page pp page = - match page with + match page.Odoc_model.Paths.iv with | `Page (parent_opt, name) -> Format.fprintf pp "%a%a" fmt_parent_opt parent_opt Odoc_model.Names.PageName.fmt name @@ -670,7 +670,7 @@ module Depends = struct Depends.for_rendering_step (Fs.Directory.of_string input_file) >>= fun depends -> List.iter depends ~f:(fun (root : Odoc_model.Root.t) -> - match root.id with + match root.id.iv with | `Root (Some p, _) -> Format.printf "%a %s %s\n" fmt_page p (Odoc_model.Root.Odoc_file.name root.file) diff --git a/src/odoc/compile.ml b/src/odoc/compile.ml index babb93ac64..fef01a3683 100644 --- a/src/odoc/compile.ml +++ b/src/odoc/compile.ml @@ -50,7 +50,7 @@ let parent resolver parent_cli_spec = | _ -> Error (`Msg "Expecting page as parent") in let extract_parent = function - | `Page _ as container -> Ok container + | { Odoc_model.Paths.iv = `Page _; _ } as container -> Ok container | _ -> Error (`Msg "Specified parent is not a parent of this file") in match parent_cli_spec with @@ -59,7 +59,11 @@ let parent resolver parent_cli_spec = find_parent r >>= fun page -> extract_parent page.name >>= fun parent -> Ok (Explicit (parent, page.children)) - | CliPackage package -> Ok (Package (`Page (None, PageName.make_std package))) + | CliPackage package -> + Ok + (Package + (Odoc_model.Paths.Identifier.Mk.page + (None, PageName.make_std package))) | CliNoparent -> Ok Noparent let resolve_imports resolver imports = @@ -109,7 +113,14 @@ let root_of_compilation_unit ~parent_spec ~hidden ~output ~module_name ~digest = in let result parent = let file = Odoc_file.create_unit ~force_hidden:hidden module_name in - Ok { id = `Root (parent, ModuleName.make_std module_name); file; digest } + Ok + { + id = + Odoc_model.Paths.Identifier.Mk.root + (parent, ModuleName.make_std module_name); + file; + digest; + } in let check_child : Odoc_model.Paths.Reference.t -> bool = fun c -> @@ -164,14 +175,15 @@ let mld ~parent_spec ~output ~children ~warnings_options input = if List.exists check_child parents_children then Ok v else Error (`Msg "Specified parent is not a parent of this file") in + let module Mk = Odoc_model.Paths.Identifier.Mk in match (parent_spec, children) with - | Explicit (p, cs), [] -> check cs @@ `LeafPage (Some p, page_name) - | Explicit (p, cs), _ -> check cs @@ `Page (Some p, page_name) - | Package parent, [] -> Ok (`LeafPage (Some parent, page_name)) + | Explicit (p, cs), [] -> check cs @@ Mk.leaf_page (Some p, page_name) + | Explicit (p, cs), _ -> check cs @@ Mk.page (Some p, page_name) + | Package parent, [] -> Ok (Mk.leaf_page (Some parent, page_name)) | Package parent, _ -> - Ok (`Page (Some parent, page_name)) (* This is a bit odd *) - | Noparent, [] -> Ok (`LeafPage (None, page_name)) - | Noparent, _ -> Ok (`Page (None, page_name)) + Ok (Mk.page (Some parent, page_name)) (* This is a bit odd *) + | Noparent, [] -> Ok (Mk.leaf_page (None, page_name)) + | Noparent, _ -> Ok (Mk.page (None, page_name)) in name >>= fun name -> let root = diff --git a/src/odoc/html_fragment.ml b/src/odoc/html_fragment.ml index 35193bae30..d0402f7949 100644 --- a/src/odoc/html_fragment.ml +++ b/src/odoc/html_fragment.ml @@ -3,7 +3,10 @@ open Or_error let from_mld ~xref_base_uri ~resolver ~output ~warnings_options input = (* Internal names, they don't have effect on the output. *) let page_name = "__fragment_page__" in - let id = `Page (None, Odoc_model.Names.PageName.make_std page_name) in + let id = + Odoc_model.Paths.Identifier.Mk.page + (None, Odoc_model.Names.PageName.make_std page_name) + in let input_s = Fs.File.to_string input in let digest = Digest.file input_s in let root = diff --git a/src/xref2/compile.ml b/src/xref2/compile.ml index 4aeba9a1b7..89da0de91f 100644 --- a/src/xref2/compile.ml +++ b/src/xref2/compile.ml @@ -411,7 +411,8 @@ and simple_expansion : | Functor (param, sg) -> let env' = Env.add_functor_parameter param env in Functor - (functor_parameter env param, simple_expansion env' (`Result id) sg) + ( functor_parameter env param, + simple_expansion env' (Paths.Identifier.Mk.result id) sg ) and functor_parameter : Env.t -> FunctorParameter.t -> FunctorParameter.t = fun env param -> @@ -677,7 +678,7 @@ and module_type_expr : | Functor (param, res) -> let param' = functor_parameter env param in let env' = Env.add_functor_parameter param env in - let res' = module_type_expr env' (`Result id) res in + let res' = module_type_expr env' (Paths.Identifier.Mk.result id) res in Functor (param', res') | TypeOf { t_desc; t_expansion } as e -> let t_expansion = get_expansion t_expansion e in @@ -692,7 +693,7 @@ and type_decl : Env.t -> TypeDecl.t -> TypeDecl.t = fun env t -> let open TypeDecl in let container = - match t.id with + match t.id.iv with | `Type (parent, _) -> (parent :> Id.Parent.t) | `CoreType _ -> assert false in diff --git a/src/xref2/component.ml b/src/xref2/component.ml index 37aaf76fe0..a69063a94b 100644 --- a/src/xref2/component.ml +++ b/src/xref2/component.ml @@ -78,7 +78,7 @@ module rec Module : sig type t = { doc : CComment.docs; type_ : decl; - canonical : Cpath.module_ option; + canonical : Odoc_model.Paths.Path.Module.t option; hidden : bool; } end = @@ -229,7 +229,7 @@ and ModuleType : sig type t = { doc : CComment.docs; - canonical : Cpath.module_type option; + canonical : Odoc_model.Paths.Path.ModuleType.t option; expr : expr option; } end = @@ -276,7 +276,7 @@ and TypeDecl : sig type t = { doc : CComment.docs; - canonical : Cpath.type_ option; + canonical : Odoc_model.Paths.Path.Type.t option; equation : Equation.t; representation : Representation.t option; } @@ -894,24 +894,23 @@ module Fmt = struct | `Apply (p1, p2) -> Format.fprintf ppf "%a(%a)" resolved_module_path p1 resolved_module_path p2 - | `Identifier p -> - Format.fprintf ppf "%a" model_identifier - (p :> Odoc_model.Paths.Identifier.t) + | `Gpath p -> + Format.fprintf ppf "%a" model_resolved_path + (p :> Odoc_model.Paths.Path.Resolved.t) | `Substituted p -> Format.fprintf ppf "substituted(%a)" resolved_module_path p | `Module (p, m) -> Format.fprintf ppf "%a.%s" resolved_parent_path p (Odoc_model.Names.ModuleName.to_string m) - | `Alias (p1, p2) -> - Format.fprintf ppf "alias(%a,%a)" resolved_module_path p1 - resolved_module_path p2 + | `Alias (p1, p2, _) -> + Format.fprintf ppf "alias(%a,%a)" resolved_module_path p1 module_path p2 | `Subst (p1, p2) -> Format.fprintf ppf "subst(%a,%a)" resolved_module_type_path p1 resolved_module_path p2 | `Hidden p1 -> Format.fprintf ppf "hidden(%a)" resolved_module_path p1 | `Canonical (p1, p2) -> - Format.fprintf ppf "canonical(%a,%a)" resolved_module_path p1 - module_path p2 + Format.fprintf ppf "canonical(%a,%a)" resolved_module_path p1 model_path + (p2 :> Odoc_model.Paths.Path.t) | `OpaqueModule m -> Format.fprintf ppf "opaquemodule(%a)" resolved_module_path m @@ -938,9 +937,9 @@ module Fmt = struct fun ppf p -> match p with | `Local id -> Format.fprintf ppf "%a" Ident.fmt id - | `Identifier id -> - Format.fprintf ppf "%a" model_identifier - (id :> Odoc_model.Paths.Identifier.t) + | `Gpath p -> + Format.fprintf ppf "%a" model_resolved_path + (p :> Odoc_model.Paths.Path.Resolved.t) | `Substituted x -> Format.fprintf ppf "substituted(%a)" resolved_module_type_path x | `ModuleType (p, m) -> @@ -948,7 +947,8 @@ module Fmt = struct (ModuleTypeName.to_string m) | `CanonicalModuleType (m1, m2) -> Format.fprintf ppf "canonicalt(%a,%a)" resolved_module_type_path m1 - module_type_path m2 + model_path + (m2 :> Odoc_model.Paths.Path.t) | `OpaqueModuleType m -> Format.fprintf ppf "opaquemoduletype(%a)" resolved_module_type_path m | `AliasModuleType (mt1, mt2) -> @@ -976,14 +976,14 @@ module Fmt = struct fun ppf p -> match p with | `Local id -> Format.fprintf ppf "%a" Ident.fmt id - | `Identifier id -> - Format.fprintf ppf "%a" model_identifier - (id :> Odoc_model.Paths.Identifier.t) + | `Gpath p -> + Format.fprintf ppf "%a" model_resolved_path + (p :> Odoc_model.Paths.Path.Resolved.t) | `Substituted x -> Format.fprintf ppf "substituted(%a)" resolved_type_path x | `CanonicalType (t1, t2) -> - Format.fprintf ppf "canonicalty(%a,%a)" resolved_type_path t1 type_path - t2 + Format.fprintf ppf "canonicalty(%a,%a)" resolved_type_path t1 model_path + (t2 :> Odoc_model.Paths.Path.t) | `Class (p, t) -> Format.fprintf ppf "%a.%s" resolved_parent_path p (Odoc_model.Names.ClassName.to_string t) @@ -1027,9 +1027,9 @@ module Fmt = struct fun ppf p -> match p with | `Local id -> Format.fprintf ppf "%a" Ident.fmt id - | `Identifier id -> - Format.fprintf ppf "%a" model_identifier - (id :> Odoc_model.Paths.Identifier.t) + | `Gpath p -> + Format.fprintf ppf "%a" model_resolved_path + (p :> Odoc_model.Paths.Path.Resolved.t) | `Substituted s -> Format.fprintf ppf "substituted(%a)" resolved_class_type_path s | `Class (p, t) -> @@ -1095,11 +1095,11 @@ module Fmt = struct Format.fprintf ppf "%a.%s" model_resolved_path (parent :> t) (Odoc_model.Names.TypeName.to_string name) - | `Alias (path, realpath) -> + | `Alias (dest, src) -> Format.fprintf ppf "alias(%a,%a)" model_resolved_path - (path :> t) - model_resolved_path - (realpath :> t) + (dest :> t) + model_path + (src :> Odoc_model.Paths.Path.t) | `AliasModuleType (path, realpath) -> Format.fprintf ppf "aliasmoduletype(%a,%a)" model_resolved_path (path :> t) @@ -1150,7 +1150,7 @@ module Fmt = struct Format.fprintf ppf "opaquemoduletype(%a)" model_resolved_path (m :> t) and model_identifier ppf (p : Odoc_model.Paths.Identifier.t) = - match p with + match p.iv with | `Root (_, unit_name) -> Format.fprintf ppf "(root %s)" (Odoc_model.Names.ModuleName.to_string unit_name) @@ -1477,67 +1477,42 @@ module LocalIdents = struct except within them, so we only do that on demand. *) type t = { - 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; + modules : Paths.Identifier.Module.t list; + module_types : Paths.Identifier.ModuleType.t list; + types : Paths.Identifier.Type.t list; + classes : Paths.Identifier.Class.t list; + class_types : Paths.Identifier.ClassType.t list; } let empty = - let open Paths.Identifier.Sets in { - modules = Module.empty; - module_types = ModuleType.empty; - types = Type.empty; - classes = Class.empty; - class_types = ClassType.empty; + modules = []; + module_types = []; + types = []; + classes = []; + class_types = []; } open Lang let rec signature_items s ids = - let open Paths in let open Signature in List.fold_right (fun c ids -> match c with | Module (_, { Module.id; _ }) -> - { ids with modules = Identifier.Sets.Module.add id ids.modules } + { ids with modules = id :: ids.modules } | ModuleType m -> - { - ids with - module_types = - Identifier.Sets.ModuleType.add m.ModuleType.id ids.module_types; - } + { ids with module_types = m.ModuleType.id :: ids.module_types } | ModuleSubstitution { ModuleSubstitution.id; _ } -> - { ids with modules = Identifier.Sets.Module.add id ids.modules } + { ids with modules = id :: ids.modules } | ModuleTypeSubstitution { ModuleTypeSubstitution.id; _ } -> - { - ids with - module_types = Identifier.Sets.ModuleType.add id ids.module_types; - } - | Type (_, t) -> - { - ids with - types = Identifier.Sets.Type.add t.TypeDecl.id ids.types; - } - | TypeSubstitution t -> - { - ids with - types = Identifier.Sets.Type.add t.TypeDecl.id ids.types; - } - | Class (_, c) -> - { - ids with - classes = Identifier.Sets.Class.add c.Class.id ids.classes; - } + { ids with module_types = id :: ids.module_types } + | Type (_, t) -> { ids with types = t.TypeDecl.id :: ids.types } + | TypeSubstitution t -> { ids with types = t.TypeDecl.id :: ids.types } + | Class (_, c) -> { ids with classes = c.Class.id :: ids.classes } | ClassType (_, c) -> - { - ids with - class_types = - Identifier.Sets.ClassType.add c.ClassType.id ids.class_types; - } + { ids with class_types = c.ClassType.id :: ids.class_types } | TypExt _ | Exception _ | Value _ | Comment _ -> ids | Include i -> signature i.Include.expansion.content ids | Open o -> signature o.Open.expansion ids) @@ -1549,14 +1524,6 @@ end module Of_Lang = struct open Odoc_model - module RM = Map.Make (struct - type t = Paths.Path.Resolved.Module.t - - let compare x y = if x == y then 0 else compare x y - end) - - type memos = { mutable rmodpathmemo : Cpath.Resolved.module_ RM.t } - type map = { modules : Ident.module_ Paths.Identifier.Maps.Module.t; module_types : Ident.module_type Paths.Identifier.Maps.ModuleType.t; @@ -1568,12 +1535,10 @@ module Of_Lang = struct Ident.path_class_type Paths.Identifier.Maps.Path.ClassType.t; classes : Ident.class_ Paths.Identifier.Maps.Class.t; class_types : Ident.class_type Paths.Identifier.Maps.ClassType.t; - memos : memos; } let empty () = let open Paths.Identifier.Maps in - let memos = { rmodpathmemo = RM.empty } in { modules = Module.empty; module_types = ModuleType.empty; @@ -1583,92 +1548,74 @@ module Of_Lang = struct path_class_types = Path.ClassType.empty; classes = Class.empty; class_types = ClassType.empty; - memos; } let map_of_idents ids map = let open Paths.Identifier in - let types_new = - Sets.Type.fold - (fun i acc -> Maps.Type.add i (Ident.Of_Identifier.type_ i) acc) - ids.LocalIdents.types Maps.Type.empty + (* New types go into [types_new] and [path_types_new] + New classes go into [classes_new] and [path_class_types_new] + New class_types go into [class_types_new], [path_types_new] and [path_class_types_new] *) + let types_new, path_types_new = + List.fold_right + (fun i (types, path_types) -> + let id = Ident.Of_Identifier.type_ i in + ( Maps.Type.add i id types, + Maps.Path.Type.add + (i :> Path.Type.t) + (id :> Ident.path_type) + path_types )) + ids.LocalIdents.types + (map.types, map.path_types) in - let classes_new = - Sets.Class.fold - (fun i acc -> Maps.Class.add i (Ident.Of_Identifier.class_ i) acc) - ids.LocalIdents.classes Maps.Class.empty + let classes_new, path_class_types_new = + List.fold_right + (fun i (classes, path_class_types) -> + let id = Ident.Of_Identifier.class_ i in + ( Maps.Class.add i id classes, + Maps.Path.ClassType.add + (i :> Path.ClassType.t) + (id :> Ident.path_class_type) + path_class_types )) + ids.LocalIdents.classes + (map.classes, map.path_class_types) in - let class_types_new = - Sets.ClassType.fold - (fun i acc -> - Maps.ClassType.add i (Ident.Of_Identifier.class_type i) acc) - ids.LocalIdents.class_types Maps.ClassType.empty + let class_types_new, path_types_new, path_class_types_new = + List.fold_right + (fun i (class_types, path_types, path_class_types) -> + let id = Ident.Of_Identifier.class_type i in + ( Maps.ClassType.add i id class_types, + Maps.Path.Type.add + (i :> Path.Type.t) + (id :> Ident.path_type) + path_types, + Maps.Path.ClassType.add + (i :> Path.ClassType.t) + (id :> Ident.path_class_type) + path_class_types )) + ids.LocalIdents.class_types + (map.class_types, path_types_new, path_class_types_new) in let modules_new = - Sets.Module.fold + List.fold_right (fun i acc -> Maps.Module.add (i :> Module.t) (Ident.Of_Identifier.module_ i) acc) - ids.LocalIdents.modules Maps.Module.empty + ids.LocalIdents.modules map.modules in let module_types_new = - Sets.ModuleType.fold + List.fold_right (fun i acc -> Maps.ModuleType.add i (Ident.Of_Identifier.module_type i) acc) - ids.LocalIdents.module_types Maps.ModuleType.empty - in - let path_class_types_new = - Maps.Path.ClassType.empty - |> Maps.ClassType.fold - (fun key v acc -> - Maps.Path.ClassType.add - (key :> Path.ClassType.t) - (v :> Ident.path_class_type) - acc) - class_types_new - |> Maps.Class.fold - (fun key v acc -> - Maps.Path.ClassType.add - (key :> Path.ClassType.t) - (v :> Ident.path_class_type) - acc) - classes_new - in - let path_types_new = - Maps.Path.Type.empty - |> Maps.Path.ClassType.fold - (fun key v acc -> - Maps.Path.Type.add (key :> Path.Type.t) (v :> Ident.path_type) acc) - path_class_types_new - |> Maps.Type.fold - (fun key v acc -> - Maps.Path.Type.add (key :> Path.Type.t) (v :> Ident.path_type) acc) - types_new - in - let merge_fn _k v1 v2 = - match (v1, v2) with - | _, Some x -> Some x - | None, None -> None - | Some x, None -> Some x - in - let modules = Maps.Module.merge merge_fn modules_new map.modules in - let module_types = - Maps.ModuleType.merge merge_fn module_types_new map.module_types + ids.LocalIdents.module_types map.module_types in + let modules = modules_new in + let module_types = module_types_new in let functor_parameters = map.functor_parameters in - let types = Maps.Type.merge merge_fn types_new map.types in - let classes = Maps.Class.merge merge_fn classes_new map.classes in - let class_types = - Maps.ClassType.merge merge_fn class_types_new map.class_types - in - let path_types = - Maps.Path.Type.merge merge_fn path_types_new map.path_types - in - let path_class_types = - Maps.Path.ClassType.merge merge_fn path_class_types_new - map.path_class_types - in + let types = types_new in + let classes = classes_new in + let class_types = class_types_new in + let path_types = path_types_new in + let path_class_types = path_class_types_new in { - (empty ()) with modules; module_types; functor_parameters; @@ -1689,9 +1636,10 @@ module Of_Lang = struct let find_any_module i ident_map = match i with - | #Paths.Identifier.Module.t as id -> + | { Odoc_model.Paths.iv = #Paths.Identifier.Module.t_pv; _ } as id -> (Maps.Module.find id ident_map.modules :> Ident.path_module) - | #Paths.Identifier.FunctorParameter.t as id -> + | { Odoc_model.Paths.iv = #Paths.Identifier.FunctorParameter.t_pv; _ } as id + -> (Maps.FunctorParameter.find id ident_map.functor_parameters :> Ident.path_module) | _ -> raise Not_found @@ -1699,24 +1647,20 @@ module Of_Lang = struct let rec resolved_module_path : _ -> Odoc_model.Paths.Path.Resolved.Module.t -> Cpath.Resolved.module_ = fun ident_map p -> - let f () = - let recurse p = resolved_module_path ident_map p in - match p with - | `Identifier i -> identifier find_any_module ident_map i - | `Module (p, name) -> `Module (`Module (recurse p), name) - | `Apply (p1, p2) -> `Apply (recurse p1, recurse p2) - | `Alias (p1, p2) -> `Alias (recurse p1, recurse p2) - | `Subst (p1, p2) -> - `Subst (resolved_module_type_path ident_map p1, recurse p2) - | `Canonical (p1, p2) -> `Canonical (recurse p1, module_path ident_map p2) - | `Hidden p1 -> `Hidden (recurse p1) - | `OpaqueModule m -> `OpaqueModule (recurse m) - in - try RM.find p ident_map.memos.rmodpathmemo - with Not_found -> - let res = f () in - ident_map.memos.rmodpathmemo <- RM.add p res ident_map.memos.rmodpathmemo; - res + let recurse p = resolved_module_path ident_map p in + match p with + | `Identifier i -> ( + match identifier find_any_module ident_map i with + | `Local l -> `Local l + | `Identifier _ -> `Gpath p) + | `Module (p, name) -> `Module (`Module (recurse p), name) + | `Apply (p1, p2) -> `Apply (recurse p1, recurse p2) + | `Alias (p1, p2) -> `Alias (recurse p1, module_path ident_map p2, None) + | `Subst (p1, p2) -> + `Subst (resolved_module_type_path ident_map p1, recurse p2) + | `Canonical (p1, p2) -> `Canonical (recurse p1, p2) + | `Hidden p1 -> `Hidden (recurse p1) + | `OpaqueModule m -> `OpaqueModule (recurse m) and resolved_module_type_path : _ -> @@ -1724,12 +1668,14 @@ module Of_Lang = struct Cpath.Resolved.module_type = fun ident_map p -> match p with - | `Identifier i -> identifier Maps.ModuleType.find ident_map.module_types i + | `Identifier i -> ( + match identifier Maps.ModuleType.find ident_map.module_types i with + | `Local l -> `Local l + | `Identifier _ -> `Gpath p) | `ModuleType (p, name) -> `ModuleType (`Module (resolved_module_path ident_map p), name) | `CanonicalModuleType (p1, p2) -> - `CanonicalModuleType - (resolved_module_type_path ident_map p1, module_type_path ident_map p2) + `CanonicalModuleType (resolved_module_type_path ident_map p1, p2) | `OpaqueModuleType m -> `OpaqueModuleType (resolved_module_type_path ident_map m) | `AliasModuleType (m1, m2) -> @@ -1745,9 +1691,12 @@ module Of_Lang = struct _ -> Odoc_model.Paths.Path.Resolved.Type.t -> Cpath.Resolved.type_ = fun ident_map p -> match p with - | `Identifier i -> identifier Maps.Path.Type.find ident_map.path_types i + | `Identifier i -> ( + match identifier Maps.Path.Type.find ident_map.path_types i with + | `Local l -> `Local l + | `Identifier _ -> `Gpath p) | `CanonicalType (p1, p2) -> - `CanonicalType (resolved_type_path ident_map p1, type_path ident_map p2) + `CanonicalType (resolved_type_path ident_map p1, p2) | `Type (p, name) -> `Type (`Module (resolved_module_path ident_map p), name) | `Class (p, name) -> `Class (`Module (resolved_module_path ident_map p), name) @@ -1760,8 +1709,12 @@ module Of_Lang = struct Cpath.Resolved.class_type = fun ident_map p -> match p with - | `Identifier i -> - identifier Maps.Path.ClassType.find ident_map.path_class_types i + | `Identifier i -> ( + match + identifier Maps.Path.ClassType.find ident_map.path_class_types i + with + | `Local l -> `Local l + | `Identifier _ -> `Gpath p) | `Class (p, name) -> `Class (`Module (resolved_module_path ident_map p), name) | `ClassType (p, name) -> @@ -1894,7 +1847,7 @@ module Of_Lang = struct let open Odoc_model.Lang.TypeDecl in { TypeDecl.doc = docs ident_map ty.doc; - canonical = Opt.map (type_path ident_map) ty.canonical; + canonical = ty.canonical; equation = type_equation ident_map ty.equation; representation = Opt.map (type_decl_representation ident_map) ty.representation; @@ -2029,11 +1982,6 @@ module Of_Lang = struct | Odoc_model.Lang.Include.Alias p -> Include.Alias (module_path ident_map p) | ModuleType s -> ModuleType (u_module_type_expr ident_map s) - and canonical ident_map (canonical : Odoc_model.Paths.Path.Module.t option) = - match canonical with - | Some p -> Some (module_path ident_map p) - | None -> None - and simple_expansion ident_map (f : Odoc_model.Lang.ModuleType.simple_expansion) : ModuleType.simple_expansion = @@ -2061,7 +2009,7 @@ module Of_Lang = struct and module_ ident_map m = let type_ = module_decl ident_map m.Odoc_model.Lang.Module.type_ in - let canonical = canonical ident_map m.Odoc_model.Lang.Module.canonical in + let canonical = m.Odoc_model.Lang.Module.canonical in { Module.doc = docs ident_map m.doc; type_; canonical; hidden = m.hidden } and with_module_type_substitution ident_map m = @@ -2203,11 +2151,7 @@ module Of_Lang = struct let expr = Opt.map (module_type_expr ident_map) m.Odoc_model.Lang.ModuleType.expr in - { - ModuleType.doc = docs ident_map m.doc; - canonical = option module_type_path ident_map m.canonical; - expr; - } + { ModuleType.doc = docs ident_map m.doc; canonical = m.canonical; expr } and value ident_map v = let type_ = type_expression ident_map v.Lang.Value.type_ in diff --git a/src/xref2/component.mli b/src/xref2/component.mli index 8abf82947a..0cf4e8718d 100644 --- a/src/xref2/component.mli +++ b/src/xref2/component.mli @@ -68,7 +68,7 @@ module rec Module : sig type t = { doc : CComment.docs; type_ : decl; - canonical : Cpath.module_ option; + canonical : Odoc_model.Paths.Path.Module.t option; hidden : bool; } end @@ -212,7 +212,7 @@ and ModuleType : sig type t = { doc : CComment.docs; - canonical : Cpath.module_type option; + canonical : Odoc_model.Paths.Path.ModuleType.t option; expr : expr option; } end @@ -258,7 +258,7 @@ and TypeDecl : sig type t = { doc : CComment.docs; - canonical : Cpath.type_ option; + canonical : Odoc_model.Paths.Path.Type.t option; equation : Equation.t; representation : Representation.t option; } @@ -705,9 +705,6 @@ module Of_Lang : sig val include_decl : map -> Odoc_model.Lang.Include.decl -> Include.decl - val canonical : - map -> Odoc_model.Paths.Path.Module.t option -> Cpath.module_ option - val module_ : map -> Odoc_model.Lang.Module.t -> Module.t val with_module_type_substitution : diff --git a/src/xref2/cpath.ml b/src/xref2/cpath.ml index ff844587b7..ec2949917e 100644 --- a/src/xref2/cpath.ml +++ b/src/xref2/cpath.ml @@ -7,31 +7,31 @@ module rec Resolved : sig and module_ = [ `Local of Ident.path_module - | `Identifier of Identifier.Path.Module.t + | `Gpath of Path.Resolved.Module.t | `Substituted of module_ | `Subst of module_type * module_ | `Hidden of module_ | `Module of parent * ModuleName.t - | `Canonical of module_ * Cpath.module_ + | `Canonical of module_ * Path.Module.t | `Apply of module_ * module_ - | `Alias of module_ * module_ + | `Alias of module_ * Cpath.module_ * module_ option | `OpaqueModule of module_ ] and module_type = [ `Local of Ident.module_type | `Substituted of module_type - | `Identifier of Identifier.ModuleType.t + | `Gpath of Path.Resolved.ModuleType.t | `ModuleType of parent * ModuleTypeName.t | `SubstT of module_type * module_type | `AliasModuleType of module_type * module_type - | `CanonicalModuleType of module_type * Cpath.module_type + | `CanonicalModuleType of module_type * Path.ModuleType.t | `OpaqueModuleType of module_type ] and type_ = [ `Local of Ident.path_type - | `Identifier of Odoc_model.Paths.Identifier.Path.Type.t + | `Gpath of Path.Resolved.Type.t | `Substituted of type_ - | `CanonicalType of type_ * Cpath.type_ + | `CanonicalType of type_ * Path.Type.t | `Type of parent * TypeName.t | `Class of parent * ClassName.t | `ClassType of parent * ClassTypeName.t ] @@ -39,7 +39,7 @@ module rec Resolved : sig and class_type = [ `Local of Ident.path_class_type | `Substituted of class_type - | `Identifier of Odoc_model.Paths.Identifier.Path.ClassType.t + | `Gpath of Path.Resolved.ClassType.t | `Class of parent * ClassName.t | `ClassType of parent * ClassTypeName.t ] end = @@ -91,9 +91,9 @@ include Cpath let rec is_resolved_module_substituted : Resolved.module_ -> bool = function | `Local _ -> false | `Substituted _ -> true - | `Identifier _ -> false + | `Gpath _ -> false | `Subst (_a, _) -> false (* is_resolved_module_type_substituted a*) - | `Hidden a | `Canonical (a, _) | `Apply (a, _) | `Alias (a, _) -> + | `Hidden a | `Apply (a, _) | `Alias (a, _, _) | `Canonical (a, _) -> is_resolved_module_substituted a | `Module (a, _) -> is_resolved_parent_substituted a | `OpaqueModule a -> is_resolved_module_substituted a @@ -107,7 +107,7 @@ and is_resolved_module_type_substituted : Resolved.module_type -> bool = function | `Local _ -> false | `Substituted _ -> true - | `Identifier _ -> false + | `Gpath _ -> false | `ModuleType (a, _) -> is_resolved_parent_substituted a | `SubstT _ -> false | `AliasModuleType (m1, _) -> is_resolved_module_type_substituted m1 @@ -117,7 +117,7 @@ and is_resolved_module_type_substituted : Resolved.module_type -> bool = and is_resolved_type_substituted : Resolved.type_ -> bool = function | `Local _ -> false | `Substituted _ -> true - | `Identifier _ -> false + | `Gpath _ -> false | `CanonicalType (t, _) -> is_resolved_type_substituted t | `Type (a, _) | `Class (a, _) | `ClassType (a, _) -> is_resolved_parent_substituted a @@ -125,7 +125,7 @@ and is_resolved_type_substituted : Resolved.type_ -> bool = function and is_resolved_class_type_substituted : Resolved.class_type -> bool = function | `Local _ -> false | `Substituted _ -> true - | `Identifier _ -> false + | `Gpath _ -> false | `Class (a, _) | `ClassType (a, _) -> is_resolved_parent_substituted a let rec is_module_substituted : module_ -> bool = function @@ -186,16 +186,17 @@ and is_resolved_module_hidden : fun ~weak_canonical_test -> let rec inner = function | `Local _ -> false - | `Identifier (`Module (_, t)) when ModuleName.is_internal t -> true - | `Identifier (`Module _) -> false - | `Identifier _ -> false + | `Gpath p -> + Odoc_model.Paths.Path.Resolved.Module.is_hidden ~weak_canonical_test p | `Hidden _ -> true | `Canonical (_, `Resolved _) -> false | `Canonical (p, _) -> (not weak_canonical_test) && inner p | `Substituted p -> inner p | `Module (p, _) -> is_resolved_parent_hidden ~weak_canonical_test p | `Subst (p1, p2) -> is_resolved_module_type_hidden p1 || inner p2 - | `Alias (p1, p2) | `Apply (p1, p2) -> inner p1 || inner p2 + | `Alias (p1, `Resolved p2, _) -> inner p1 && inner p2 + | `Alias (p1, _p2, _) -> inner p1 + | `Apply (p1, p2) -> inner p1 || inner p2 | `OpaqueModule m -> inner m in inner @@ -209,7 +210,8 @@ and is_resolved_parent_hidden : and is_module_type_hidden : module_type -> bool = function | `Resolved r -> is_resolved_module_type_hidden r - | `Identifier (id, b) -> b || is_resolved_module_type_hidden (`Identifier id) + | `Identifier ({ iv = `ModuleType (_, t); _ }, b) -> + b || ModuleTypeName.is_internal t | `Local (_, b) -> b | `Substituted p -> is_module_type_hidden p | `Dot (p, _) -> is_module_hidden p @@ -217,8 +219,9 @@ and is_module_type_hidden : module_type -> bool = function and is_resolved_module_type_hidden : Resolved.module_type -> bool = function | `Local _ -> false - | `Identifier (`ModuleType (_, t)) when ModuleTypeName.is_internal t -> true - | `Identifier (`ModuleType _) -> false + | `Gpath p -> + Odoc_model.Paths.Path.Resolved.ModuleType.is_hidden + ~weak_canonical_test:false p | `Substituted p -> is_resolved_module_type_hidden p | `ModuleType (p, _) -> is_resolved_parent_hidden ~weak_canonical_test:false p | `SubstT (p1, p2) -> @@ -231,8 +234,11 @@ and is_resolved_module_type_hidden : Resolved.module_type -> bool = function and is_type_hidden : type_ -> bool = function | `Resolved r -> is_resolved_type_hidden r - | `Identifier (id, b) -> - b || is_resolved_type_hidden (`Identifier (id :> Identifier.Path.Type.t)) + | `Identifier ({ iv = `Type (_, t); _ }, b) -> b || TypeName.is_internal t + | `Identifier ({ iv = `ClassType (_, t); _ }, b) -> + b || ClassTypeName.is_internal t + | `Identifier ({ iv = `Class (_, t); _ }, b) -> b || ClassName.is_internal t + | `Identifier ({ iv = `CoreType _; _ }, b) -> b | `Local (_, b) -> b | `Substituted p -> is_type_hidden p | `Dot (p, _) -> is_module_hidden p @@ -241,13 +247,7 @@ and is_type_hidden : type_ -> bool = function and is_resolved_type_hidden : Resolved.type_ -> bool = function | `Local _ -> false - | `Identifier (`Type (_, t)) when TypeName.is_internal t -> true - | `Identifier (`ClassType (_, t)) when ClassTypeName.is_internal t -> true - | `Identifier (`Class (_, t)) when ClassName.is_internal t -> true - | `Identifier (`Type (_, _)) -> false - | `Identifier (`ClassType (_, _)) -> false - | `Identifier (`Class (_, _)) -> false - | `Identifier (`CoreType _) -> false + | `Gpath p -> Odoc_model.Paths.Path.Resolved.Type.is_hidden p | `Substituted p -> is_resolved_type_hidden p | `CanonicalType (_, `Resolved _) -> false | `CanonicalType (p, _) -> is_resolved_type_hidden p @@ -256,10 +256,7 @@ and is_resolved_type_hidden : Resolved.type_ -> bool = function and is_resolved_class_type_hidden : Resolved.class_type -> bool = function | `Local _ -> false - | `Identifier (`ClassType (_, t)) when ClassTypeName.is_internal t -> true - | `Identifier (`Class (_, t)) when ClassName.is_internal t -> true - | `Identifier (`ClassType _) -> false - | `Identifier (`Class (_, _)) -> false + | `Gpath p -> Odoc_model.Paths.Path.Resolved.ClassType.is_hidden p | `Substituted p -> is_resolved_class_type_hidden p | `Class (p, _) | `ClassType (p, _) -> is_resolved_parent_hidden ~weak_canonical_test:false p @@ -278,13 +275,14 @@ let rec resolved_module_of_resolved_module_reference : | `Module (parent, name) -> `Module (`Module (resolved_module_of_resolved_signature_reference parent), name) - | `Identifier i -> `Identifier i + | `Identifier x -> `Gpath (`Identifier x) | `Alias (_m1, _m2) -> failwith "gah" | `Hidden s -> `Hidden (resolved_module_of_resolved_module_reference s) and resolved_module_of_resolved_signature_reference : Reference.Resolved.Signature.t -> Resolved.module_ = function - | `Identifier (#Identifier.Module.t as i) -> `Identifier i + | `Identifier ({ iv = #Identifier.Module.t_pv; _ } as i) -> + `Gpath (`Identifier i) | (`Alias _ | `Module _ | `Hidden _) as r' -> resolved_module_of_resolved_module_reference r' | `ModuleType (_, n) -> @@ -296,13 +294,13 @@ and module_of_module_reference : Reference.Module.t -> module_ = function | `Resolved r -> `Resolved (resolved_module_of_resolved_module_reference r) | `Root (_, _) -> failwith "unhandled" | `Dot - ( (( `Resolved (`Identifier #Identifier.Module.t) + ( (( `Resolved (`Identifier { iv = #Identifier.Module.t_pv; _ }) | `Dot (_, _) | `Module (_, _) ) as parent), name ) -> `Dot (module_of_module_reference parent, name) | `Module - ( (( `Resolved (`Identifier #Identifier.Module.t) + ( (( `Resolved (`Identifier { iv = #Identifier.Module.t_pv; _ }) | `Dot (_, _) | `Module (_, _) ) as parent), name ) -> @@ -310,8 +308,15 @@ and module_of_module_reference : Reference.Module.t -> module_ = function | _ -> failwith "Not a module reference" let rec unresolve_resolved_module_path : Resolved.module_ -> module_ = function - | `Hidden (`Identifier x) -> `Identifier (x, true) - | `Identifier x -> `Identifier (x, false) + | `Hidden (`Gpath (`Identifier x)) -> `Identifier (x, true) + | `Gpath (`Identifier x) -> + let hidden = + match x.iv with + | `Module (_, n) -> Odoc_model.Names.ModuleName.is_internal n + | _ -> false + in + `Identifier (x, hidden) + | `Gpath _ as x -> `Resolved x | `Hidden (`Local x) -> `Local (x, true) | `Local x -> `Local (x, false) | `Substituted x -> unresolve_resolved_module_path x @@ -322,12 +327,25 @@ let rec unresolve_resolved_module_path : Resolved.module_ -> module_ = function | `Canonical (m, _) -> unresolve_resolved_module_path m | `Apply (m, a) -> `Apply (unresolve_resolved_module_path m, unresolve_resolved_module_path a) - | `Alias (_, m) -> unresolve_resolved_module_path m + | `Alias (_, `Resolved m, _) -> unresolve_resolved_module_path m + | `Alias (_, m, _) -> m | `OpaqueModule m -> unresolve_resolved_module_path m +and unresolve_module_path : module_ -> module_ = function + | `Resolved x -> unresolve_resolved_module_path x + | `Substituted x -> unresolve_module_path x + | `Local (_, _) as x -> x + | `Identifier _ as x -> x + | `Root _ as x -> x + | `Forward _ as x -> x + | `Dot (p, x) -> `Dot (unresolve_module_path p, x) + | `Module (p, x) -> + `Dot (unresolve_resolved_parent_path p, ModuleName.to_string x) + | `Apply (x, y) -> `Apply (unresolve_module_path x, unresolve_module_path y) + and unresolve_resolved_module_type_path : Resolved.module_type -> module_type = function - | (`Local _ | `Identifier _) as p -> `Resolved p + | (`Local _ | `Gpath _) as p -> `Resolved p | `Substituted x -> unresolve_resolved_module_type_path x | `ModuleType (p, n) -> `Dot (unresolve_resolved_parent_path p, ModuleTypeName.to_string n) @@ -341,7 +359,7 @@ and unresolve_resolved_parent_path : Resolved.parent -> module_ = function | `FragmentRoot | `ModuleType _ -> assert false and unresolve_resolved_type_path : Resolved.type_ -> type_ = function - | (`Identifier _ | `Local _) as p -> `Resolved p + | (`Gpath _ | `Local _) as p -> `Resolved p | `Substituted x -> unresolve_resolved_type_path x | `CanonicalType (t1, _) -> unresolve_resolved_type_path t1 | `Type (p, n) -> `Dot (unresolve_resolved_parent_path p, TypeName.to_string n) @@ -352,17 +370,13 @@ and unresolve_resolved_type_path : Resolved.type_ -> type_ = function and unresolve_resolved_class_type_path : Resolved.class_type -> class_type = function - | (`Local _ | `Identifier _) as p -> `Resolved p + | (`Local _ | `Gpath _) as p -> `Resolved p | `Substituted x -> unresolve_resolved_class_type_path x | `Class (p, n) -> `Dot (unresolve_resolved_parent_path p, ClassName.to_string n) | `ClassType (p, n) -> `Dot (unresolve_resolved_parent_path p, ClassTypeName.to_string n) -and unresolve_module_path : module_ -> module_ = function - | `Resolved m -> unresolve_resolved_module_path m - | y -> y - and unresolve_module_type_path : module_type -> module_type = function | `Resolved m -> unresolve_resolved_module_type_path m | y -> y diff --git a/src/xref2/dune b/src/xref2/dune index 968d4d5583..9abad17f33 100644 --- a/src/xref2/dune +++ b/src/xref2/dune @@ -1,8 +1,6 @@ (library (name odoc_xref2) (public_name odoc.xref2) - (instrumentation - (backend bisect_ppx)) (libraries compiler-libs.common odoc_model unix)) (rule diff --git a/src/xref2/env.ml b/src/xref2/env.ml index ab7e37721a..03122c0e0f 100644 --- a/src/xref2/env.ml +++ b/src/xref2/env.ml @@ -124,9 +124,11 @@ module ElementsById : sig val empty : t - val add : [< Identifier.t ] -> [< Component.Element.any ] -> t -> t + val add : + [< Identifier.t_pv ] Paths.id -> [< Component.Element.any ] -> t -> t - val find_by_id : [< Identifier.t ] -> t -> Component.Element.any option + val find_by_id : + [< Identifier.t_pv ] Paths.id -> t -> Component.Element.any option end = struct module IdMap = Identifier.Maps.Any @@ -159,6 +161,8 @@ type t = { fragmentroot : (int * Component.Signature.t) option; } +let is_linking env = env.linking + let set_resolver t resolver = { t with resolver = Some resolver } let has_resolver t = match t.resolver with None -> false | _ -> true @@ -269,7 +273,9 @@ let add_cdocs p (docs : Component.CComment.docs) env = match element.Odoc_model.Location_.value with | `Heading h -> let (`LLabel (name, _)) = h.Component.Label.label in - let label = `Label (Paths.Identifier.label_parent p, name) in + let label = + Paths.Identifier.Mk.label (Paths.Identifier.label_parent p, name) + in add_label label h env | _ -> env) env docs @@ -283,12 +289,13 @@ let add_type identifier t env = let open_typedecl cs = let add_cons env (cons : TypeDecl.Constructor.t) = let ident = - `Constructor (identifier, ConstructorName.make_std cons.name) + Paths.Identifier.Mk.constructor + (identifier, ConstructorName.make_std cons.name) in add_to_elts Kind_Constructor ident (`Constructor (ident, cons)) env and add_field env (field : TypeDecl.Field.t) = let ident = - `Field + Paths.Identifier.Mk.field ( (identifier :> Odoc_model.Paths.Identifier.Parent.t), FieldName.make_std field.name ) in @@ -384,7 +391,7 @@ let lookup_root_module name env = | Forward_reference -> Some Forward | Not_found -> None | Found u -> - let (`Root _ as id) = u.id in + let ({ Odoc_model.Paths.iv = `Root _; _ } as id) = u.id in let m = module_of_unit u in Some (Resolved (u.root, id, m))) in @@ -466,7 +473,8 @@ let lookup_by_id (scope : 'a scope) id env : 'a option = | None -> ( (* Format.eprintf "Can't find %a\n%!" Component.Fmt.model_identifier (id :> Identifier.t); *) match (id :> Identifier.t) with - | `Root (_, name) -> scope.root (ModuleName.to_string name) env + | { iv = `Root (_, name); _ } -> + scope.root (ModuleName.to_string name) env | _ -> None) let lookup_root_module_fallback name t = @@ -609,7 +617,7 @@ let add_functor_args' : match mty with | ModuleType.Functor (Named arg, res) -> ( arg.Component.FunctorParameter.id, - `Parameter + Paths.Identifier.Mk.parameter ( parent, Ident.Name.typed_functor_parameter arg.Component.FunctorParameter.id ), @@ -619,8 +627,9 @@ let add_functor_args' : canonical = None; hidden = false; } ) - :: find_args (`Result parent) res - | ModuleType.Functor (Unit, res) -> find_args (`Result parent) res + :: find_args (Paths.Identifier.Mk.result parent) res + | ModuleType.Functor (Unit, res) -> + find_args (Paths.Identifier.Mk.result parent) res | _ -> [] in (* We substituted back the parameters as identifiers to maintain the invariant that @@ -632,11 +641,10 @@ let add_functor_args' : in let doc = m.Component.Module.doc in let m = Component.Delayed.put_val (Subst.module_ subst m) in + let rp = `Gpath (`Identifier identifier) in + let p = `Resolved rp in let env' = add_module identifier m doc env in - ( env', - Subst.add_module ident - (`Resolved (`Identifier identifier)) - (`Identifier identifier) subst ) + (env', Subst.add_module ident p rp subst) in let env', _subst = List.fold_left fold_fn (env, Subst.identity) (find_args id expr) diff --git a/src/xref2/env.mli b/src/xref2/env.mli index cfd1fd3a6b..dfc3adc59f 100644 --- a/src/xref2/env.mli +++ b/src/xref2/env.mli @@ -32,6 +32,8 @@ val pp_lookup_type_list : Format.formatter -> lookup_type list -> unit type t +val is_linking : t -> bool + val with_recorded_lookups : t -> (t -> 'a) -> LookupTypeSet.t * 'a val set_resolver : t -> resolver -> t @@ -100,7 +102,8 @@ val lookup_by_name : 'a scope -> string -> t -> 'a maybe_ambiguous [Error (`Ambiguous _)] when two or more elements match the given scope and name. *) -val lookup_by_id : 'a scope -> [< Identifier.t ] -> t -> 'a option +val lookup_by_id : + 'a scope -> [< Identifier.t_pv ] Odoc_model.Paths.id -> t -> 'a option (** Like [lookup_by_name] but use an identifier as key. *) val s_any : Component.Element.any scope diff --git a/src/xref2/errors.ml b/src/xref2/errors.ml index 6568ad072e..38bffe2421 100644 --- a/src/xref2/errors.ml +++ b/src/xref2/errors.ml @@ -242,7 +242,7 @@ let rec kind_of_error : Tools_error.any -> kind option = function match kind_of_module_type_cpath cp with | None -> kind_of_error (e :> Tools_error.any) | x -> x) - | `Lookup_failure (`Root (_, name)) -> + | `Lookup_failure { iv = `Root (_, name); _ } -> Some (`Root (Names.ModuleName.to_string name)) | `UnexpandedTypeOf type_of_desc -> kind_of_type_of_desc type_of_desc | `Lookup_failure_root name -> Some (`Root name) @@ -266,7 +266,7 @@ let kind_of_error ~what = function | None -> ( match what with | `Include (Component.Include.Alias cp) -> kind_of_module_cpath cp - | `Module (`Root (_, name)) -> + | `Module { Odoc_model.Paths.iv = `Root (_, name); _ } -> Some (`Root (Names.ModuleName.to_string name)) | _ -> None) diff --git a/src/xref2/expand_tools.ml b/src/xref2/expand_tools.ml index c02ce3392d..7002821824 100644 --- a/src/xref2/expand_tools.ml +++ b/src/xref2/expand_tools.ml @@ -154,7 +154,7 @@ and handle_expansion env id expansion = | Component.FunctorParameter.Unit -> (env, expr) | Named arg -> let identifier = - `Parameter + Paths.Identifier.Mk.parameter ( parent, Ident.Name.typed_functor_parameter arg.Component.FunctorParameter.id ) @@ -163,11 +163,10 @@ and handle_expansion env id expansion = let env' = Env.add_module identifier (Component.Delayed.put_val m) m.doc env in + let rp = `Gpath (`Identifier identifier) in + let p = `Resolved rp in let subst = - Subst.add_module - (arg.id :> Ident.path_module) - (`Resolved (`Identifier identifier)) - (`Identifier identifier) Subst.identity + Subst.add_module (arg.id :> Ident.path_module) p rp Subst.identity in let subst = Subst.mto_invalidate_module (arg.id :> Ident.path_module) subst @@ -185,7 +184,7 @@ and handle_expansion env id expansion = | Functor (arg, expr) -> let env', expr' = handle_argument id arg expr env in aux_expansion_of_module_type_expr env' expr' >>= fun res -> - expand (`Result id) env res >>= fun (env, res) -> + expand (Paths.Identifier.Mk.result id) env res >>= fun (env, res) -> Ok ( env, (Component.ModuleType.Functor (arg, res) diff --git a/src/xref2/ident.ml b/src/xref2/ident.ml index 3f12e7e5e4..25ba4e93ac 100644 --- a/src/xref2/ident.ml +++ b/src/xref2/ident.ml @@ -14,7 +14,7 @@ type signature = type class_signature = [ `LClass of ClassName.t * int | `LClassType of ClassTypeName.t * int ] -type datatype = [ `LType of TypeName.t * int | `LCoreType of TypeName.t ] +type datatype = [ `LType of TypeName.t * int ] type parent = [ signature | datatype | class_signature ] @@ -37,8 +37,7 @@ type field = [ `LField of FieldName.t * int ] type extension = [ `LExtension of ExtensionName.t * int ] -type exception_ = - [ `LException of ExceptionName.t * int | `LCoreException of ExceptionName.t ] +type exception_ = [ `LException of ExceptionName.t * int ] type value = [ `LValue of ValueName.t * int ] @@ -104,7 +103,6 @@ let int_of_any : any -> int = function | `LLeafPage (_, i) | `LExtension (_, i) -> i - | `LCoreException _ | `LCoreType _ -> failwith "error" module Of_Identifier = struct open Identifier @@ -112,7 +110,7 @@ module Of_Identifier = struct let rec signature : Signature.t -> signature = fun sg -> let i = fresh_int () in - match sg with + match sg.iv with | `Root (_, n) -> `LRoot (n, i) | `Module (_, n) -> `LModule (n, i) | `Parameter (_, n) -> `LParameter (n, i) @@ -122,42 +120,44 @@ module Of_Identifier = struct let class_signature : ClassSignature.t -> class_signature = fun sg -> let i = fresh_int () in - match sg with + match sg.iv with | `Class (_, n) -> `LClass (n, i) | `ClassType (_, n) -> `LClassType (n, i) let datatype : DataType.t -> datatype = fun t -> let i = fresh_int () in - match t with `Type (_, n) -> `LType (n, i) | `CoreType n -> `LCoreType n + match t.iv with + | `Type (_, n) -> `LType (n, i) + | `CoreType _n -> failwith "Bad" let parent : Parent.t -> parent = fun p -> match p with - | #Signature.t as s -> (signature s :> parent) - | #DataType.t as s -> (datatype s :> parent) - | #ClassSignature.t as s -> (class_signature s :> parent) + | { iv = #Signature.t_pv; _ } as s -> (signature s :> parent) + | { iv = #DataType.t_pv; _ } as s -> (datatype s :> parent) + | { iv = #ClassSignature.t_pv; _ } as s -> (class_signature s :> parent) let label_parent : LabelParent.t -> label_parent = fun p -> match p with - | #Parent.t as s -> (parent s :> label_parent) - | `Page (_, n) -> `LPage (n, fresh_int ()) - | `LeafPage (_, n) -> `LLeafPage (n, fresh_int ()) + | { iv = #Parent.t_pv; _ } as s -> (parent s :> label_parent) + | { iv = `Page (_, n); _ } -> `LPage (n, fresh_int ()) + | { iv = `LeafPage (_, n); _ } -> `LLeafPage (n, fresh_int ()) let module_ : Odoc_model.Paths.Identifier.Module.t -> module_ = - fun (`Module (_, n) | `Root (_, n)) -> + fun { iv = `Module (_, n) | `Root (_, n); _ } -> let i = fresh_int () in `LModule (n, i) let functor_parameter : Odoc_model.Paths.Identifier.FunctorParameter.t -> functor_parameter = - fun (`Parameter (_, n)) -> `LParameter (n, fresh_int ()) + fun { iv = `Parameter (_, n); _ } -> `LParameter (n, fresh_int ()) let path_module : Path.Module.t -> path_module = fun m -> let i = fresh_int () in - match m with + match m.iv with | `Root (_, n) -> `LRoot (n, i) | `Module (_, n) -> `LModule (n, i) | `Parameter (_, n) -> `LParameter (n, i) @@ -166,48 +166,49 @@ module Of_Identifier = struct let module_type : ModuleType.t -> module_type = fun m -> let i = fresh_int () in - match m with `ModuleType (_, n) -> `LModuleType (n, i) + match m.iv with `ModuleType (_, n) -> `LModuleType (n, i) let type_ : Type.t -> type_ = datatype let constructor : Constructor.t -> constructor = - fun c -> match c with `Constructor (_, n) -> `LConstructor (n, fresh_int ()) + fun c -> + match c.iv with `Constructor (_, n) -> `LConstructor (n, fresh_int ()) let field : Field.t -> field = - fun f -> match f with `Field (_, n) -> `LField (n, fresh_int ()) + fun f -> match f.iv with `Field (_, n) -> `LField (n, fresh_int ()) let extension : Extension.t -> extension = - fun e -> match e with `Extension (_, n) -> `LExtension (n, fresh_int ()) + fun e -> match e.iv with `Extension (_, n) -> `LExtension (n, fresh_int ()) let exception_ : Exception.t -> exception_ = fun e -> - match e with + match e.iv with | `Exception (_, n) -> `LException (n, fresh_int ()) - | `CoreException n -> `LCoreException n + | `CoreException _ -> failwith "Bad" let value : Value.t -> value = - fun v -> match v with `Value (_, n) -> `LValue (n, fresh_int ()) + fun v -> match v.iv with `Value (_, n) -> `LValue (n, fresh_int ()) let class_ : Class.t -> class_ = - fun c -> match c with `Class (_, n) -> `LClass (n, fresh_int ()) + fun c -> match c.iv with `Class (_, n) -> `LClass (n, fresh_int ()) let class_type : ClassType.t -> class_type = - fun c -> match c with `ClassType (_, n) -> `LClassType (n, fresh_int ()) + fun c -> match c.iv with `ClassType (_, n) -> `LClassType (n, fresh_int ()) let method_ : Method.t -> method_ = - fun c -> match c with `Method (_, n) -> `LMethod (n, fresh_int ()) + fun c -> match c.iv with `Method (_, n) -> `LMethod (n, fresh_int ()) let instance_variable : InstanceVariable.t -> instance_variable = fun i -> - match i with + match i.iv with | `InstanceVariable (_, n) -> `LInstanceVariable (n, fresh_int ()) let label : Label.t -> label = - fun l -> match l with `Label (_, n) -> `LLabel (n, fresh_int ()) + fun l -> match l.iv with `Label (_, n) -> `LLabel (n, fresh_int ()) let page : Page.t -> page = fun p -> - match p with + match p.iv with | `Page (_, n) -> `LPage (n, fresh_int ()) | `LeafPage (_, n) -> `LLeafPage (n, fresh_int ()) end @@ -242,25 +243,19 @@ module Name = struct let functor_parameter : functor_parameter -> string = fun (`LParameter (n, _)) -> ParameterName.to_string n - let type' : type_ -> TypeName.t = function - | `LType (n, _) -> n - | `LCoreType n -> n + let type' : type_ -> TypeName.t = function `LType (n, _) -> n let type_ t = TypeName.to_string (type' t) let unsafe_type : type_ -> string = function | `LType (n, _) -> TypeName.to_string_unsafe n - | `LCoreType n -> TypeName.to_string n - let typed_type : type_ -> TypeName.t = function - | `LType (n, _) -> n - | _ -> failwith "Bad type ident" + let typed_type : type_ -> TypeName.t = function `LType (n, _) -> n let path_type : path_type -> string = function | `LClassType (n, _) -> ClassTypeName.to_string n | `LClass (n, _) -> ClassName.to_string n | `LType (n, _) -> TypeName.to_string n - | `LCoreType n -> TypeName.to_string n let class' : class_ -> ClassName.t = function `LClass (n, _) -> n @@ -294,10 +289,10 @@ module Name = struct | `LClassType (n, _) -> n let exception_ : exception_ -> string = function - | `LCoreException n | `LException (n, _) -> ExceptionName.to_string n + | `LException (n, _) -> ExceptionName.to_string n let typed_exception : exception_ -> ExceptionName.t = function - | `LCoreException n | `LException (n, _) -> n + | `LException (n, _) -> n let value : value -> string = function | `LValue (n, _) -> ValueName.to_string n @@ -345,11 +340,9 @@ module Rename = struct let type_ : type_ -> type_ = function | `LType (n, _) -> `LType (n, fresh_int ()) - | `LCoreType _ as y -> y let exception_ : exception_ -> exception_ = function | `LException (n, _) -> `LException (n, fresh_int ()) - | `LCoreException _ as y -> y let value : value -> value = function | `LValue (n, _) -> `LValue (n, fresh_int ()) @@ -398,7 +391,6 @@ let rec fmt_aux ppf (id : any) = | `LModuleType (n, i) -> Format.fprintf ppf "%s/%d" (ModuleTypeName.to_string n) i | `LType (n, i) -> Format.fprintf ppf "%s/%d" (TypeName.to_string n) i - | `LCoreType n -> Format.fprintf ppf "%s" (TypeName.to_string n) | `LConstructor (n, i) -> Format.fprintf ppf "%s/%d" (ConstructorName.to_string n) i | `LField (n, i) -> Format.fprintf ppf "%s/%d" (FieldName.to_string n) i @@ -406,7 +398,6 @@ let rec fmt_aux ppf (id : any) = Format.fprintf ppf "%s/%d" (ExtensionName.to_string n) i | `LException (n, i) -> Format.fprintf ppf "%s/%d" (ExceptionName.to_string n) i - | `LCoreException n -> Format.fprintf ppf "%s" (ExceptionName.to_string n) | `LValue (n, i) -> Format.fprintf ppf "%s/%d" (ValueName.to_string n) i | `LClass (n, i) -> Format.fprintf ppf "%s/%d" (ClassName.to_string n) i | `LClassType (n, i) -> diff --git a/src/xref2/lang_of.ml b/src/xref2/lang_of.ml index f383f336d7..f4c31f6cb4 100644 --- a/src/xref2/lang_of.ml +++ b/src/xref2/lang_of.ml @@ -2,13 +2,15 @@ open Odoc_model open Paths open Names -module RM = Map.Make (struct +module RM = Hashtbl.Make (struct type t = Cpath.Resolved.module_ - let compare x y = if x == y then 0 else compare x y + let equal x y = x = y + + let hash x = Hashtbl.hash x end) -type memos = { mutable rmodpathmemo : Path.Resolved.Module.t RM.t } +type memos = { rmodpathmemo : Path.Resolved.Module.t RM.t } type maps = { module_ : Identifier.Module.t Component.ModuleMap.t; @@ -38,7 +40,7 @@ let empty_shadow = } let empty () = - let memos = { rmodpathmemo = RM.empty } in + let memos = { rmodpathmemo = RM.create 255 } in { module_ = Component.ModuleMap.empty; module_type = Component.ModuleTypeMap.empty; @@ -72,11 +74,19 @@ module Path = struct match p with | `Substituted x -> module_ map x | `Local (id, b) -> - `Identifier - ( (try lookup_module map id - with Not_found -> - failwith (Format.asprintf "Not_found: %a" Ident.fmt id)), - b ) + let m = + try lookup_module map id + with Not_found -> + failwith (Format.asprintf "Not_found: %a" Ident.fmt id) + in + let hidden = + b + || + match m.iv with + | `Module (_, n) -> Odoc_model.Names.ModuleName.is_internal n + | _ -> false + in + `Identifier (m, hidden) | `Identifier (i, b) -> `Identifier (i, b) | `Resolved x -> `Resolved (resolved_module map x) | `Root x -> `Root x @@ -91,7 +101,8 @@ module Path = struct Odoc_model.Paths.Path.ModuleType.t = match p with | `Substituted x -> module_type map x - | `Identifier ((#Odoc_model.Paths.Identifier.ModuleType.t as y), b) -> + | `Identifier + (({ iv = #Odoc_model.Paths.Identifier.ModuleType.t_pv; _ } as y), b) -> `Identifier (y, b) | `Local (id, b) -> `Identifier @@ -108,7 +119,8 @@ module Path = struct and type_ map (p : Cpath.type_) : Odoc_model.Paths.Path.Type.t = match p with | `Substituted x -> type_ map x - | `Identifier ((#Odoc_model.Paths.Identifier.Path.Type.t as y), b) -> + | `Identifier + (({ iv = #Odoc_model.Paths.Identifier.Path.Type.t_pv; _ } as y), b) -> `Identifier (y, b) | `Local (id, b) -> `Identifier (Component.PathTypeMap.find id map.path_type, b) @@ -126,7 +138,9 @@ module Path = struct = match p with | `Substituted x -> class_type map x - | `Identifier ((#Odoc_model.Paths.Identifier.Path.ClassType.t as y), b) -> + | `Identifier + (({ iv = #Odoc_model.Paths.Identifier.Path.ClassType.t_pv; _ } as y), b) + -> `Identifier (y, b) | `Local (id, b) -> `Identifier (Component.PathClassTypeMap.find id map.path_class_type, b) @@ -148,24 +162,23 @@ module Path = struct with Not_found -> failwith (Format.asprintf "Not_found: %a" Ident.fmt id)) | `Substituted x -> resolved_module map x - | `Identifier y -> `Identifier y + | `Gpath y -> y | `Subst (mty, m) -> `Subst (resolved_module_type map mty, resolved_module map m) | `Hidden h -> `Hidden (resolved_module map h) | `Module (p, n) -> `Module (resolved_parent map p, n) - | `Canonical (r, m) -> `Canonical (resolved_module map r, module_ map m) + | `Canonical (r, m) -> `Canonical (resolved_module map r, m) | `Apply (m1, m2) -> `Apply (resolved_module map m1, resolved_module map m2) - | `Alias (m1, m2) -> - `Alias (resolved_module map m1, resolved_module map m2) + | `Alias (m1, m2, _) -> `Alias (resolved_module map m1, module_ map m2) | `OpaqueModule m -> `OpaqueModule (resolved_module map m) in try - let result = RM.find p map.memos.rmodpathmemo in + let result = RM.find map.memos.rmodpathmemo p in result with Not_found -> let result = f () in - map.memos.rmodpathmemo <- RM.add p result map.memos.rmodpathmemo; + RM.add map.memos.rmodpathmemo p result; result and resolved_parent map (p : Cpath.Resolved.parent) = @@ -180,8 +193,7 @@ module Path = struct and resolved_module_type map (p : Cpath.Resolved.module_type) : Odoc_model.Paths.Path.Resolved.ModuleType.t = match p with - | `Identifier (#Odoc_model.Paths.Identifier.ModuleType.t as y) -> - `Identifier y + | `Gpath y -> y | `Local id -> `Identifier (try Component.ModuleTypeMap.find id map.module_type @@ -195,17 +207,15 @@ module Path = struct `AliasModuleType (resolved_module_type map p1, resolved_module_type map p2) | `CanonicalModuleType (p1, p2) -> - `CanonicalModuleType (resolved_module_type map p1, module_type map p2) + `CanonicalModuleType (resolved_module_type map p1, p2) | `OpaqueModuleType m -> `OpaqueModuleType (resolved_module_type map m) and resolved_type map (p : Cpath.Resolved.type_) : Odoc_model.Paths.Path.Resolved.Type.t = match p with - | `Identifier (#Odoc_model.Paths.Identifier.Path.Type.t as y) -> - `Identifier y + | `Gpath y -> y | `Local id -> `Identifier (Component.PathTypeMap.find id map.path_type) - | `CanonicalType (t1, t2) -> - `CanonicalType (resolved_type map t1, type_ map t2) + | `CanonicalType (t1, t2) -> `CanonicalType (resolved_type map t1, t2) | `Type (p, name) -> `Type (resolved_parent map p, name) | `Class (p, name) -> `Class (resolved_parent map p, name) | `ClassType (p, name) -> `ClassType (resolved_parent map p, name) @@ -214,8 +224,7 @@ module Path = struct and resolved_class_type map (p : Cpath.Resolved.class_type) : Odoc_model.Paths.Path.Resolved.ClassType.t = match p with - | `Identifier (#Odoc_model.Paths.Identifier.Path.ClassType.t as y) -> - `Identifier y + | `Gpath y -> y | `Local id -> `Identifier (Component.PathClassTypeMap.find id map.path_class_type) | `Class (p, name) -> `Class (resolved_parent map p, name) @@ -297,11 +306,12 @@ module ExtractIDs = struct let rec type_decl parent map id = let name = Ident.Name.unsafe_type id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_types then - `Type (parent, Odoc_model.Names.TypeName.internal_of_string name) - else `Type (parent, Ident.Name.typed_type id) + Odoc_model.Names.TypeName.internal_of_string name + else Ident.Name.typed_type id in + let identifier = Identifier.Mk.type_ (parent, typed_name) in { map with type_ = Component.TypeMap.add id identifier map.type_; @@ -314,20 +324,22 @@ module ExtractIDs = struct and module_ parent map id = let name = Ident.Name.unsafe_module id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_modules then - `Module (parent, ModuleName.internal_of_string name) - else `Module (parent, Ident.Name.typed_module id) + ModuleName.internal_of_string name + else Ident.Name.typed_module id in + let identifier = Identifier.Mk.module_ (parent, typed_name) in { map with module_ = Component.ModuleMap.add id identifier map.module_ } and module_type parent map id = let name = Ident.Name.unsafe_module_type id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_module_types then - `ModuleType (parent, ModuleTypeName.internal_of_string name) - else `ModuleType (parent, Ident.Name.typed_module_type id) + ModuleTypeName.internal_of_string name + else Ident.Name.typed_module_type id in + let identifier = Identifier.Mk.module_type (parent, typed_name) in { map with module_type = Component.ModuleTypeMap.add id identifier map.module_type; @@ -335,11 +347,12 @@ module ExtractIDs = struct and class_ parent map id = let name = Ident.Name.unsafe_class id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_classes then - `Class (parent, ClassName.internal_of_string name) - else `Class (parent, Ident.Name.typed_class id) + ClassName.internal_of_string name + else Ident.Name.typed_class id in + let identifier = Identifier.Mk.class_ (parent, typed_name) in { map with class_ = (id, identifier) :: map.class_; @@ -357,11 +370,12 @@ module ExtractIDs = struct and class_type parent map (id : Ident.class_type) = let name = Ident.Name.unsafe_class_type id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_class_types then - `ClassType (parent, ClassTypeName.internal_of_string name) - else `ClassType (parent, Ident.Name.typed_class_type id) + ClassTypeName.internal_of_string name + else Ident.Name.typed_class_type id in + let identifier = Identifier.Mk.class_type (parent, typed_name) in { map with class_type = ((id :> Ident.class_type), identifier) :: map.class_type; @@ -554,7 +568,7 @@ and class_signature map parent sg = and method_ map parent id m = let open Component.Method in - let identifier = `Method (parent, Ident.Name.typed_method id) in + let identifier = Identifier.Mk.method_ (parent, Ident.Name.typed_method id) in { id = identifier; doc = docs (parent :> Identifier.LabelParent.t) m.doc; @@ -566,7 +580,8 @@ and method_ map parent id m = and instance_variable map parent id i = let open Component.InstanceVariable in let identifier = - `InstanceVariable (parent, Ident.Name.typed_instance_variable id) + Identifier.Mk.instance_variable + (parent, Ident.Name.typed_instance_variable id) in { id = identifier; @@ -586,9 +601,9 @@ and simple_expansion : match e with | Signature sg -> Signature (signature id map sg) | Functor (Named arg, sg) -> - let identifier = `Result id in + let identifier = Identifier.Mk.result id in let name = Ident.Name.typed_functor_parameter arg.id in - let param_identifier = `Parameter (id, name) in + let param_identifier = Identifier.Mk.parameter (id, name) in let map = { map with @@ -598,7 +613,8 @@ and simple_expansion : in let arg = functor_parameter map arg in Functor (Named arg, simple_expansion map identifier sg) - | Functor (Unit, sg) -> Functor (Unit, simple_expansion map (`Result id) sg) + | Functor (Unit, sg) -> + Functor (Unit, simple_expansion map (Identifier.Mk.result id) sg) and combine_shadowed s1 s2 = let open Odoc_model.Lang.Include in @@ -648,11 +664,12 @@ and open_ parent map o = and value_ map parent id v = let open Component.Value in let name = Ident.Name.value id in - let identifier = + let typed_name = if List.mem name map.shadowed.s_values then - `Value (parent, ValueName.internal_of_string name) - else `Value (parent, Ident.Name.typed_value id) + ValueName.internal_of_string name + else Ident.Name.typed_value id in + let identifier = Identifier.Mk.value (parent, typed_name) in { id = identifier; doc = docs (parent :> Identifier.LabelParent.t) v.doc; @@ -673,7 +690,9 @@ and typ_ext map parent t = and extension_constructor map parent c = let open Component.Extension.Constructor in - let identifier = `Extension (parent, ExtensionName.make_std c.name) in + let identifier = + Identifier.Mk.extension (parent, ExtensionName.make_std c.name) + in { id = identifier; doc = docs (parent :> Identifier.LabelParent.t) c.doc; @@ -689,16 +708,12 @@ and module_ map parent id m = (Component.ModuleMap.find id map.module_ :> Paths.Identifier.Module.t) in let identifier = (id :> Odoc_model.Paths.Identifier.Signature.t) in - let canonical = function - | Some p -> Some (Path.module_ map p) - | None -> None - in let map = { map with shadowed = empty_shadow } in { Odoc_model.Lang.Module.id; doc = docs (parent :> Identifier.LabelParent.t) m.doc; type_ = module_decl map identifier m.type_; - canonical = canonical m.canonical; + canonical = m.canonical; hidden = m.hidden; } with e -> @@ -796,7 +811,7 @@ and module_type_expr map identifier = function } | Functor (Named arg, expr) -> let name = Ident.Name.typed_functor_parameter arg.id in - let identifier' = `Parameter (identifier, name) in + let identifier' = Identifier.Mk.parameter (identifier, name) in let map = { map with @@ -805,9 +820,9 @@ and module_type_expr map identifier = function in Functor ( Named (functor_parameter map arg), - module_type_expr map (`Result identifier) expr ) + module_type_expr map (Identifier.Mk.result identifier) expr ) | Functor (Unit, expr) -> - Functor (Unit, module_type_expr map (`Result identifier) expr) + Functor (Unit, module_type_expr map (Identifier.Mk.result identifier) expr) | TypeOf { t_desc = ModPath p; t_expansion } -> TypeOf { @@ -835,7 +850,7 @@ and module_type : { Odoc_model.Lang.ModuleType.id = identifier; doc = docs (parent :> Identifier.LabelParent.t) mty.doc; - canonical = Opt.map (Path.module_type map) mty.canonical; + canonical = mty.canonical; expr = Opt.map (module_type_expr map sig_id) mty.expr; } @@ -871,7 +886,7 @@ and type_decl_field : Component.TypeDecl.Field.t -> Odoc_model.Lang.TypeDecl.Field.t = fun map parent f -> - let identifier = `Field (parent, FieldName.make_std f.name) in + let identifier = Identifier.Mk.field (parent, FieldName.make_std f.name) in { id = identifier; doc = docs (parent :> Identifier.LabelParent.t) f.doc; @@ -899,7 +914,7 @@ and type_decl map parent id (t : Component.TypeDecl.t) : id = identifier; equation = type_decl_equation map (parent :> Identifier.Parent.t) t.equation; doc = docs (parent :> Identifier.LabelParent.t) t.doc; - canonical = Opt.map (Path.type_ map) t.canonical; + canonical = t.canonical; representation = Opt.map (type_decl_representation map identifier) t.representation; } @@ -921,7 +936,9 @@ and type_decl_constructor : Component.TypeDecl.Constructor.t -> Odoc_model.Lang.TypeDecl.Constructor.t = fun map id t -> - let identifier = `Constructor (id, ConstructorName.make_std t.name) in + let identifier = + Identifier.Mk.constructor (id, ConstructorName.make_std t.name) + in { id = identifier; doc = docs (id :> Identifier.LabelParent.t) t.doc; @@ -1012,7 +1029,9 @@ and functor_parameter map f : Odoc_model.Lang.FunctorParameter.parameter = and exception_ map parent id (e : Component.Exception.t) : Odoc_model.Lang.Exception.t = - let identifier = `Exception (parent, Ident.Name.typed_exception id) in + let identifier = + Identifier.Mk.exception_ (parent, Ident.Name.typed_exception id) + in { id = identifier; doc = docs (parent :> Identifier.LabelParent.t) e.doc; @@ -1029,7 +1048,7 @@ and block_element parent | `Heading h -> let { Component.Label.attrs; label; text; location = _ } = h in let label = - try `Label (parent, Ident.Name.typed_label label) + try Identifier.Mk.label (parent, Ident.Name.typed_label label) with Not_found -> Format.fprintf Format.err_formatter "Failed to find id: %a\n" Ident.fmt label; diff --git a/src/xref2/link.ml b/src/xref2/link.ml index fa513a17a5..1e09fcfb50 100644 --- a/src/xref2/link.ml +++ b/src/xref2/link.ml @@ -36,7 +36,8 @@ let ambiguous_label_warning label_name labels = (** Raise a warning when a label explicitly set by the user collides. This warning triggers even if one of the colliding labels have been automatically generated. *) -let check_ambiguous_label ~loc env (attrs, (`Label (_, label_name) as id), _) = +let check_ambiguous_label ~loc env + (attrs, ({ Odoc_model.Paths.iv = `Label (_, label_name); _ } as id), _) = if attrs.Comment.heading_label_explicit then (* Looking for an identical identifier but a different location. *) let conflicting (`Label (id', comp)) = @@ -78,7 +79,8 @@ let rec should_reresolve : Paths.Path.Resolved.t -> bool = | `Apply (x, y) -> should_reresolve (x :> t) || should_reresolve (y :> Paths.Path.Resolved.t) | `SubstT (x, y) -> should_reresolve (x :> t) || should_reresolve (y :> t) - | `Alias (x, y) -> should_reresolve (x :> t) || should_reresolve (y :> t) + | `Alias (y, x) -> + should_resolve (x :> Paths.Path.t) || should_reresolve (y :> t) | `AliasModuleType (x, y) -> should_reresolve (x :> t) || should_reresolve (y :> t) | `Type (p, _) @@ -181,7 +183,7 @@ let rec comment_inline_element : (* In case of labels, use the heading text as reference text if it's not specified. *) match (content, x) with - | [], `Identifier (#Id.Label.t as i) -> ( + | [], `Identifier ({ iv = #Id.Label.t_pv; _ } as i) -> ( match Env.lookup_by_id Env.s_label i env with | Some (`Label (_, lbl)) -> lbl.Component.Label.text | None -> []) @@ -429,11 +431,11 @@ and module_ : Env.t -> Module.t -> Module.t = match type_ with | Alias (`Resolved p, _) -> let hidden_alias = - Paths.Path.is_hidden (`Resolved (p :> Paths.Path.Resolved.t)) + Paths.Path.Resolved.Module.is_hidden ~weak_canonical_test:false p in let self_canonical = - let i = Paths.Path.Resolved.Module.identifier p in - i = (m.id :> Paths.Identifier.Path.Module.t) + let i = Paths.Path.Resolved.(identifier (p :> t)) in + i = (m.id :> Paths.Identifier.t) in let expansion_needed = self_canonical || hidden_alias in if expansion_needed then @@ -676,11 +678,12 @@ and module_type_expr : Some (simple_expansion env (id :> Paths.Identifier.Signature.t) e) | None, Some (`Resolved p_path) -> let hidden_alias = - Paths.Path.is_hidden (`Resolved (p_path :> Paths.Path.Resolved.t)) + Paths.Path.Resolved.ModuleType.is_hidden ~weak_canonical_test:false + p_path in let self_canonical = - let i = Paths.Path.Resolved.ModuleType.identifier p_path in - (i :> Id.Signature.t) = id + let i = Paths.Path.Resolved.(identifier (p_path :> t)) in + (id :> Id.t) = i in let expansion_needed = self_canonical || hidden_alias in if expansion_needed then @@ -721,7 +724,7 @@ and module_type_expr : | Functor (arg, res) -> let arg' = functor_argument env arg in let env = Env.add_functor_parameter arg env in - let res' = module_type_expr env (`Result id) res in + let res' = module_type_expr env (Paths.Identifier.Mk.result id) res in Functor (arg', res') | TypeOf { t_desc = StructInclude p; t_expansion } -> TypeOf @@ -757,8 +760,8 @@ and type_decl : Env.t -> Id.Signature.t -> TypeDecl.t -> TypeDecl.t = match equation.Equation.manifest with | Some (Constr (`Resolved path, params)) when Paths.Path.Resolved.Type.is_hidden path - || Paths.Path.Resolved.Type.canonical_ident path - = (Some t.id :> Paths.Identifier.Path.Type.t option) -> + || Paths.Path.Resolved.(identifier (path :> t)) + = (t.id :> Paths.Identifier.t) -> Some (path, params) | _ -> None in diff --git a/src/xref2/paths.md b/src/xref2/paths.md index dba1eaea81..13a5f55566 100644 --- a/src/xref2/paths.md +++ b/src/xref2/paths.md @@ -85,7 +85,17 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_type "S" |-- ModuleType.id) sg);; - : Odoc_model.Paths.Identifier.ModuleType.t = -`ModuleType (`Root (Some (`Page (None, None)), Root), S) +{Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; ikey = "mt_S.r_Root.p_None"} ``` - M: `` `Module (`Root root, "M") `` @@ -93,7 +103,17 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_ "M" |-- Module.id) sg);; - : Odoc_model.Paths.Identifier.Module.t = -`Module (`Root (Some (`Page (None, None)), Root), M) +{Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"} ``` - F: `` `Module (`Root root, "F") `` @@ -101,7 +121,17 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_ "F" |-- Module.id) sg);; - : Odoc_model.Paths.Identifier.Module.t = -`Module (`Root (Some (`Page (None, None)), Root), F) +{Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"} ``` - m_t: `` `Type ( `Module ( `Root root, "M"), "m_t" ) `` @@ -109,7 +139,21 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_ "M" |-- mod_sig |-- Signature.type_ "m_t" |-- TypeDecl.id) sg);; - : Odoc_model.Paths.Identifier.Type.t = -`Type (`Module (`Root (Some (`Page (None, None)), Root), M), m_t) +{Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + m_t); + ihash = 493774927; ikey = "t_m_t.m_M.r_Root.p_None"} ``` - f_t: `` `Type (`Result (`Module (`Root root, "F")), "f_t") `` @@ -117,7 +161,24 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_ "F" |-- functor_sig |-- Signature.type_ "f_t" |-- TypeDecl.id) sg);; - : Odoc_model.Paths.Identifier.Type.t = -`Type (`Result (`Module (`Root (Some (`Page (None, None)), Root), F)), f_t) +{Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Result + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}; + ihash = 709672416; ikey = "___result__.m_F.r_Root.p_None"}, + f_t); + ihash = 344808614; ikey = "t_f_t.___result__.m_F.r_Root.p_None"} ``` - foo: `` `Type (`Parameter (`Module (`Root root, "F"), "X"), "foo") `` @@ -125,8 +186,25 @@ Here we have: ```ocaml env=e1 # Common.LangUtils.Lens.(get (Signature.module_ "F" |-- functor_arg_sig |-- Signature.type_ "foo" |-- TypeDecl.id) sg);; - : Odoc_model.Paths.Identifier.Type.t = -`Type - (`Parameter (`Module (`Root (Some (`Page (None, None)), Root), F), X), foo) +{Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}, + X); + ihash = 930266402; ikey = "p_X.m_F.r_Root.p_None"}, + foo); + ihash = 212207131; ikey = "t_foo.p_X.m_F.r_Root.p_None"} ``` There are many other types of Identifier: type, constructor, field, etc. @@ -167,14 +245,45 @@ and now we can get the paths for all three type declarations: # Common.LangUtils.Lens.(get (Signature.module_ "M" |-- mod_sig |-- Signature.module_ "N" |-- mod_sig |-- type_constr_path "x1") sg);; - : Odoc_model.Paths.Path.Type.t = `Identifier - (`Type - (`Module (`Module (`Root (Some (`Page (None, None)), Root), M), N), t), + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N); + ihash = 1041581453; ikey = "m_N.m_M.r_Root.p_None"}, + t); + ihash = 311238448; ikey = "t_t.m_N.m_M.r_Root.p_None"}, false) # Common.LangUtils.Lens.(get (Signature.module_ "M" |-- mod_sig |-- type_constr_path "x2") sg);; - : Odoc_model.Paths.Path.Type.t = `Dot (`Identifier - (`Module (`Module (`Root (Some (`Page (None, None)), Root), M), N), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N); + ihash = 1041581453; ikey = "m_N.m_M.r_Root.p_None"}, false), "t") # Common.LangUtils.Lens.(get (type_constr_path "x3") sg);; @@ -182,7 +291,18 @@ and now we can get the paths for all three type declarations: `Dot (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + false), "N"), "t") ``` @@ -200,22 +320,63 @@ and now the paths are: - : Odoc_model.Paths.Path.Type.t = `Resolved (`Identifier - (`Type - (`Module (`Module (`Root (Some (`Page (None, None)), Root), M), N), - t))) + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N); + ihash = 1041581453; ikey = "m_N.m_M.r_Root.p_None"}, + t); + ihash = 311238448; ikey = "t_t.m_N.m_M.r_Root.p_None"}) # Common.LangUtils.Lens.(get (Signature.module_ "M" |-- mod_sig |-- type_constr_path "x2") sg');; - : Odoc_model.Paths.Path.Type.t = `Resolved (`Type (`Identifier - (`Module (`Module (`Root (Some (`Page (None, None)), Root), M), N)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N); + ihash = 1041581453; ikey = "m_N.m_M.r_Root.p_None"}, t)) # Common.LangUtils.Lens.(get (type_constr_path "x3") sg');; - : Odoc_model.Paths.Path.Type.t = `Resolved (`Type (`Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, N), t)) ``` @@ -263,7 +424,17 @@ val sg : Odoc_model.Lang.Signature.t = {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), ARG); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ARG); + ihash = 379411454; ikey = "mt_ARG.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -271,23 +442,59 @@ val sg : Odoc_model.Lang.Signature.t = {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`ModuleType - (`Root (Some (`Page (None, None)), Root), ARG), - S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ARG); + ihash = 379411454; ikey = "mt_ARG.r_Root.p_None"}, + S); + ihash = 208722936; ikey = "mt_S.mt_ARG.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), F); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType (Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Module (`Root (Some (`Page (None, None)), Root), F), X); + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}, + X); + ihash = 930266402; ikey = "p_X.m_F.r_Root.p_None"}; expr = Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = @@ -296,85 +503,89 @@ val sg : Odoc_model.Lang.Signature.t = {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Parameter - (`Module - (`Root (Some (`Page (None, None)), Root), - F), - X), - S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + F); + ihash = 748202139; + ikey = "m_F.r_Root.p_None"}, + X); + ihash = 930266402; + ikey = "p_X.m_F.r_Root.p_None"}, + S); + ihash = 313393860; + ikey = "mt_S.p_X.m_F.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []}); p_path = `Resolved (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), ARG)))}}, + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ARG); + ihash = 379411454; ikey = "mt_ARG.r_Root.p_None"})}}, Odoc_model.Lang.ModuleType.Signature {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`Result - (`Module (`Root (Some (`Page (None, None)), Root), F)), - N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Result + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; + ikey = + "m_F.r_Root.p_No"... (* string length 17; truncated *)}; + ihash = 709672416; + ikey = + "___result__.m"... (* string length 29; truncated *)}, + N); + ihash = 837385364; + ikey = "m_N.___res"... (* string length 33; truncated *)}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType (Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = None; - p_path = - `Resolved - (`OpaqueModuleType - (`ModuleType - (`Identifier - (`Parameter - (`Module - (`Root - (Some (`Page (None, None)), Root), - F), - X)), - S)))}); - canonical = None; hidden = false})]; - compiled = true; doc = []})); - canonical = None; hidden = false}); - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), M); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.ModuleType - {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module (`Root (Some (`Page (None, None)), Root), M), S); - doc = []; canonical = None; - expr = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`Module - (`Root (Some (`Page (None, None)), Root), - M), - ...), - ...); - doc = ...; canonical = ...; equation = ...; - representation = ...}); - ...]; - compiled = ...; doc = ...})}; - ...]; - compiled = ...; doc = ...}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; doc = ...} + p_path = `Resolved ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...})); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...} ``` The problem here is that odoc will not generate a page for the module `F(M)`. @@ -393,14 +604,44 @@ path as this `` `Subst `` constructor: (`Subst (`ModuleType (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, S), `Module (`Apply (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), F)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}, `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}), N)), t)) ``` diff --git a/src/xref2/ref_tools.ml b/src/xref2/ref_tools.ml index f770c56a75..4573f21e1c 100644 --- a/src/xref2/ref_tools.ml +++ b/src/xref2/ref_tools.ml @@ -177,7 +177,7 @@ module M = struct | Some (`Aliased cp) -> let cp = Tools.reresolve_module env cp in let p = Lang_of.(Path.resolved_module (empty ()) cp) in - (`Alias (cp, base_path), `Alias (p, base_ref)) + (`Alias (cp, `Resolved base_path, None), `Alias (p, base_ref)) | Some (`SubstMT cp) -> let cp = Tools.reresolve_module_type env cp in (`Subst (cp, base_path), base_ref) @@ -193,8 +193,8 @@ module M = struct let of_element env (`Module (id, m)) : t = let m = Component.Delayed.get m in - let base = `Identifier (id :> Identifier.Path.Module.t) in - of_component env m base base + let id = (id :> Identifier.Path.Module.t) in + of_component env m (`Gpath (`Identifier id)) (`Identifier id) let in_env env name = match env_lookup_by_name Env.s_module name env with @@ -225,7 +225,7 @@ module MT = struct (`ModuleType (parent', name))) let of_element env (`ModuleType (id, mt)) : t = - of_component env mt (`Identifier id) (`Identifier id) + of_component env mt (`Gpath (`Identifier id)) (`Identifier id) let in_env env name = env_lookup_by_name Env.s_module_type name env >>= fun e -> @@ -331,7 +331,8 @@ module L = struct let rec find = function | hd :: tl -> ( match Odoc_model.Location_.value hd with - | `Heading (_, (`Label (_, name') as label), _) + | `Heading + (_, ({ Odoc_model.Paths.iv = `Label (_, name'); _ } as label), _) when name = LabelName.to_string name' -> Ok (`Identifier label) | _ -> find tl) diff --git a/src/xref2/strengthen.ml b/src/xref2/strengthen.ml index 99e7c4e1d2..85a66dfebe 100644 --- a/src/xref2/strengthen.ml +++ b/src/xref2/strengthen.ml @@ -17,7 +17,10 @@ open Component open Delayed let rec signature : - Cpath.module_ -> ?canonical:Cpath.module_ -> Signature.t -> Signature.t = + Cpath.module_ -> + ?canonical:Odoc_model.Paths.Path.Module.t -> + Signature.t -> + Signature.t = fun prefix ?canonical sg -> let sg', strengthened_modules = sig_items prefix ?canonical sg in let substs = @@ -71,7 +74,7 @@ and sig_items prefix ?canonical sg = ({ sg with items = List.rev items }, ids) and module_ : - ?canonical:Cpath.module_ -> + ?canonical:Odoc_model.Paths.Path.Module.t -> Cpath.module_ -> Component.Module.t -> Component.Module.t = diff --git a/src/xref2/subst.ml b/src/xref2/subst.ml index 7a21f37228..9240f26490 100644 --- a/src/xref2/subst.ml +++ b/src/xref2/subst.ml @@ -198,13 +198,20 @@ let rec resolved_module_path : | Some (`Prefixed (_p, rp)) -> rp | Some `Substituted -> `Substituted p | None -> p) - | `Identifier _ -> p + | `Gpath _ -> p | `Apply (p1, p2) -> `Apply (resolved_module_path s p1, resolved_module_path s p2) | `Substituted p -> `Substituted (resolved_module_path s p) | `Module (p, n) -> `Module (resolved_parent_path s p, n) - | `Alias (p1, p2) -> - `Alias (resolved_module_path s p1, resolved_module_path s p2) + | `Alias (p1, p2, p3opt) -> + let p2' = module_path s p2 in + let up2' = try Cpath.unresolve_module_path p2' with _ -> p2' in + let p3opt' = + match p3opt with + | Some p3 -> Some (resolved_module_path s p3) + | None -> None + in + `Alias (resolved_module_path s p1, up2', p3opt') | `Subst (p1, p2) -> let p1 = match resolved_module_type_path s p1 with @@ -216,8 +223,7 @@ let rec resolved_module_path : in `Subst (p1, resolved_module_path s p2) | `Hidden p1 -> `Hidden (resolved_module_path s p1) - | `Canonical (p1, p2) -> - `Canonical (resolved_module_path s p1, module_path s p2) + | `Canonical (p1, p2) -> `Canonical (resolved_module_path s p1, p2) | `OpaqueModule m -> if s.unresolve_opaque_paths then raise Invalidated else `OpaqueModule (resolved_module_path s m) @@ -272,16 +278,15 @@ and resolved_module_type_path : | `Prefixed (_p, rp) -> Not_replaced rp | `Renamed x -> Not_replaced (`Local x) | exception Not_found -> Not_replaced (`Local id)) - | `Identifier _ -> Not_replaced p + | `Gpath _ -> Not_replaced p | `Substituted p -> resolved_module_type_path s p |> map_replaced (fun p -> `Substituted p) | `ModuleType (p, n) -> Not_replaced (`ModuleType (resolved_parent_path s p, n)) | `CanonicalModuleType (mt1, mt2) -> ( - match (resolved_module_type_path s mt1, module_type_path s mt2) with - | Not_replaced mt1', Not_replaced mt2' -> - Not_replaced (`CanonicalModuleType (mt1', mt2')) - | x, _ -> x) + match resolved_module_type_path s mt1 with + | Not_replaced mt1' -> Not_replaced (`CanonicalModuleType (mt1', mt2)) + | x -> x) | `OpaqueModuleType m -> if s.unresolve_opaque_paths then raise Invalidated else @@ -347,11 +352,10 @@ and resolved_type_path : | Some (`Renamed x) -> Not_replaced (`Local x) | None -> Not_replaced (`Local id)) | `CanonicalType (t1, t2) -> ( - match (resolved_type_path s t1, type_path s t2) with - | Not_replaced t1', Not_replaced t2' -> - Not_replaced (`CanonicalType (t1', t2')) - | x, _ -> x) - | `Identifier _ -> Not_replaced p + match resolved_type_path s t1 with + | Not_replaced t1' -> Not_replaced (`CanonicalType (t1', t2)) + | x -> x) + | `Gpath _ -> Not_replaced p | `Substituted p -> resolved_type_path s p |> map_replaced (fun p -> `Substituted p) | `Type (p, n) -> Not_replaced (`Type (resolved_parent_path s p, n)) @@ -394,7 +398,7 @@ and resolved_class_type_path : | Some (`Prefixed (_p, rp)) -> rp | Some (`Renamed x) -> `Local x | None -> `Local id) - | `Identifier _ -> p + | `Gpath _ -> p | `Substituted p -> `Substituted (resolved_class_type_path s p) | `ClassType (p, n) -> `ClassType (resolved_parent_path s p, n) | `Class (p, n) -> `Class (resolved_parent_path s p, n) @@ -506,21 +510,12 @@ let rec type_fragment : t -> Cfrag.type_ -> Cfrag.type_ = let option_ conv s x = match x with Some x -> Some (conv s x) | None -> None -let option_bind conv s x = match x with Some x -> conv s x | None -> None - let list conv s xs = List.map (conv s) xs let rec type_ s t = let open Component.TypeDecl in let representation = option_ type_decl_representation s t.representation in - let canonical = - match t.canonical with - | Some p -> ( - match type_path s p with - | Not_replaced p' -> Some p' - | Replaced _ -> None) - | None -> None - in + let canonical = t.canonical in { equation = type_decl_equation s t.equation; representation; @@ -624,13 +619,7 @@ and module_type s t = let expr = match t.expr with Some m -> Some (module_type_expr s m) | None -> None in - let maybe_path s t = - match module_type_path s t with - | Not_replaced p -> Some p - | Replaced (Path p) -> Some p.p_path - | Replaced _ -> None - in - { expr; doc = t.doc; canonical = option_bind maybe_path s t.canonical } + { expr; doc = t.doc; canonical = t.canonical } and module_type_substitution s t = let open Component.ModuleTypeSubstitution in @@ -676,14 +665,14 @@ and mto_module_path_invalidated : t -> Cpath.module_ -> bool = and mto_resolved_module_path_invalidated s p = match p with | `Local id -> List.mem id s.module_type_of_invalidating_modules - | `Identifier _ -> false + | `Gpath _ -> false | `Apply (p1, p2) -> mto_resolved_module_path_invalidated s p1 || mto_resolved_module_path_invalidated s p2 | `Module (`Module p, _) | `Substituted p -> mto_resolved_module_path_invalidated s p | `Module (_, _) -> false - | `Alias (p1, _p2) -> mto_resolved_module_path_invalidated s p1 + | `Alias (p1, _p2, _) -> mto_resolved_module_path_invalidated s p1 | `Subst (_p1, p2) -> mto_resolved_module_path_invalidated s p2 | `Hidden p -> mto_resolved_module_path_invalidated s p | `Canonical (p1, _p2) -> mto_resolved_module_path_invalidated s p1 @@ -784,7 +773,7 @@ and include_decl s t = and module_ s t = let open Component.Module in let type_ = module_decl s t.type_ in - let canonical = option_ (fun s m1 -> module_path s m1) s t.canonical in + let canonical = t.canonical in { t with type_; canonical } and module_substitution s m = diff --git a/src/xref2/test.md b/src/xref2/test.md index 27436b964a..22a50b536a 100644 --- a/src/xref2/test.md +++ b/src/xref2/test.md @@ -152,7 +152,19 @@ and using this lens on our original signature we obtain: - : Odoc_model.Lang.TypeExpr.t option = Some (Odoc_model.Lang.TypeExpr.Constr - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), x), false), + (`Identifier + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x); + ihash = 622581103; ikey = "t_x.r_Root.p_None"}, + false), [])) ``` @@ -183,7 +195,17 @@ and so we simply look up the type in the environment, giving a `Component.Type.t {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), x); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x); + ihash = 622581103; ikey = "t_x.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -191,7 +213,17 @@ and so we simply look up the type in the environment, giving a `Component.Type.t representation = None}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -200,7 +232,17 @@ and so we simply look up the type in the environment, giving a `Component.Type.t (Odoc_model.Lang.TypeExpr.Constr (`Resolved (`Identifier - (`Type (`Root (Some (`Page (None, None)), Root), x))), + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x); + ihash = 622581103; ikey = "t_x.r_Root.p_None"}), [])); constraints = []}; representation = None})]; @@ -233,7 +275,18 @@ Some (Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + false), "t"), [])) ``` @@ -261,9 +314,21 @@ which are: | Ok x -> x | Error _ -> failwith "Found error";; val get_ok : ('a, 'b) result -> 'a = -# let (path, module_) = get_ok @@ Tools.resolve_module ~mark_substituted:true ~add_canonical:true env (`Resolved (`Identifier (Common.root_module "M")));; +# let (path, module_) = get_ok @@ Tools.resolve_module ~mark_substituted:true ~add_canonical:true env (`Resolved (`Gpath (`Identifier (Common.root_module "M"))));; val path : Cpath.Resolved.module_ = - `Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)) + `Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}) val module_ : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some @@ -333,9 +398,21 @@ It proceeds much as the previous example until we get the result of looking up the module `N`: ```ocaml env=e1 -# let (path, module_) = get_ok @@ Tools.resolve_module ~mark_substituted:true ~add_canonical:true env (`Resolved (`Identifier (Common.root_module "N")));; +# let (path, module_) = get_ok @@ Tools.resolve_module ~mark_substituted:true ~add_canonical:true env (`Resolved (`Gpath (`Identifier (Common.root_module "N"))));; val path : Cpath.Resolved.module_ = - `Identifier (`Module (`Root (Some (`Page (None, None)), Root), N)) + `Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + N); + ihash = 502470005; ikey = "m_N.r_Root.p_None"}) val module_ : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some @@ -346,7 +423,17 @@ val module_ : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.ModuleType.p_expansion = None; p_path = `Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, false)}); canonical = None; hidden = false}; get = None} @@ -380,11 +467,21 @@ by the module type `N`. However, `N` is not defined at the top level here, so it has a local identifier. We can see this by looking up module `M` from the environment: ```ocaml env=e1 -# let m = Env.(lookup_by_id s_module_type) (`ModuleType (Common.id, Odoc_model.Names.ModuleTypeName.make_std "M")) env;; +# let m = Env.(lookup_by_id s_module_type) (Odoc_model.Paths.Identifier.Mk.module_type (Common.id, Odoc_model.Names.ModuleTypeName.make_std "M")) env;; val m : Component.Element.module_type option = Some (`ModuleType - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, {Odoc_xref2.Component.ModuleType.doc = []; canonical = None; expr = Some @@ -451,7 +548,18 @@ Some (`Dot (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + false), "B"), "t"), [])) @@ -460,7 +568,7 @@ Some we look up `A` from the environment: ```ocaml env=e1 -# let p = `Identifier (Common.root_module "A") in +# let p = `Gpath (`Identifier (Common.root_module "A")) in let m = get_ok @@ Tools.lookup_module ~mark_substituted:true env p in let sg = get_ok @@ Tools.signature_of_module env (Component.Delayed.get m) in Tools.prefix_signature (`Module p, sg);; @@ -498,8 +606,20 @@ we look up `A` from the environment: p_path = `ModuleType (`Module - (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"})), N)}); canonical = None; hidden = false}; get = None})]; @@ -542,7 +662,7 @@ we then return along with the fully resolved identifier. (`Dot (`Dot (`Resolved - (`Identifier (Common.root_module "A")), + (`Gpath (`Identifier (Common.root_module "A"))), "B"), "t"));; - : Cpath.Resolved.type_ = @@ -550,8 +670,19 @@ we then return along with the fully resolved identifier. (`Module (`Module (`Module - (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"})), B)), t) ``` @@ -583,12 +714,34 @@ Some (`Alias (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, M), - `Module + `Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), - N)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + false), + "N")), t)), [])) ``` @@ -622,16 +775,51 @@ Some (`Alias (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, M), - `Module + `Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), - N)), - `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + false), + "N")), + `Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), - O)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + false), + "O")), t)), [])) ``` @@ -685,7 +873,17 @@ val module_C_lens : # Common.LangUtils.Lens.get module_C_lens sg;; - : Odoc_model.Lang.Module.t = {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), C); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + C); + ihash = 43786577; ikey = "m_C.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -694,13 +892,35 @@ val module_C_lens : [Odoc_model.Lang.ModuleType.ModuleEq (`Dot (`Root, "M"), Odoc_model.Lang.Module.Alias (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), B), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}, + false), None))]; w_expansion = None; w_expr = Odoc_model.Lang.ModuleType.U.Path (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), false))}); + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, + false))}); canonical = None; hidden = false} ``` @@ -708,7 +928,7 @@ Clearly there is no `type t` declared in here. Let's get the representation of module `C` we see the following: ```ocaml env=e1 -# let m = get_ok @@ Tools.lookup_module ~mark_substituted:true env (`Identifier (Common.root_module "C"));; +# let m = get_ok @@ Tools.lookup_module ~mark_substituted:true env (`Gpath (`Identifier (Common.root_module "C")));; val m : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some @@ -720,14 +940,35 @@ val m : Component.Module.t Component.Delayed.t = [Odoc_xref2.Component.ModuleType.ModuleEq (`Dot (`Root, "M"), Odoc_xref2.Component.Module.Alias (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), B), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}, false), None))]; w_expansion = None; w_expr = Odoc_xref2.Component.ModuleType.U.Path (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, false))}); canonical = None; hidden = false}; get = None} @@ -747,7 +988,18 @@ val sg : Component.Signature.t = type_ = Odoc_xref2.Component.Module.Alias (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), B), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}, + false), None); canonical = None; hidden = false}; get = None}); @@ -771,7 +1023,7 @@ look up module `N` from within this and find its signature: ```ocaml env=e1 # let m = get_ok @@ Tools.lookup_module ~mark_substituted:true env - (`Module (`Module (`Identifier (Common.root_module "C")), ModuleName.make_std "N"));; + (`Module (`Module (`Gpath (`Identifier (Common.root_module "C"))), ModuleName.make_std "N"));; val m : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some @@ -784,8 +1036,20 @@ val m : Component.Module.t Component.Delayed.t = `Dot (`Module (`Module - (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), C))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + C); + ihash = 43786577; ikey = "m_C.r_Root.p_None"})), M), "S")}); canonical = None; hidden = false}; @@ -818,7 +1082,17 @@ Some (`Type (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), C)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + C); + ihash = 43786577; ikey = "m_C.r_Root.p_None"}, N), t)), [])) @@ -863,7 +1137,17 @@ Some (`Type (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, O), t)), [])) @@ -877,18 +1161,51 @@ Some (`ModuleType (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, T), S), `Module (`Apply (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, F), `Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, T)), N)), t)), @@ -934,7 +1251,17 @@ Some (`Module (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, O), N), t)), @@ -979,11 +1306,33 @@ Some (`Apply (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, O), `Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, T)), N), t)), @@ -1022,16 +1371,59 @@ Some (`Apply (`Apply (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), App), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + App); + ihash = 855073208; ikey = "m_App.r_Root.p_None"}, false), `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Bar), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}, false)), `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, false)), `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), FooBarInt), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + FooBarInt); + ihash = 706684202; ikey = "m_FooBarInt.r_Root.p_None"}, false)), "Foo"), "bar"), @@ -1066,13 +1458,58 @@ val p : Cpath.Resolved.module_ = `Apply (`Apply (`Apply + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + App); + ihash = 855073208; ikey = "m_App.r_Root.p_None"}), + `Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"})), + `Gpath (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), App)), - `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Bar))), - `Identifier (`Module (`Root (Some (`Page (None, None)), Root), Foo))), - `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), FooBarInt))) + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"})), + `Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + FooBarInt); + ihash = 706684202; ikey = "m_FooBarInt.r_Root.p_None"})) val m : Component.Module.t Component.Delayed.t = {Odoc_xref2.Component.Delayed.v = Some @@ -1086,14 +1523,37 @@ val m : Component.Module.t Component.Delayed.t = (`Apply (`Resolved (`Substituted - (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Foo)))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; + ikey = "m_Foo.r_Root.p_None"}))), `Resolved (`Substituted - (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Bar))))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"})))), "T")}); canonical = None; hidden = false}; get = None} @@ -1113,9 +1573,126 @@ val sg' : Component.Signature.t = `Dot (`Resolved (`Substituted - (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Bar)))), + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}))), + "T")}); + canonical = None; hidden = false}; + get = None})]; + compiled = false; removed = []; doc = []} +# let sg' = get_ok @@ Tools.signature_of_module env (Component.Delayed.get m);; +val sg' : Component.Signature.t = + {Odoc_xref2.Component.Signature.items = + [Odoc_xref2.Component.Signature.Module (`LModule (Foo, 17), + Odoc_model.Lang.Signature.Ordinary, + {Odoc_xref2.Component.Delayed.v = + Some + {Odoc_xref2.Component.Module.doc = []; + type_ = + Odoc_xref2.Component.Module.ModuleType + (Odoc_xref2.Component.ModuleType.Path + {Odoc_xref2.Component.ModuleType.p_expansion = None; + p_path = + `Dot + (`Resolved + (`Substituted + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}))), + "T")}); + canonical = None; hidden = false}; + get = None})]; + compiled = false; removed = []; doc = []} +# let sg' = get_ok @@ Tools.signature_of_module env (Component.Delayed.get m);; +val sg' : Component.Signature.t = + {Odoc_xref2.Component.Signature.items = + [Odoc_xref2.Component.Signature.Module (`LModule (Foo, 20), + Odoc_model.Lang.Signature.Ordinary, + {Odoc_xref2.Component.Delayed.v = + Some + {Odoc_xref2.Component.Module.doc = []; + type_ = + Odoc_xref2.Component.Module.ModuleType + (Odoc_xref2.Component.ModuleType.Path + {Odoc_xref2.Component.ModuleType.p_expansion = None; + p_path = + `Dot + (`Resolved + (`Substituted + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}))), + "T")}); + canonical = None; hidden = false}; + get = None})]; + compiled = false; removed = []; doc = []} +# let sg' = get_ok @@ Tools.signature_of_module env (Component.Delayed.get m);; +val sg' : Component.Signature.t = + {Odoc_xref2.Component.Signature.items = + [Odoc_xref2.Component.Signature.Module (`LModule (Foo, 23), + Odoc_model.Lang.Signature.Ordinary, + {Odoc_xref2.Component.Delayed.v = + Some + {Odoc_xref2.Component.Module.doc = []; + type_ = + Odoc_xref2.Component.Module.ModuleType + (Odoc_xref2.Component.ModuleType.Path + {Odoc_xref2.Component.ModuleType.p_expansion = None; + p_path = + `Dot + (`Resolved + (`Substituted + (`Gpath + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}))), "T")}); canonical = None; hidden = false}; get = None})]; @@ -1138,24 +1715,74 @@ Some (`Subst (`ModuleType (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Bar)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}, T), `Module (`Apply (`Apply (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), App)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + App); + ihash = 855073208; ikey = "m_App.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Bar))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}), `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Foo))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}), `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), FooBarInt))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + FooBarInt); + ihash = 706684202; ikey = "m_FooBarInt.r_Root.p_None"}), Foo)), bar)), [])) @@ -1193,10 +1820,31 @@ Some (`Apply (`Module (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, O), `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}), N), t)), [])) @@ -1241,26 +1889,81 @@ Some (`Subst (`ModuleType (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep1)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep1); + ihash = 393430064; ikey = "m_Dep1.r_Root.p_None"}, S), `Module (`Module (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep2)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep2); + ihash = 739333691; ikey = "m_Dep2.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep1))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep1); + ihash = 393430064; ikey = "m_Dep1.r_Root.p_None"}), A), Y)), - `Module + `Dot (`Apply (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep2)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep2); + ihash = 739333691; ikey = "m_Dep2.r_Root.p_None"}, + false), `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep1))), - B)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep1); + ihash = 393430064; ikey = "m_Dep1.r_Root.p_None"}, + false)), + "B")), c)), [])) ``` @@ -1305,17 +2008,47 @@ Some (`Subst (`ModuleType (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep4)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep4); + ihash = 1019199703; ikey = "m_Dep4.r_Root.p_None"}, T), `Module (`Module (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep5)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep5); + ihash = 592809356; ikey = "m_Dep5.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep4))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep4); + ihash = 1019199703; ikey = "m_Dep4.r_Root.p_None"}), Z), X)), b)), @@ -1328,18 +2061,50 @@ Some (`Type (`Alias (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep3)), - `Module - (`Module + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep3); + ihash = 403763666; ikey = "m_Dep3.r_Root.p_None"}, + `Dot + (`Dot (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep5)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep5); + ihash = 592809356; ikey = "m_Dep5.r_Root.p_None"}, + false), `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep4))), - Z), - Y)), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep4); + ihash = 1019199703; ikey = "m_Dep4.r_Root.p_None"}, + false)), + "Z"), + "Y")), a)), [])) ``` @@ -1384,16 +2149,47 @@ Some (`Subst (`ModuleType (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep6)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep6); + ihash = 489035468; ikey = "m_Dep6.r_Root.p_None"}, T), `Module (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep7)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep7); + ihash = 108620130; ikey = "m_Dep7.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), Dep6))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep6); + ihash = 489035468; ikey = "m_Dep6.r_Root.p_None"}), M)), Y), d)), @@ -1435,7 +2231,17 @@ Some (`Resolved (`Type (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Dep13)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Dep13); + ihash = 726816582; ikey = "m_Dep13.r_Root.p_None"}, c)), [])) ``` @@ -1502,8 +2308,17 @@ Some (`Hidden (`Hidden (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), {Hidden__}1)))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + {Hidden__}1); + ihash = 91343490; ikey = "m_{Hidden__}1.r_Root.p_None"})), t)), [])) ``` @@ -1524,7 +2339,17 @@ let resolved = Common.compile_signature sg;; # Common.LangUtils.Lens.get (Common.LangUtils.Lens.Signature.type_ "t") resolved;; - : Odoc_model.Lang.TypeDecl.t = {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}; doc = [{Odoc_model__.Location_.location = {Odoc_model__.Location_.file = ""; @@ -1577,7 +2402,17 @@ let sg = Common.signature_of_mli_string test_data;; {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1586,9 +2421,22 @@ let sg = Common.signature_of_mli_string test_data;; [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + t); + ihash = 825731485; ikey = "t_t.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1597,7 +2445,17 @@ let sg = Common.signature_of_mli_string test_data;; compiled = false; doc = []})}; Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1605,7 +2463,17 @@ let sg = Common.signature_of_mli_string test_data;; representation = None}); Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M1); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M1); + ihash = 756272831; ikey = "mt_M1.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1619,7 +2487,18 @@ let sg = Common.signature_of_mli_string test_data;; (Odoc_model.Lang.TypeExpr.Constr (`Resolved (`Identifier - (`Type (`Root (Some (`Page (None, None)), Root), u))), + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}), [])); constraints = []})]; w_expansion = None; @@ -1627,7 +2506,17 @@ let sg = Common.signature_of_mli_string test_data;; Odoc_model.Lang.ModuleType.U.Path (`Resolved (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), M))))})}]; + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}))})}]; compiled = false; doc = []} ``` @@ -1660,7 +2549,21 @@ Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Module (`Root (Some (`Page (None, None)), Root), M), s); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + s); + ihash = 395135148; ikey = "t_s.m_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1669,11 +2572,26 @@ Odoc_model.Lang.ModuleType.Path Some (Odoc_model.Lang.TypeDecl.Representation.Variant [{Odoc_model.Lang.TypeDecl.Constructor.id = - `Constructor - (`Type - (`Module (`Root (Some (`Page (None, None)), Root), M), - s), - ); + {Odoc_model__Paths_types.iv = + `Constructor + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + s); + ihash = 395135148; ikey = "t_s.m_M.r_Root.p_None"}, + ); + ihash = 2570800; ikey = "ctor_C.t_s.m_M.r_Root.p_None"}; doc = []; args = Odoc_model.Lang.TypeDecl.Constructor.Tuple @@ -1682,13 +2600,37 @@ Odoc_model.Lang.ModuleType.Path (`Type (`Apply (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), - Foo)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; + ikey = "m_Foo.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), - Bar))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; + ikey = "m_Bar.r_Root.p_None"}), t)), [])]; res = None}])})]; @@ -1698,9 +2640,29 @@ Odoc_model.Lang.ModuleType.Path (`ModuleType (`Apply (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Bar))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Bar); + ihash = 608577; ikey = "m_Bar.r_Root.p_None"}), S))} ``` @@ -1742,25 +2704,78 @@ let m_e_i_s_value mod_name n val_name = # Common.LangUtils.Lens.get (m_e_i_s_value "Foo3" 0 "id") sg;; - : Odoc_model.Lang.Value.t = {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id); + ihash = 424389437; ikey = "v_id.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, + false), "t"), []); value = Odoc_model.Lang.Value.Abstract} # Common.LangUtils.Lens.get (m_e_i_s_value "Foo3" 0 "id2") sg;; - : Odoc_model.Lang.Value.t = {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id2); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id2); + ihash = 412619918; ikey = "v_id2.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Identifier - (`Type (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}3), + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}3); + ihash = 271372153; ikey = "t_{t}3.m_Foo3.r_Root.p_None"}, false), []); value = Odoc_model.Lang.Value.Abstract} @@ -1799,7 +2814,21 @@ let sg = Common.signature_of_mli_string test_data;; {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}4); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}4); + ihash = 671044364; ikey = "t_{t}4.m_Foo3.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1808,7 +2837,17 @@ let sg = Common.signature_of_mli_string test_data;; (Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, false), "t"), [])); @@ -1816,13 +2855,40 @@ let sg = Common.signature_of_mli_string test_data;; representation = None}); Odoc_model.Lang.Signature.Value {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id); + ihash = 424389437; ikey = "v_id.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Identifier - (`Type - (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}4), + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}4); + ihash = 671044364; ikey = "t_{t}4.m_Foo3.r_Root.p_None"}, false), []); value = Odoc_model.Lang.Value.Abstract}]; @@ -1832,7 +2898,21 @@ let sg = Common.signature_of_mli_string test_data;; {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}5); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}5); + ihash = 67089224; ikey = "t_{t}5.m_Foo3.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1841,7 +2921,17 @@ let sg = Common.signature_of_mli_string test_data;; (Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo2), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo2); + ihash = 926621908; ikey = "m_Foo2.r_Root.p_None"}, false), "t"), [])); @@ -1849,13 +2939,40 @@ let sg = Common.signature_of_mli_string test_data;; representation = None}); Odoc_model.Lang.Signature.Value {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id2); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id2); + ihash = 412619918; ikey = "v_id2.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Identifier - (`Type - (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}5), + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}5); + ihash = 67089224; ikey = "t_{t}5.m_Foo3.r_Root.p_None"}, false), []); value = Odoc_model.Lang.Value.Abstract}]; @@ -1897,7 +3014,21 @@ let sg = Common.signature_of_mli_string test_data;; {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}6); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}6); + ihash = 133032212; ikey = "t_{t}6.m_Foo3.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1906,7 +3037,17 @@ let sg = Common.signature_of_mli_string test_data;; (Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, false), "t"), [])); @@ -1914,21 +3055,66 @@ let sg = Common.signature_of_mli_string test_data;; representation = None}); Odoc_model.Lang.Signature.Value {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {x}7); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {x}7); + ihash = 314949087; ikey = "v_{x}7.m_Foo3.r_Root.p_None"}; doc = []; type_ = - Odoc_model.Lang.TypeExpr.Constr (`Identifier (`CoreType int, false), + Odoc_model.Lang.TypeExpr.Constr + (`Identifier + ({Odoc_model__Paths_types.iv = `CoreType int; ihash = 432452609; + ikey = "coret_int"}, + false), []); value = Odoc_model.Lang.Value.Abstract}; Odoc_model.Lang.Signature.Value {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id); + ihash = 424389437; ikey = "v_id.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Identifier - (`Type - (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {t}6), + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {t}6); + ihash = 133032212; ikey = "t_{t}6.m_Foo3.r_Root.p_None"}, false), []); value = Odoc_model.Lang.Value.Abstract}]; @@ -1969,28 +3155,79 @@ let sg = Common.signature_of_mli_string test_data;; {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`Module (`Root (Some (`Page (None, None)), Root), Foo3), {Bar}9); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {Bar}9); + ihash = 658027043; ikey = "m_{Bar}9.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.Alias (`Dot (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), Foo), false), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo); + ihash = 249248993; ikey = "m_Foo.r_Root.p_None"}, + false), "Bar"), None); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Value {Odoc_model.Lang.Value.id = - `Value (`Module (`Root (Some (`Page (None, None)), Root), Foo3), id); + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + id); + ihash = 424389437; ikey = "v_id.m_Foo3.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.TypeExpr.Constr (`Dot (`Identifier - (`Module - (`Module (`Root (Some (`Page (None, None)), Root), Foo3), - {Bar}9), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Foo3); + ihash = 670280318; ikey = "m_Foo3.r_Root.p_None"}, + {Bar}9); + ihash = 658027043; ikey = "m_{Bar}9.m_Foo3.r_Root.p_None"}, true), "t"), []); diff --git a/src/xref2/tools.ml b/src/xref2/tools.ml index 564acf52b0..8e17f5a3de 100644 --- a/src/xref2/tools.ml +++ b/src/xref2/tools.ml @@ -384,56 +384,37 @@ let reset_caches () = let simplify_module : Env.t -> Cpath.Resolved.module_ -> Cpath.Resolved.module_ = fun env m -> + let open Odoc_model.Paths.Identifier in match m with - | `Module (`Module (`Identifier p), name) -> ( - let ident = - (`Module ((p :> Odoc_model.Paths.Identifier.Signature.t), name) - : Odoc_model.Paths.Identifier.Path.Module.t) - in - match - Env.( - lookup_by_id s_module - (ident :> Odoc_model.Paths.Identifier.Signature.t) - env) - with - | Some _ -> `Identifier ident + | `Module (`Module (`Gpath (`Identifier p)), name) -> ( + let ident = (Mk.module_ ((p :> Signature.t), name) : Path.Module.t) in + match Env.(lookup_by_id s_module (ident :> Signature.t) env) with + | Some _ -> `Gpath (`Identifier ident) | None -> m) | _ -> m let simplify_module_type : Env.t -> Cpath.Resolved.module_type -> Cpath.Resolved.module_type = fun env m -> + let open Odoc_model.Paths.Identifier in match m with - | `ModuleType (`Module (`Identifier p), name) -> ( + | `ModuleType (`Module (`Gpath (`Identifier p)), name) -> ( let ident = - (`ModuleType ((p :> Odoc_model.Paths.Identifier.Signature.t), name) - : Odoc_model.Paths.Identifier.Path.ModuleType.t) + (Mk.module_type ((p :> Signature.t), name) : Path.ModuleType.t) in - match - Env.( - lookup_by_id s_module_type - (ident :> Odoc_model.Paths.Identifier.Signature.t) - env) - with - | Some _ -> `Identifier ident + match Env.(lookup_by_id s_module_type (ident :> Signature.t) env) with + | Some _ -> `Gpath (`Identifier ident) | None -> m) | _ -> m let simplify_type : Env.t -> Cpath.Resolved.type_ -> Cpath.Resolved.type_ = fun env m -> + let open Odoc_model.Paths.Identifier in match m with - | `Type (`Module (`Identifier p), name) -> ( - let ident = - (`Type ((p :> Odoc_model.Paths.Identifier.Signature.t), name) - : Odoc_model.Paths.Identifier.Path.Type.t) - in - match - Env.( - lookup_by_id s_type - (ident :> Odoc_model.Paths.Identifier.Path.Type.t) - env) - with - | Some _ -> `Identifier ident + | `Type (`Module (`Gpath (`Identifier p)), name) -> ( + let ident = (Mk.type_ ((p :> Signature.t), name) : Path.Type.t) in + match Env.(lookup_by_id s_type (ident :> Path.Type.t) env) with + | Some _ -> `Gpath (`Identifier ident) | None -> m) | _ -> m @@ -561,24 +542,34 @@ and get_module_path_modifiers : | Some s -> Some (`SubstMT s) | None -> None) -and process_module_path env ~add_canonical m p = - let p = if m.Component.Module.hidden then `Hidden p else p in - let p' = +and process_module_path env ~add_canonical m rp = + let rp = if m.Component.Module.hidden then `Hidden rp else rp in + let rp' = match get_module_path_modifiers env ~add_canonical m with - | None -> p - | Some (`Aliased p') -> `Alias (p', p) - | Some (`SubstMT p') -> `Subst (p', p) + | None -> rp + | Some (`Aliased rp') -> + let dest_hidden = + Cpath.is_resolved_module_hidden ~weak_canonical_test:true rp' + in + if dest_hidden then rp + else + let unresolved_rp = + try Cpath.unresolve_resolved_module_path rp with _ -> `Resolved rp + in + (* Keep the resolved path for the canonical processing below in handle_canonical_module.strip_alias *) + `Alias (rp', unresolved_rp, Some rp) + | Some (`SubstMT p') -> `Subst (p', rp) in - let p'' = if add_canonical then add_canonical_path m p' else p' in + let p'' = if add_canonical then add_canonical_path m rp' else rp' in p'' -and handle_module_lookup env ~add_canonical id parent sg sub = +and handle_module_lookup env ~add_canonical id rparent sg sub = match Find.careful_module_in_sig sg id with | Some (`FModule (name, m)) -> - let p' = simplify_module env (`Module (parent, name)) in + let rp' = simplify_module env (`Module (rparent, name)) in let m' = Subst.module_ sub m in let md' = Component.Delayed.put_val m' in - Ok (process_module_path env ~add_canonical m' p', md') + Ok (process_module_path env ~add_canonical m' rp', md') | Some (`FModule_removed p) -> lookup_module ~mark_substituted:false env p >>= fun m -> Ok (p, m) | None -> Error `Find_failure @@ -606,6 +597,43 @@ and handle_class_type_lookup id p sg = | Some (`FType_removed (_name, _, _) as _t) -> Error `Class_replaced | None -> Error `Find_failure +and lookup_module_gpath : + mark_substituted:bool -> + Env.t -> + Odoc_model.Paths.Path.Resolved.Module.t -> + ( Component.Module.t Component.Delayed.t, + simple_module_lookup_error ) + Result.result = + fun ~mark_substituted env path -> + match path with + | `Identifier i -> + of_option ~error:(`Lookup_failure i) (Env.(lookup_by_id s_module) i env) + >>= fun (`Module (_, m)) -> Ok m + | `Apply (functor_path, argument_path) -> + lookup_module_gpath ~mark_substituted env functor_path + >>= fun functor_module -> + let functor_module = Component.Delayed.get functor_module in + handle_apply ~mark_substituted env (`Gpath functor_path) + (`Gpath argument_path) functor_module + |> map_error (fun e -> `Parent (`Parent_expr e)) + >>= fun (_, m) -> Ok (Component.Delayed.put_val m) + | `Module (parent, name) -> + let find_in_sg sg sub = + match Find.careful_module_in_sig sg (ModuleName.to_string name) with + | None -> Error `Find_failure + | Some (`FModule (_, m)) -> + Ok (Component.Delayed.put_val (Subst.module_ sub m)) + | Some (`FModule_removed p) -> lookup_module ~mark_substituted env p + in + lookup_parent_gpath ~mark_substituted env parent + |> map_error (fun e -> (e :> simple_module_lookup_error)) + >>= fun (sg, sub) -> find_in_sg sg sub + | `Alias (p, _) -> lookup_module_gpath ~mark_substituted env p + | `Subst (_, p) -> lookup_module_gpath ~mark_substituted env p + | `Hidden p -> lookup_module_gpath ~mark_substituted env p + | `Canonical (p, _) -> lookup_module_gpath ~mark_substituted env p + | `OpaqueModule m -> lookup_module_gpath ~mark_substituted env m + and lookup_module : mark_substituted:bool -> Env.t -> @@ -617,9 +645,7 @@ and lookup_module : let lookup env (mark_substituted, (path : SignatureOfModuleMemo.M.key)) = match path with | `Local lpath -> Error (`Local (env, lpath)) - | `Identifier i -> - of_option ~error:(`Lookup_failure i) (Env.(lookup_by_id s_module) i env) - >>= fun (`Module (_, m)) -> Ok m + | `Gpath p -> lookup_module_gpath ~mark_substituted env p | `Substituted x -> lookup_module ~mark_substituted env x | `Apply (functor_path, argument_path) -> lookup_module ~mark_substituted env functor_path @@ -640,7 +666,10 @@ and lookup_module : lookup_parent ~mark_substituted env parent |> map_error (fun e -> (e :> simple_module_lookup_error)) >>= fun (sg, sub) -> find_in_sg sg sub - | `Alias (_, p) -> lookup_module ~mark_substituted env p + | `Alias (_, cs, _) -> ( + match resolve_module ~mark_substituted ~add_canonical:false env cs with + | Ok (_, r) -> Ok r + | Error e -> Error e) | `Subst (_, p) -> lookup_module ~mark_substituted env p | `Hidden p -> lookup_module ~mark_substituted env p | `Canonical (p, _) -> lookup_module ~mark_substituted env p @@ -648,6 +677,32 @@ and lookup_module : in LookupModuleMemo.memoize lookup env' (m, path') +and lookup_module_type_gpath : + mark_substituted:bool -> + Env.t -> + Odoc_model.Paths.Path.Resolved.ModuleType.t -> + (Component.ModuleType.t, simple_module_type_lookup_error) Result.result = + fun ~mark_substituted env path -> + match path with + | `Identifier i -> + of_option ~error:(`Lookup_failureMT i) + (Env.(lookup_by_id s_module_type) i env) + >>= fun (`ModuleType (_, mt)) -> Ok mt + | `CanonicalModuleType (s, _) | `SubstT (_, s) -> + lookup_module_type_gpath ~mark_substituted env s + | `ModuleType (parent, name) -> + let find_in_sg sg sub = + match Find.module_type_in_sig sg (ModuleTypeName.to_string name) with + | None -> Error `Find_failure + | Some (`FModuleType (_, mt)) -> Ok (Subst.module_type sub mt) + in + lookup_parent_gpath ~mark_substituted env parent + |> map_error (fun e -> (e :> simple_module_type_lookup_error)) + >>= fun (sg, sub) -> find_in_sg sg sub + | `AliasModuleType (_, mt) -> + lookup_module_type_gpath ~mark_substituted env mt + | `OpaqueModuleType m -> lookup_module_type_gpath ~mark_substituted env m + and lookup_module_type : mark_substituted:bool -> Env.t -> @@ -657,10 +712,7 @@ and lookup_module_type : let lookup env = match path with | `Local l -> Error (`LocalMT (env, l)) - | `Identifier i -> - of_option ~error:(`Lookup_failureMT i) - (Env.(lookup_by_id s_module_type) i env) - >>= fun (`ModuleType (_, mt)) -> Ok mt + | `Gpath p -> lookup_module_type_gpath ~mark_substituted env p | `Substituted s | `CanonicalModuleType (s, _) | `SubstT (_, s) -> lookup_module_type ~mark_substituted env s | `ModuleType (parent, name) -> @@ -709,6 +761,98 @@ and lookup_parent : in LookupParentMemo.memoize lookup env' (m, parent') +and lookup_parent_gpath : + mark_substituted:bool -> + Env.t -> + Odoc_model.Paths.Path.Resolved.Module.t -> + ( Component.Signature.t * Component.Substitution.t, + [ `Parent of parent_lookup_error ] ) + Result.result = + fun ~mark_substituted env parent -> + lookup_module_gpath ~mark_substituted env parent + |> map_error (fun e -> `Parent (`Parent_module e)) + >>= fun m -> + let m = Component.Delayed.get m in + signature_of_module env m |> map_error (fun e -> `Parent (`Parent_sig e)) + >>= fun sg -> Ok (sg, prefix_substitution (`Module (`Gpath parent)) sg) + +and lookup_type_gpath : + Env.t -> + Odoc_model.Paths.Path.Resolved.Type.t -> + (Find.careful_type, simple_type_lookup_error) Result.result = + fun env p -> + let do_type p name = + lookup_parent_gpath ~mark_substituted:true env p + |> map_error (fun e -> (e :> simple_type_lookup_error)) + >>= fun (sg, sub) -> + match Find.careful_type_in_sig sg name with + | Some (`FClass (name, c)) -> Ok (`FClass (name, Subst.class_ sub c)) + | Some (`FClassType (name, ct)) -> + Ok (`FClassType (name, Subst.class_type sub ct)) + | Some (`FType (name, t)) -> Ok (`FType (name, Subst.type_ sub t)) + | Some (`FType_removed (name, texpr, eq)) -> + Ok (`FType_removed (name, Subst.type_expr sub texpr, eq)) + | None -> Error `Find_failure + in + let res = + match p with + | `Identifier { iv = `CoreType name; _ } -> + (* CoreTypes aren't put into the environment, so they can't be handled by the + next clause. We just look them up here in the list of core types *) + Ok (`FType (name, List.assoc (TypeName.to_string name) core_types)) + | `Identifier ({ iv = `Type _; _ } as i) -> + of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_type) i env) + >>= fun (`Type ({ iv = `CoreType name | `Type (_, name); _ }, t)) -> + Ok (`FType (name, t)) + | `Identifier ({ iv = `Class _; _ } as i) -> + of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_class) i env) + >>= fun (`Class ({ iv = `Class (_, name); _ }, t)) -> + Ok (`FClass (name, t)) + | `Identifier ({ iv = `ClassType _; _ } as i) -> + of_option ~error:(`Lookup_failureT i) + (Env.(lookup_by_id s_class_type) i env) + >>= fun (`ClassType ({ iv = `ClassType (_, name); _ }, t)) -> + Ok (`FClassType (name, t)) + | `CanonicalType (t1, _) -> lookup_type_gpath env t1 + | `Type (p, id) -> do_type p (TypeName.to_string id) + | `Class (p, id) -> do_type p (ClassName.to_string id) + | `ClassType (p, id) -> do_type p (ClassTypeName.to_string id) + in + res + +and lookup_class_type_gpath : + Env.t -> + Odoc_model.Paths.Path.Resolved.ClassType.t -> + (Find.careful_class, simple_type_lookup_error) Result.result = + fun env p -> + let do_type p name = + lookup_parent_gpath ~mark_substituted:true env p + |> map_error (fun e -> (e :> simple_type_lookup_error)) + >>= fun (sg, sub) -> + match Find.careful_class_in_sig sg name with + | Some (`FClass (name, c)) -> Ok (`FClass (name, Subst.class_ sub c)) + | Some (`FClassType (name, ct)) -> + Ok (`FClassType (name, Subst.class_type sub ct)) + | Some (`FType_removed (name, texpr, eq)) -> + Ok (`FType_removed (name, Subst.type_expr sub texpr, eq)) + | None -> Error `Find_failure + in + let res = + match p with + | `Identifier ({ iv = `Class _; _ } as i) -> + of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_class) i env) + >>= fun (`Class ({ iv = `Class (_, name); _ }, t)) -> + Ok (`FClass (name, t)) + | `Identifier ({ iv = `ClassType _; _ } as i) -> + of_option ~error:(`Lookup_failureT i) + (Env.(lookup_by_id s_class_type) i env) + >>= fun (`ClassType ({ iv = `ClassType (_, name); _ }, t)) -> + Ok (`FClassType (name, t)) + | `Class (p, id) -> do_type p (ClassName.to_string id) + | `ClassType (p, id) -> do_type p (ClassTypeName.to_string id) + in + res + and lookup_type : Env.t -> Cpath.Resolved.type_ -> @@ -732,22 +876,7 @@ and lookup_type : let res = match p with | `Local id -> Error (`LocalType (env, id)) - | `Identifier (`CoreType name) -> - (* CoreTypes aren't put into the environment, so they can't be handled by the - next clause. We just look them up here in the list of core types *) - Ok (`FType (name, List.assoc (TypeName.to_string name) core_types)) - | `Identifier (`Type _ as i) -> - of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_type) i env) - >>= fun (`Type ((`CoreType name | `Type (_, name)), t)) -> - Ok (`FType (name, t)) - | `Identifier (`Class _ as i) -> - of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_class) i env) - >>= fun (`Class (`Class (_, name), t)) -> Ok (`FClass (name, t)) - | `Identifier (`ClassType _ as i) -> - of_option ~error:(`Lookup_failureT i) - (Env.(lookup_by_id s_class_type) i env) - >>= fun (`ClassType (`ClassType (_, name), t)) -> - Ok (`FClassType (name, t)) + | `Gpath p -> lookup_type_gpath env p | `CanonicalType (t1, _) -> lookup_type env t1 | `Substituted s -> lookup_type env s | `Type (p, id) -> do_type p (TypeName.to_string id) @@ -778,14 +907,7 @@ and lookup_class_type : let res = match p with | `Local id -> Error (`LocalType (env, (id :> Ident.path_type))) - | `Identifier (`Class _ as i) -> - of_option ~error:(`Lookup_failureT i) (Env.(lookup_by_id s_class) i env) - >>= fun (`Class (`Class (_, name), t)) -> Ok (`FClass (name, t)) - | `Identifier (`ClassType _ as i) -> - of_option ~error:(`Lookup_failureT i) - (Env.(lookup_by_id s_class_type) i env) - >>= fun (`ClassType (`ClassType (_, name), t)) -> - Ok (`FClassType (name, t)) + | `Gpath p -> lookup_class_type_gpath env p | `Substituted s -> lookup_class_type env s | `Class (p, id) -> do_type p (ClassName.to_string id) | `ClassType (p, id) -> do_type p (ClassTypeName.to_string id) @@ -831,13 +953,14 @@ and resolve_module : | `Identifier (i, hidden) -> of_option ~error:(`Lookup_failure i) (Env.(lookup_by_id s_module) i env) >>= fun (`Module (_, m)) -> - let p = if hidden then `Hidden (`Identifier i) else `Identifier i in + let rp = + if hidden then `Hidden (`Gpath (`Identifier i)) + else `Gpath (`Identifier i) + in Ok - (process_module_path env ~add_canonical (Component.Delayed.get m) p, m) + ( process_module_path env ~add_canonical (Component.Delayed.get m) rp, + m ) | `Local (p, _) -> Error (`Local (env, p)) - | `Resolved (`Identifier i as resolved_path) -> - of_option ~error:(`Lookup_failure i) (Env.(lookup_by_id s_module) i env) - >>= fun (`Module (_, m)) -> Ok (resolved_path, m) | `Resolved r -> lookup_module ~mark_substituted env r >>= fun m -> Ok (r, m) | `Substituted s -> resolve_module ~mark_substituted ~add_canonical env s @@ -847,7 +970,8 @@ and resolve_module : match Env.lookup_root_module r env with | Some (Env.Resolved (_, p, m)) -> let p = - `Identifier (p :> Odoc_model.Paths.Identifier.Path.Module.t) + `Gpath + (`Identifier (p :> Odoc_model.Paths.Identifier.Path.Module.t)) in let p = process_module_path env ~add_canonical m p in Ok (p, Component.Delayed.put_val m) @@ -893,7 +1017,7 @@ and resolve_module_type : of_option ~error:(`Lookup_failureMT i) (Env.(lookup_by_id s_module_type) i env) >>= fun (`ModuleType (_, mt)) -> - let p = `Identifier i in + let p = `Gpath (`Identifier i) in let p' = process_module_type env ~add_canonical mt p in Ok (p', mt) | `Local (l, _) -> Error (`LocalMT (env, l)) @@ -967,7 +1091,8 @@ and resolve_type : in Ok (p', t) | `Identifier (i, _) -> - lookup_type env (`Identifier i) >>= fun t -> Ok (`Identifier i, t) + let i' = `Identifier i in + lookup_type env (`Gpath i') >>= fun t -> Ok (`Gpath i', t) | `Resolved r -> lookup_type env r >>= fun t -> Ok (r, t) | `Local (l, _) -> Error (`LocalType (env, l)) | `Substituted s -> @@ -1003,7 +1128,9 @@ and resolve_class_type : Env.t -> Cpath.class_type -> resolve_class_type_result in Ok (p', t) | `Identifier (i, _) -> - lookup_class_type env (`Identifier i) >>= fun t -> Ok (`Identifier i, t) + let i' = `Identifier i in + let id = `Gpath i' in + lookup_class_type env id >>= fun t -> Ok (id, t) | `Resolved r -> lookup_class_type env r >>= fun t -> Ok (r, t) | `Local (l, _) -> Error (`LocalType (env, (l :> Ident.path_type))) | `Substituted s -> @@ -1035,32 +1162,89 @@ and resolve_class_type : Env.t -> Cpath.class_type -> resolve_class_type_result in Ok (p', t) +and reresolve_module_gpath : + Env.t -> + Odoc_model.Paths.Path.Resolved.Module.t -> + Odoc_model.Paths.Path.Resolved.Module.t = + fun env path -> + match path with + | `Identifier _ -> path + | `Apply (functor_path, argument_path) -> + `Apply + ( reresolve_module_gpath env functor_path, + reresolve_module_gpath env argument_path ) + | `Module (parent, name) -> `Module (reresolve_module_gpath env parent, name) + | `Alias (p1, `Resolved p2) -> + `Alias + ( reresolve_module_gpath env p1, + `Resolved (reresolve_module_gpath env p2) ) + | `Alias (p1, p2) -> + let dest' = reresolve_module_gpath env p1 in + let p2' = + if + Odoc_model.Paths.Path.Resolved.Module.is_hidden + ~weak_canonical_test:false dest' + then + let cp2 = Component.Of_Lang.(module_path (empty ()) p2) in + match + resolve_module env ~mark_substituted:false ~add_canonical:true cp2 + with + | Ok (p2', _) -> + Lang_of.( + Path.module_ (empty ()) (`Resolved (reresolve_module env p2'))) + | Error _ -> p2 + else p2 + in + `Alias (dest', p2') + | `Subst (p1, p2) -> + `Subst (reresolve_module_type_gpath env p1, reresolve_module_gpath env p2) + | `Hidden p -> + let p' = reresolve_module_gpath env p in + `Hidden p' + | `Canonical (p, (`Resolved _ as p2)) -> + `Canonical (reresolve_module_gpath env p, p2) + | `Canonical (p, p2) -> + `Canonical (reresolve_module_gpath env p, handle_canonical_module env p2) + | `OpaqueModule m -> `OpaqueModule (reresolve_module_gpath env m) + and reresolve_module : Env.t -> Cpath.Resolved.module_ -> Cpath.Resolved.module_ = fun env path -> match path with - | `Local _ | `Identifier _ -> path + | `Local _ -> path + | `Gpath g -> `Gpath (reresolve_module_gpath env g) | `Substituted x -> `Substituted (reresolve_module env x) | `Apply (functor_path, argument_path) -> `Apply (reresolve_module env functor_path, reresolve_module env argument_path) | `Module (parent, name) -> `Module (reresolve_parent env parent, name) - | `Alias (p1, p2) -> `Alias (reresolve_module env p1, reresolve_module env p2) + | `Alias (p1, `Resolved p2, p3) -> + `Alias (reresolve_module env p1, `Resolved (reresolve_module env p2), p3) + | `Alias (p1, p2, p3) -> + let dest' = reresolve_module env p1 in + if Cpath.is_resolved_module_hidden ~weak_canonical_test:false dest' then + match + resolve_module env ~mark_substituted:false ~add_canonical:true p2 + with + | Ok (`Alias (_, _, Some p3), _) -> reresolve_module env p3 + | _ -> `Alias (dest', p2, p3) + else `Alias (dest', p2, p3) | `Subst (p1, p2) -> `Subst (reresolve_module_type env p1, reresolve_module env p2) | `Hidden p -> let p' = reresolve_module env p in `Hidden p' | `Canonical (p, `Resolved p2) -> - `Canonical (reresolve_module env p, `Resolved (reresolve_module env p2)) - | `Canonical (p, p2) -> - `Canonical (reresolve_module env p, handle_canonical_module env p2) + `Canonical (reresolve_module env p, `Resolved p2) + | `Canonical (p, p2) -> ( + match handle_canonical_module env p2 with + | `Resolved _ as r -> `Canonical (p, r) + | r -> `Canonical (reresolve_module env p, r)) | `OpaqueModule m -> `OpaqueModule (reresolve_module env m) and handle_canonical_module env p2 = - let strip_alias : Cpath.Resolved.module_ -> Cpath.Resolved.module_ = function - | `Alias (_, p) -> p - | p -> p + let strip_alias : Cpath.Resolved.module_ -> Cpath.Resolved.module_ = + fun x -> match x with `Alias (_, _, Some p) -> p | _ -> x in let resolve env p = resolve_module env ~mark_substituted:false ~add_canonical:false p @@ -1070,7 +1254,8 @@ and handle_canonical_module env p2 = (Lang_of.(Path.resolved_module (empty ()) cpath) :> Odoc_model.Paths.Path.Resolved.t) in - match canonical_helper env resolve lang_of c_mod_poss p2 with + let cp2 = Component.Of_Lang.(module_path (empty ()) p2) in + match canonical_helper env resolve lang_of c_mod_poss cp2 with | None -> p2 | Some (rp, m) -> let m = Component.Delayed.get m in @@ -1120,10 +1305,14 @@ and handle_canonical_module env p2 = | Alias (_, _) -> false | ModuleType _ -> true in - if expanded then `Resolved rp - else `Resolved (process_module_path env ~add_canonical:false m rp) + let cpath = + if expanded then rp + else process_module_path env ~add_canonical:false m rp + in + `Resolved Lang_of.(Path.resolved_module (empty ()) cpath) -and handle_canonical_module_type env (p2 : Cpath.module_type) = +and handle_canonical_module_type env p2 = + let cp2 = Component.Of_Lang.(module_type_path (empty ()) p2) in let strip_alias : Cpath.Resolved.module_type -> Cpath.Resolved.module_type = function | `AliasModuleType (_, p) -> p @@ -1131,17 +1320,22 @@ and handle_canonical_module_type env (p2 : Cpath.module_type) = in let resolve env p = resolve_module_type env ~mark_substituted:false ~add_canonical:false p - >>= fun (p, m) -> Ok (strip_alias p, m) + >>= fun (p, m) -> + (* Note, we reresolve here in case any parent module has a canonical + constructor to deal with - we know there's no canonicalmoduletype as we've + explicitly asked for it not to be added *) + Ok (reresolve_module_type env (strip_alias p), m) in let lang_of cpath = (Lang_of.(Path.resolved_module_type (empty ()) cpath) :> Odoc_model.Paths.Path.Resolved.t) in - match canonical_helper env resolve lang_of c_modty_poss p2 with + match canonical_helper env resolve lang_of c_modty_poss cp2 with | None -> p2 - | Some (rp, _) -> `Resolved rp + | Some (rp, _) -> `Resolved Lang_of.(Path.resolved_module_type (empty ()) rp) -and handle_canonical_type env (p2 : Cpath.type_) = +and handle_canonical_type env p2 = + let cp2 = Component.Of_Lang.(type_path (empty ()) p2) in let lang_of cpath = (Lang_of.(Path.resolved_type (empty ()) cpath) :> Odoc_model.Paths.Path.Resolved.t) @@ -1149,23 +1343,47 @@ and handle_canonical_type env (p2 : Cpath.type_) = let resolve env p = match resolve_type env ~add_canonical:false p with | Ok (_, `FType_removed _) -> Error `Find_failure - | Ok (x, y) -> Ok (x, y) + | Ok (x, y) -> + (* See comment in handle_canonical_module_type for why we're reresolving here *) + Ok (reresolve_type env x, y) | Error y -> Error y in - match canonical_helper env resolve lang_of c_ty_poss p2 with + match canonical_helper env resolve lang_of c_ty_poss cp2 with | None -> p2 - | Some (rp, _) -> `Resolved rp + | Some (rp, _) -> `Resolved Lang_of.(Path.resolved_type (empty ()) rp) + +and reresolve_module_type_gpath : + Env.t -> + Odoc_model.Paths.Path.Resolved.ModuleType.t -> + Odoc_model.Paths.Path.Resolved.ModuleType.t = + fun env path -> + match path with + | `Identifier _ -> path + | `ModuleType (parent, name) -> + `ModuleType (reresolve_module_gpath env parent, name) + | `CanonicalModuleType (p1, (`Resolved _ as p2)) -> + `CanonicalModuleType (reresolve_module_type_gpath env p1, p2) + | `CanonicalModuleType (p1, p2) -> + `CanonicalModuleType + (reresolve_module_type_gpath env p1, handle_canonical_module_type env p2) + | `SubstT (p1, p2) -> + `SubstT + (reresolve_module_type_gpath env p1, reresolve_module_type_gpath env p2) + | `AliasModuleType (p1, p2) -> + `AliasModuleType + (reresolve_module_type_gpath env p1, reresolve_module_type_gpath env p2) + | `OpaqueModuleType m -> `OpaqueModuleType (reresolve_module_type_gpath env m) and reresolve_module_type : Env.t -> Cpath.Resolved.module_type -> Cpath.Resolved.module_type = fun env path -> match path with - | `Local _ | `Identifier _ -> path + | `Local _ -> path + | `Gpath g -> `Gpath (reresolve_module_type_gpath env g) | `Substituted x -> `Substituted (reresolve_module_type env x) | `ModuleType (parent, name) -> `ModuleType (reresolve_parent env parent, name) - | `CanonicalModuleType (p1, `Resolved p2) -> - `CanonicalModuleType - (reresolve_module_type env p1, `Resolved (reresolve_module_type env p2)) + | `CanonicalModuleType (p1, (`Resolved _ as p2')) -> + `CanonicalModuleType (reresolve_module_type env p1, p2') | `CanonicalModuleType (p1, p2) -> `CanonicalModuleType (reresolve_module_type env p1, handle_canonical_module_type env p2) @@ -1180,7 +1398,7 @@ and reresolve_type : Env.t -> Cpath.Resolved.type_ -> Cpath.Resolved.type_ = fun env path -> let result = match path with - | `Identifier _ | `Local _ -> path + | `Gpath _ | `Local _ -> path | `Substituted s -> `Substituted (reresolve_type env s) | `CanonicalType (p1, p2) -> `CanonicalType (reresolve_type env p1, handle_canonical_type env p2) @@ -1195,7 +1413,7 @@ and reresolve_class_type : fun env path -> let result = match path with - | `Identifier _ | `Local _ -> path + | `Gpath _ | `Local _ -> path | `Substituted s -> `Substituted (reresolve_class_type env s) | `Class (p, n) -> `Class (reresolve_parent env p, n) | `ClassType (p, n) -> `ClassType (reresolve_parent env p, n) @@ -1669,16 +1887,11 @@ and find_external_module_path : | `Canonical (x, y) -> find_external_module_path x >>= fun x -> Some (`Canonical (x, y)) | `Hidden x -> find_external_module_path x >>= fun x -> Some (`Hidden x) - | `Alias (x, y) -> ( - match (find_external_module_path x, find_external_module_path y) with - | Some x, Some y -> Some (`Alias (x, y)) - | Some x, None -> Some x - | None, Some x -> Some x - | None, None -> None) + | `Alias _ -> None | `Apply (x, y) -> find_external_module_path x >>= fun x -> find_external_module_path y >>= fun y -> Some (`Apply (x, y)) - | `Identifier x -> Some (`Identifier x) + | `Gpath x -> Some (`Gpath x) | `OpaqueModule m -> find_external_module_path m >>= fun x -> Some (`OpaqueModule x) @@ -1695,7 +1908,7 @@ and find_external_module_type_path : find_external_module_type_path y >>= fun y -> Some (`SubstT (x, y)) | `CanonicalModuleType (x, _) | `Substituted x -> find_external_module_type_path x >>= fun x -> Some (`Substituted x) - | `Identifier _ -> Some p + | `Gpath _ -> Some p | `AliasModuleType (x, y) -> ( match (find_external_module_type_path x, find_external_module_type_path y) @@ -1800,7 +2013,8 @@ and resolve_signature_fragment : let cp', f' = match modifier with | None -> (new_path, new_frag) - | Some (`Aliased p') -> (`Alias (p', new_path), `Alias (p', new_frag)) + | Some (`Aliased p') -> + (`Alias (p', `Resolved new_path, None), `Alias (p', new_frag)) | Some (`SubstMT p') -> (`Subst (p', new_path), `Subst (p', new_frag)) in (* Don't use the cached one - `FragmentRoot` is not unique *) @@ -1946,7 +2160,9 @@ let resolve_module_path env p = resolve_module ~mark_substituted:true ~add_canonical:true env p >>= fun (p, m) -> match p with - | `Identifier (`Root _) | `Hidden (`Identifier (`Root _)) -> Ok p + | `Gpath (`Identifier { iv = `Root _; _ }) + | `Hidden (`Gpath (`Identifier { iv = `Root _; _ })) -> + Ok p | _ -> ( let m = Component.Delayed.get m in match signature_of_module_cached env p m with diff --git a/test/generators/html/Ocamlary.html b/test/generators/html/Ocamlary.html index a77e59142c..88d4d2d236 100644 --- a/test/generators/html/Ocamlary.html +++ b/test/generators/html/Ocamlary.html @@ -2437,8 +2437,8 @@

With5 and type - M.N.t = - With5.N.t + M.N.t = + With5.N.t diff --git a/test/model/semantics/test.ml b/test/model/semantics/test.ml index 8abe7027fb..2c473e2a44 100644 --- a/test/model/semantics/test.ml +++ b/test/model/semantics/test.ml @@ -18,7 +18,9 @@ let parser_output_desc = let test ?(sections_allowed = `No_titles) ?(location = { Location_.line = 1; column = 0 }) str = let dummy_filename = "f.ml" in - let dummy_page = `Page (None, Names.PageName.make_std dummy_filename) in + let dummy_page = + Paths.Identifier.Mk.page (None, Names.PageName.make_std dummy_filename) + in let location = { Lexing.pos_fname = dummy_filename; diff --git a/test/xref2/canonical_alias.t/run.t b/test/xref2/canonical_alias.t/run.t index 7e4e7f88a4..30d4fd3d4a 100644 --- a/test/xref2/canonical_alias.t/run.t +++ b/test/xref2/canonical_alias.t/run.t @@ -132,17 +132,20 @@ Should resove to be an alias! } }, { - "`Identifier": { - "`Module": [ - { - "`Root": [ - "None", - "Test" - ] - }, - "C" - ] - } + "`Identifier": [ + { + "`Module": [ + { + "`Root": [ + "None", + "Test" + ] + }, + "C" + ] + }, + "false" + ] } ] } diff --git a/test/xref2/canonical_module.t/run.t b/test/xref2/canonical_module.t/run.t index bf2de19472..dac3d73c25 100644 --- a/test/xref2/canonical_module.t/run.t +++ b/test/xref2/canonical_module.t/run.t @@ -22,8 +22,8 @@ Every references should be marked as canonical: $ odoc_print test.odocl | jq -c ".content.Module.items | .[] | .Module[1].type_.Alias[0] | select(.)" {"`Resolved":{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_x"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X"]}}}]}} - {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_x"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X"]}}}]},"Out"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X_out"]}}}]}} - {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_x"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X"]}}}]},"In"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X_in"]}}}]}} + {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_x"]}},{"`Dot":[{"`Root":"Test"},"X"]}]},"Out"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X_out"]}}}]}} + {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_x"]}},{"`Dot":[{"`Root":"Test"},"X"]}]},"In"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"X_in"]}}}]}} {"`Resolved":{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_y"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y"]}}}]}} - {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_y"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y"]}}}]},"Out"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y_out"]}}}]}} - {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_y"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y"]}}}]},"In"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y_in"]}}}]}} + {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_y"]}},{"`Dot":[{"`Root":"Test"},"Y"]}]},"Out"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y_out"]}}}]}} + {"`Resolved":{"`Canonical":[{"`Module":[{"`Canonical":[{"`Identifier":{"`Root":[{"Some":{"`Page":["None","test"]}},"Test_y"]}},{"`Dot":[{"`Root":"Test"},"Y"]}]},"In"]},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"Some":{"`Page":["None","test"]}},"Test"]},"Y_in"]}}}]}} diff --git a/test/xref2/lib/common.cppo.ml b/test/xref2/lib/common.cppo.ml index c3f258d7b6..4ee7097199 100644 --- a/test/xref2/lib/common.cppo.ml +++ b/test/xref2/lib/common.cppo.ml @@ -34,8 +34,8 @@ let cmt_of_string s = let p = Parse.implementation l in Typemod.type_implementation "" "" "" env p -let parent = `Page (None, Odoc_model.Names.PageName.make_std "None") -let id = `Root (Some parent, Odoc_model.Names.ModuleName.make_std "Root") +let parent = Odoc_model.Paths.Identifier.Mk.page (None, Odoc_model.Names.PageName.make_std "None") +let id = Odoc_model.Paths.Identifier.Mk.root (Some parent, Odoc_model.Names.ModuleName.make_std "Root") let root_of_compilation_unit ~package ~hidden ~module_name ~digest = ignore(package); @@ -57,7 +57,7 @@ let root = let root_identifier = `Identifier id -let root_module name = `Module (id, Odoc_model.Names.ModuleName.make_std name) +let root_module name = Odoc_model.Paths.Identifier.Mk.module_ (id, Odoc_model.Names.ModuleName.make_std name) let root_pp fmt (_ : Odoc_model.Root.t) = Format.fprintf fmt "Common.root" @@ -399,7 +399,7 @@ module LangUtils = struct let rec inner = function | Odoc_model.Lang.Signature.Module (_, m) :: rest -> begin let id = m.Odoc_model.Lang.Module.id in - match id with + match id.iv with | `Module (_, mname') -> if Odoc_model.Names.ModuleName.to_string mname' = mname then m @@ -426,7 +426,7 @@ module LangUtils = struct type 'a fmt = Format.formatter -> 'a -> unit open Paths - val identifier : [< Identifier.t] fmt + val identifier : [< Identifier.t_pv] Paths.id fmt open Lang @@ -558,7 +558,7 @@ module LangUtils = struct match p with | `Apply (p1, p2) -> Format.fprintf ppf "%a(%a)" resolved_path (cast p1) resolved_path (cast p2) | `Identifier p -> Format.fprintf ppf "global(%a)" identifier p - | `Alias (path, realpath) -> Format.fprintf ppf "(%a -> %a)" resolved_path (cast path) resolved_path (cast realpath) + | `Alias (dest, src) -> Format.fprintf ppf "(%a -> %a)" path (src :> Odoc_model.Paths.Path.t) resolved_path (cast dest) | `AliasModuleType (path, realpath) -> Format.fprintf ppf "(%a -> %a)" resolved_path (cast path) resolved_path (cast realpath) | `Subst (modty, m) -> Format.fprintf ppf "(%a subst-> %a)" resolved_path (cast modty) resolved_path (cast m) | `Module (p, m) -> Format.fprintf ppf "%a.%s" resolved_path (cast p) (Odoc_model.Names.ModuleName.to_string m) diff --git a/test/xref2/refs/refs.md b/test/xref2/refs/refs.md index f8f1d3b41d..7a68d3b30a 100644 --- a/test/xref2/refs/refs.md +++ b/test/xref2/refs/refs.md @@ -92,67 +92,293 @@ Explicit, root: ```ocaml # resolve_ref "module:M" ;; -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"} # resolve_ref "module:M.N" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N) # resolve_ref "val:f1" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), f1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + f1); + ihash = 10878772; ikey = "v_f1.r_Root.p_None"} # resolve_ref "type:t1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"} # resolve_ref "module-type:T1" ;; - : ref = -`Identifier (`ModuleType (`Root (Some (`Page (None, None)), Root), T1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + T1); + ihash = 936384557; ikey = "mt_T1.r_Root.p_None"} # resolve_ref "exception:E1" ;; - : ref = -`Identifier (`Exception (`Root (Some (`Page (None, None)), Root), E1)) +`Identifier + {Odoc_model__Paths_types.iv = + `Exception + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + E1); + ihash = 509481329; ikey = "exn_E1.r_Root.p_None"} # resolve_ref "constructor:C1" ;; - : ref = `Identifier - (`Constructor (`Type (`Root (Some (`Page (None, None)), Root), t1), C1)) + {Odoc_model__Paths_types.iv = + `Constructor + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1); + ihash = 1004467392; ikey = "ctor_C1.t_t1.r_Root.p_None"} # resolve_ref "val:e1" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), e1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + e1); + ihash = 708293633; ikey = "v_e1.r_Root.p_None"} # resolve_ref "class:c1" ;; -- : ref = `Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"} # resolve_ref "class-type:ct1" ;; - : ref = -`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"} # resolve_ref "type:x1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), x1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x1); + ihash = 421257688; ikey = "t_x1.r_Root.p_None"} # resolve_ref "constructor:X1" (* X1 is an extension constructor *) ;; Exception: Failure "resolve_reference: Couldn't find \"X1\"". # resolve_ref "extension:X1" ;; - : ref = -`Identifier (`Extension (`Root (Some (`Page (None, None)), Root), X1)) +`Identifier + {Odoc_model__Paths_types.iv = + `Extension + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X1); + ihash = 711917142; ikey = "extn_X1.r_Root.p_None"} # resolve_ref "method:c1.m1" ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), m1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + m1) # resolve_ref "instance-variable:c1.v1" ;; - : ref = `InstanceVariable - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), v1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + v1) # resolve_ref "method:ct1.tm1" (* ct1 is a class type *) ;; - : ref = `Method - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tm1) # resolve_ref "instance-variable:ct1.tv1" ;; - : ref = `InstanceVariable - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tv1) # resolve_ref "field:rf1" ;; - : ref = `Identifier - (`Field (`Type (`Root (Some (`Page (None, None)), Root), r1), rf1)) + {Odoc_model__Paths_types.iv = + `Field + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1); + ihash = 85235953; ikey = "fld_rf1.t_r1.r_Root.p_None"} # resolve_ref "field:r1.rf1" ;; - : ref = `Field - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), r1)), rf1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1) # resolve_ref "section:L1" ;; -- : ref = `Identifier (`Label (`Root (Some (`Page (None, None)), Root), L1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Label + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + L1); + ihash = 612985552; ikey = "l_L1.r_Root.p_None"} ``` Explicit, in sig: @@ -161,150 +387,566 @@ Explicit, in sig: # resolve_ref "val:M.f2" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), f2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + f2) # resolve_ref "type:M.t2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2) # resolve_ref "module-type:M.T2" ;; - : ref = `ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T2) # resolve_ref "exception:M.E2" ;; - : ref = `Exception - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), E2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + E2) # resolve_ref "constructor:M.C2" (* Not allowed by types *) ;; Exception: Failure "resolve_reference: Couldn't find \"M\"". # resolve_ref "val:M.e2" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), e2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + e2) # resolve_ref "class:M.c2" ;; - : ref = `Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2) # resolve_ref "class-type:M.ct2" ;; - : ref = `ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), ct2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + ct2) # resolve_ref "type:M.x2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), x2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + x2) # resolve_ref "constructor:M.X2" (* X2 is an extension constructor *) ;; Exception: Failure "resolve_reference: Couldn't find \"M\"". # resolve_ref "extension:M.X2" ;; - : ref = `Extension - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), X2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + X2) # resolve_ref "method:M.c2.m2" ;; - : ref = `Method (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), m2) # resolve_ref "instance-variable:M.c2.v2" ;; - : ref = `InstanceVariable (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), v2) # resolve_ref "method:M.ct2.tm2" (* ct2 is a class type *) ;; - : ref = `Method (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tm2) # resolve_ref "instance-variable:M.ct2.tv2" ;; - : ref = `InstanceVariable (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tv2) # resolve_ref "field:M.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "field:M.r2.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "section:M.L2" ;; - : ref = `Label - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), L2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + L2) ``` Implicit, root: ```ocaml # resolve_ref "M" ;; -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"} # resolve_ref "M.N" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N) # resolve_ref "f1" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), f1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + f1); + ihash = 10878772; ikey = "v_f1.r_Root.p_None"} # resolve_ref "t1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"} # resolve_ref "T1" ;; - : ref = -`Identifier (`ModuleType (`Root (Some (`Page (None, None)), Root), T1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + T1); + ihash = 936384557; ikey = "mt_T1.r_Root.p_None"} # resolve_ref "E1" ;; - : ref = -`Identifier (`Exception (`Root (Some (`Page (None, None)), Root), E1)) +`Identifier + {Odoc_model__Paths_types.iv = + `Exception + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + E1); + ihash = 509481329; ikey = "exn_E1.r_Root.p_None"} # resolve_ref "C1" ;; - : ref = `Identifier - (`Constructor (`Type (`Root (Some (`Page (None, None)), Root), t1), C1)) + {Odoc_model__Paths_types.iv = + `Constructor + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1); + ihash = 1004467392; ikey = "ctor_C1.t_t1.r_Root.p_None"} # resolve_ref "e1" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), e1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + e1); + ihash = 708293633; ikey = "v_e1.r_Root.p_None"} # resolve_ref "c1" ;; -- : ref = `Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"} # resolve_ref "ct1" ;; - : ref = -`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"} # resolve_ref "x1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), x1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x1); + ihash = 421257688; ikey = "t_x1.r_Root.p_None"} # resolve_ref "X1" ;; - : ref = -`Identifier (`Extension (`Root (Some (`Page (None, None)), Root), X1)) +`Identifier + {Odoc_model__Paths_types.iv = + `Extension + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X1); + ihash = 711917142; ikey = "extn_X1.r_Root.p_None"} # resolve_ref "c1.m1" ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), m1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + m1) # resolve_ref "c1.v1" ;; - : ref = `InstanceVariable - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), v1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + v1) # resolve_ref "ct1.tm1" (* ct1 is a class type *) ;; - : ref = `Method - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tm1) # resolve_ref "ct1.tv1" ;; - : ref = `InstanceVariable - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tv1) # resolve_ref "rf1" ;; - : ref = `Identifier - (`Field (`Type (`Root (Some (`Page (None, None)), Root), r1), rf1)) + {Odoc_model__Paths_types.iv = + `Field + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1); + ihash = 85235953; ikey = "fld_rf1.t_r1.r_Root.p_None"} # resolve_ref "r1.rf1" ;; - : ref = `Field - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), r1)), rf1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1) # resolve_ref "L1" ;; -- : ref = `Identifier (`Label (`Root (Some (`Page (None, None)), Root), L1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Label + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + L1); + ihash = 612985552; ikey = "l_L1.r_Root.p_None"} ``` Implicit, in sig: @@ -313,291 +955,1015 @@ Implicit, in sig: # resolve_ref "M.f2" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), f2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + f2) # resolve_ref "M.t2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2) # resolve_ref "M.T2" ;; - : ref = `ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T2) # resolve_ref "M.E2" ;; - : ref = `Exception - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), E2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + E2) # resolve_ref "M.C2" ;; - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2), C2) # resolve_ref "M.e2" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), e2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + e2) # resolve_ref "M.c2" ;; - : ref = `Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2) # resolve_ref "M.ct2" ;; - : ref = `ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), ct2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + ct2) # resolve_ref "M.x2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), x2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + x2) # resolve_ref "M.X2" ;; - : ref = `Extension - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), X2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + X2) # resolve_ref "M.c2.m2" ;; - : ref = `Method (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), m2) # resolve_ref "M.c2.v2" ;; - : ref = `InstanceVariable (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), v2) # resolve_ref "M.ct2.tm2" (* ct2 is a class type *) ;; - : ref = `Method (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tm2) # resolve_ref "M.ct2.tv2" ;; - : ref = `InstanceVariable (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tv2) # resolve_ref "M.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.r2.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.L2" ;; - : ref = `Label - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), L2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + L2) ``` Known kind: ```ocaml # resolve_ref "module-M" ;; -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"} # resolve_ref "module-M.N" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N) # resolve_ref "M.module-N" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N) # resolve_ref "module-M.module-N" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N) # resolve_ref "type-t1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"} # resolve_ref "module-type-T1" ;; - : ref = -`Identifier (`ModuleType (`Root (Some (`Page (None, None)), Root), T1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + T1); + ihash = 936384557; ikey = "mt_T1.r_Root.p_None"} # resolve_ref "class-c1" ;; -- : ref = `Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"} # resolve_ref "class-type-ct1" ;; - : ref = -`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"} # resolve_ref "type-x1" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), x1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + x1); + ihash = 421257688; ikey = "t_x1.r_Root.p_None"} # resolve_ref "class-c1.m1" ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), m1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + m1) # resolve_ref "class-c1.v1" ;; - : ref = `InstanceVariable - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)), v1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"}, + v1) # resolve_ref "class-type-ct1.tm1" ;; - : ref = `Method - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tm1) # resolve_ref "class-type-ct1.tv1" ;; - : ref = `InstanceVariable - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"}, tv1) # resolve_ref "field-rf1" ;; - : ref = `Identifier - (`Field (`Type (`Root (Some (`Page (None, None)), Root), r1), rf1)) + {Odoc_model__Paths_types.iv = + `Field + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1); + ihash = 85235953; ikey = "fld_rf1.t_r1.r_Root.p_None"} # resolve_ref "type-r1.rf1" ;; - : ref = `Field - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), r1)), rf1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1) # resolve_ref "type-r1.field-rf1" ;; - : ref = `Field - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), r1)), rf1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + r1); + ihash = 489530714; ikey = "t_r1.r_Root.p_None"}, + rf1) # resolve_ref "section-L1" ;; -- : ref = `Identifier (`Label (`Root (Some (`Page (None, None)), Root), L1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Label + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + L1); + ihash = 612985552; ikey = "l_L1.r_Root.p_None"} # resolve_ref "M.type-t2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2) # resolve_ref "M.module-type-T2" ;; - : ref = `ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T2) # resolve_ref "M.class-c2" ;; - : ref = `Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2) # resolve_ref "M.class-type-ct2" ;; - : ref = `ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), ct2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + ct2) # resolve_ref "M.type-x2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), x2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + x2) # resolve_ref "M.class-c2.m2" ;; - : ref = `Method (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), m2) # resolve_ref "M.class-c2.v2" ;; - : ref = `InstanceVariable (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), v2) # resolve_ref "M.class-type-ct2.tm2" ;; - : ref = `Method (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tm2) # resolve_ref "M.class-type-ct2.tv2" ;; - : ref = `InstanceVariable (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tv2) # resolve_ref "M.type-r2.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.r2.field-rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.type-r2.field-rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.field-rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "M.section-L2" ;; - : ref = `Label - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), L2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + L2) # resolve_ref "module-M.type-t2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2) # resolve_ref "module-M.module-type-T2" ;; - : ref = `ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T2) # resolve_ref "module-M.class-c2" ;; - : ref = `Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2) # resolve_ref "module-M.class-type-ct2" ;; - : ref = `ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), ct2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + ct2) # resolve_ref "module-M.type-x2" ;; - : ref = `Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), x2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + x2) # resolve_ref "module-M.class-c2.m2" ;; - : ref = `Method (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), m2) # resolve_ref "module-M.class-c2.v2" ;; - : ref = `InstanceVariable (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), c2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + c2), v2) # resolve_ref "module-M.class-type-ct2.tm2" ;; - : ref = `Method (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tm2) # resolve_ref "module-M.class-type-ct2.tv2" ;; - : ref = `InstanceVariable (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, ct2), tv2) # resolve_ref "module-M.type-r2.rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "module-M.field-rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) # resolve_ref "module-M.section-L2" ;; - : ref = `Label - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), L2) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + L2) # resolve_ref "module-M.field-rf2" ;; - : ref = `Field (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), r2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + r2), rf2) ``` @@ -605,10 +1971,33 @@ Class and class type as type: ```ocaml # resolve_ref "type:c1" ;; -- : ref = `Identifier (`Class (`Root (Some (`Page (None, None)), Root), c1)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c1); + ihash = 391456819; ikey = "c_c1.r_Root.p_None"} # resolve_ref "type:ct1" ;; - : ref = -`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), ct1)) +`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + ct1); + ihash = 611389945; ikey = "ct_ct1.r_Root.p_None"} ``` Constructors in type parent: @@ -617,42 +2006,138 @@ Constructors in type parent: # resolve_ref "t1.C1" ;; - : ref = `Constructor - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)), C1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1) # resolve_ref "constructor:t1.C1" ;; - : ref = `Constructor - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)), C1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1) # resolve_ref "t1.constructor-C1" ;; - : ref = `Constructor - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)), C1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1) # resolve_ref "constructor:type-t1.C1" ;; - : ref = `Constructor - (`Identifier (`Type (`Root (Some (`Page (None, None)), Root), t1)), C1) + (`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t1); + ihash = 491588764; ikey = "t_t1.r_Root.p_None"}, + C1) # resolve_ref "M.t2.C2" ;; - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2), C2) # resolve_ref "constructor:M.t2.C2" ;; - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2), C2) # resolve_ref "M.t2.constructor-C2" ;; - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2), C2) # resolve_ref "constructor:M.type-t2.C2" ;; - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), t2), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t2), C2) ``` @@ -679,36 +2164,107 @@ let resolve_ref = resolve_ref_of_mli {| - : ref = `Type (`Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N), t) # resolve_ref "M.module-type-T.t" ;; - : ref = `Type (`ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T), t) # resolve_ref "M.N.type-t" ;; - : ref = `Type (`Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N), t) # resolve_ref "M.T.type-t" ;; - : ref = `Type (`ModuleType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), T), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + T), t) # resolve_ref "type:M.N.t" ;; - : ref = `Type (`Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), N), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + N), t) # resolve_ref "type:MT.t" ;; - : ref = `Type - (`Identifier (`ModuleType (`Root (Some (`Page (None, None)), Root), MT)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + MT); + ihash = 848305771; ikey = "mt_MT.r_Root.p_None"}, t) ``` @@ -760,13 +2316,48 @@ let resolve_ref = resolve_ref_of_mli {| ```ocaml # resolve_ref "A.t" ;; - : ref = -`Type (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), A)), t) +`Type + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + t) # resolve_ref "B.t" (* get_module_path_modifiers is [`Aliased] *) ;; - : ref = `Type (`Alias - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), A)), - `Identifier (`Module (`Root (Some (`Page (None, None)), Root), B))), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + `Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}), t) # resolve_ref "C.t" ;; Exception: @@ -774,14 +2365,49 @@ Failure "resolve_reference: Parent_sig: Unexpanded `module type of` expression: module type of identifier((root Root).A, false)". # resolve_ref "D.t" ;; - : ref = -`Type (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), D)), t) +`Type + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + D); + ihash = 200317817; ikey = "m_D.r_Root.p_None"}, + t) # resolve_ref "E.N.t" ;; - : ref = `Type (`Alias - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), A)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), E)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + E); + ihash = 359355766; ikey = "m_E.r_Root.p_None"}, N)), t) ``` @@ -804,42 +2430,147 @@ let resolve_ref = resolve_ref_of_mli {| # resolve_ref "type:M.cl" (* Type reference resolves to class *) ;; - : ref = `Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), cl) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + cl) # resolve_ref "type:M.clt" ;; - : ref = `ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), clt) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + clt) # resolve_ref "type:cl" (* Root TType reference resolves to class *) ;; -- : ref = `Identifier (`Class (`Root (Some (`Page (None, None)), Root), cl)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + cl); + ihash = 538739416; ikey = "c_cl.r_Root.p_None"} # resolve_ref "type:clt" ;; - : ref = -`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), clt)) +`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + clt); + ihash = 201394109; ikey = "ct_clt.r_Root.p_None"} # resolve_ref "M.type-cl.m" (* Type label parent resolves to class *) ;; - : ref = `Method (`Class - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), cl), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + cl), m) # resolve_ref "M.type-clt.m" ;; - : ref = `Method (`ClassType - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), M)), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, clt), m) # resolve_ref "type-cl.m" (* Root TType label parent resolves to class *) ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), cl)), m) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + cl); + ihash = 538739416; ikey = "c_cl.r_Root.p_None"}, + m) # resolve_ref "type-clt.m" ;; - : ref = `Method - (`Identifier (`ClassType (`Root (Some (`Page (None, None)), Root), clt)), + (`Identifier + {Odoc_model__Paths_types.iv = + `ClassType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + clt); + ihash = 201394109; ikey = "ct_clt.r_Root.p_None"}, m) # resolve_ref "method:cl.m" ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), cl)), m) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + cl); + ihash = 538739416; ikey = "c_cl.r_Root.p_None"}, + m) ``` It is not possible to reference to methods through type references: @@ -853,7 +2584,19 @@ val resolve_ref : string -> ref = # resolve_ref "type-c.m" ;; - : ref = `Method - (`Identifier (`Class (`Root (Some (`Page (None, None)), Root), c)), m) + (`Identifier + {Odoc_model__Paths_types.iv = + `Class + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + c); + ihash = 943327246; ikey = "c_c.r_Root.p_None"}, + m) # resolve_ref "type-c.method-m" ;; Exception: Failure "Expected 'class-', 'class-type-', or an unqualified reference.". @@ -971,11 +2714,35 @@ Ambiguous in env: # resolve_ref "t" ;; File "": Warning: Reference to 't' is ambiguous. Please specify its kind: type-t, val-t. -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), t)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 937245702; ikey = "v_t.r_Root.p_None"} # resolve_ref "X" ;; File "": Warning: Reference to 'X' is ambiguous. Please specify its kind: constructor-X, module-X. -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"} ``` Ambiguous in sig: @@ -985,14 +2752,39 @@ Ambiguous in sig: File "": Warning: Reference to 'u' is ambiguous. Please specify its kind: type-u, val-u. - : ref = -`Type (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u) +`Type + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u) # resolve_ref "X.Y" ;; File "": Warning: Reference to 'Y' is ambiguous. Please specify its kind: constructor-Y, module-Y. - : ref = `Constructor (`Type - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u), + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u), Y) # resolve_ref "Everything_ambiguous_in_sig.t" (* Some kinds are missing: label, type subst (would be "type-") *) ;; File "": @@ -1000,9 +2792,18 @@ Warning: Reference to 't' is ambiguous. Please specify its kind: field-t, module - : ref = `Type (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), - Everything_ambiguous_in_sig)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Everything_ambiguous_in_sig); + ihash = 290472412; + ikey = "m_Everything_ambiguous_in_sig.r_Root.p_None"}, t) # resolve_ref "Everything_ambiguous_in_sig.T" (* Missing kind: module subst (would be "module-") *) ;; File "": @@ -1010,9 +2811,18 @@ Warning: Reference to 'T' is ambiguous. Please specify its kind: exception-T, ex - : ref = `Module (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), - Everything_ambiguous_in_sig)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Everything_ambiguous_in_sig); + ihash = 290472412; + ikey = "m_Everything_ambiguous_in_sig.r_Root.p_None"}, T) ``` @@ -1020,54 +2830,228 @@ Unambiguous: ```ocaml # resolve_ref "type-t" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), t)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"} # resolve_ref "val-t" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), t)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 937245702; ikey = "v_t.r_Root.p_None"} # resolve_ref "constructor-X" ;; - : ref = `Identifier - (`Constructor (`Type (`Root (Some (`Page (None, None)), Root), t), X)) + {Odoc_model__Paths_types.iv = + `Constructor + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}, + X); + ihash = 255074693; ikey = "ctor_X.t_t.r_Root.p_None"} # resolve_ref "module-X" ;; -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"} # resolve_ref "X.type-u" ;; - : ref = -`Type (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u) +`Type + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u) # resolve_ref "X.val-u" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u) # resolve_ref "X.constructor-Y" ;; Exception: Failure "resolve_reference: Couldn't find \"X\"". # resolve_ref "X.module-Y" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), Y) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + Y) ``` Unambiguous 2: ```ocaml # resolve_ref "type:t" ;; -- : ref = `Identifier (`Type (`Root (Some (`Page (None, None)), Root), t)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"} # resolve_ref "val:t" ;; -- : ref = `Identifier (`Value (`Root (Some (`Page (None, None)), Root), t)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Value + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 937245702; ikey = "v_t.r_Root.p_None"} # resolve_ref "constructor:X" ;; - : ref = `Identifier - (`Constructor (`Type (`Root (Some (`Page (None, None)), Root), t), X)) + {Odoc_model__Paths_types.iv = + `Constructor + ({Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}, + X); + ihash = 255074693; ikey = "ctor_X.t_t.r_Root.p_None"} # resolve_ref "module:X" ;; -- : ref = `Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)) +- : ref = +`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"} # resolve_ref "type:X.u" ;; - : ref = -`Type (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u) +`Type + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u) # resolve_ref "val:X.u" ;; - : ref = `Value - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), u) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + u) # resolve_ref "constructor:X.Y" ;; Exception: Failure "resolve_reference: Couldn't find \"X\"". # resolve_ref "module:X.Y" ;; - : ref = `Module - (`Identifier (`Module (`Root (Some (`Page (None, None)), Root), X)), Y) + (`Identifier + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + X); + ihash = 895481052; ikey = "m_X.r_Root.p_None"}, + Y) ``` diff --git a/test/xref2/resolve/test.md b/test/xref2/resolve/test.md index 0ff866094f..83b713964c 100644 --- a/test/xref2/resolve/test.md +++ b/test/xref2/resolve/test.md @@ -76,7 +76,13 @@ Simplest possible resolution: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -84,7 +90,17 @@ Simplest possible resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -92,7 +108,17 @@ Simplest possible resolution: representation = None}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -101,7 +127,18 @@ Simplest possible resolution: (Odoc_model.Lang.TypeExpr.Constr (`Resolved (`Identifier - (`Type (`Root (Some (`Page (None, None)), Root), t))), + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}), [])); constraints = []}; representation = None})]; @@ -184,7 +221,13 @@ Basic resolution 2, environment lookup: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -192,7 +235,17 @@ Basic resolution 2, environment lookup: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -201,8 +254,22 @@ Basic resolution 2, environment lookup: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module (`Root (Some (`Page (None, None)), Root), M), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, + t); + ihash = 746522241; ikey = "t_t.m_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -212,7 +279,17 @@ Basic resolution 2, environment lookup: canonical = None; hidden = false}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -222,7 +299,18 @@ Basic resolution 2, environment lookup: (`Resolved (`Type (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 716453475; ikey = "m_M.r_Root.p_None"}, t)), [])); constraints = []}; @@ -279,7 +367,13 @@ Basic resolution 3, module type: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -287,7 +381,17 @@ Basic resolution 3, module type: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -296,9 +400,22 @@ Basic resolution 3, module type: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + t); + ihash = 825731485; ikey = "t_t.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -307,7 +424,17 @@ Basic resolution 3, module type: compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + N); + ihash = 502470005; ikey = "m_N.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -319,10 +446,22 @@ Basic resolution 3, module type: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module - (`Root (Some (`Page (None, None)), Root), N), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + N); + ihash = 502470005; ikey = "m_N.r_Root.p_None"}, + t); + ihash = 598040815; ikey = "t_t.m_N.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -332,11 +471,32 @@ Basic resolution 3, module type: p_path = `Resolved (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), M)))}); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"})}); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + u); + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -346,13 +506,24 @@ Basic resolution 3, module type: (`Resolved (`Type (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), N)), - t)), - [])); - constraints = []}; - representation = None})]; - compiled = true; doc = []}; - expansion = None; linked = false; canonical = None} + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page ...; + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...)), + ...)); + constraints = ...}; + representation = ...}); + ...]; + compiled = ...; doc = ...}; + expansion = ...; linked = ...; canonical = ...} ``` This example is very similar but there is one more level of nesting of the modules: @@ -381,7 +552,13 @@ Basic resolution 4, module type: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -389,7 +566,17 @@ Basic resolution 4, module type: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -398,9 +585,22 @@ Basic resolution 4, module type: [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 998243332; ikey = "m_N.mt_M.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -409,13 +609,31 @@ Basic resolution 4, module type: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - M), - N), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + M); + ihash = 459143770; + ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 998243332; + ikey = "m_N.mt_M.r_Root.p_None"}, + t); + ihash = 687003328; + ikey = "t_t.m_N.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -427,7 +645,17 @@ Basic resolution 4, module type: compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), A); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -439,10 +667,22 @@ Basic resolution 4, module type: [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`Module - (`Root (Some (`Page (None, None)), Root), A), - N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + N); + ihash = 456955352; ikey = "m_N.m_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -451,51 +691,45 @@ Basic resolution 4, module type: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module - (`Module - (`Root - (Some (`Page (None, None)), Root), - A), - N), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = - []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = true; doc = []}); - canonical = None; hidden = false})]; - compiled = true; doc = []}); - p_path = - `Resolved - (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), M)))}); - canonical = None; hidden = false}); - Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), u); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; - manifest = - Some - (Odoc_model.Lang.TypeExpr.Constr - (`Resolved - (`Type - (`Module - (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), A)), - N), - t)), - [])); - constraints = []}; - representation = None})]; - compiled = true; doc = []}; - expansion = None; linked = false; canonical = None} + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = + "r_Root."... (* string length 13; truncated *)}, + A); + ihash = 353272258; + ikey = + "m_A."... (* string length 17; truncated *)}, + N); + ihash = 456955352; + ikey = + "m"... (* string length 21; truncated *)}, + t); + ihash = ...; ikey = ...}; + doc = ...; canonical = ...; equation = ...; + representation = ...}); + ...]; + compiled = ...; doc = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...}); + p_path = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...}; + expansion = ...; linked = ...; canonical = ...} ``` This example is rather more interesting: @@ -560,7 +794,13 @@ and then we can look up the type `t`. |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -568,7 +808,17 @@ and then we can look up the type `t`. {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -576,9 +826,22 @@ and then we can look up the type `t`. {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - N); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 887387323; ikey = "mt_N.mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -587,13 +850,31 @@ and then we can look up the type `t`. [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - M), - N), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + M); + ihash = 459143770; + ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 887387323; + ikey = "mt_N.mt_M.r_Root.p_None"}, + t); + ihash = 652783314; + ikey = "t_t.mt_N.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -604,9 +885,22 @@ and then we can look up the type `t`. Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + B); + ihash = 301928208; ikey = "m_B.mt_M.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -618,14 +912,31 @@ and then we can look up the type `t`. [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module - (`ModuleType - (`Root - (Some (`Page (None, None)), Root), - M), - B), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + M); + ihash = 459143770; + ikey = "mt_M.r_Root.p_None"}, + B); + ihash = 301928208; + ikey = "m_B.mt_M.r_Root.p_None"}, + t); + ihash = 484865120; + ikey = "t_t.m_B.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = @@ -637,58 +948,25 @@ and then we can look up the type `t`. p_path = `Resolved (`Identifier - (`ModuleType - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - M), - N)))}); - canonical = None; hidden = false})]; - compiled = true; doc = []})}; - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), A); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.ModuleType - {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module - (`Root (Some (`Page (None, None)), Root), A), - N); - doc = []; canonical = None; - expr = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`Module - (`Root - (Some (`Page (None, None)), Root), - A), - N), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = - []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = ...; doc = ...})}; - ...]; - compiled = ...; doc = ...}); - p_path = ...}); - canonical = ...; hidden = ...}); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...})}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...})}; ...]; compiled = ...; doc = ...}; expansion = ...; linked = ...; canonical = ...} @@ -709,7 +987,13 @@ and then we can look up the type `t`. |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -717,7 +1001,17 @@ and then we can look up the type `t`. {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), M); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -725,9 +1019,22 @@ and then we can look up the type `t`. {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - N); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 887387323; ikey = "mt_N.mt_M.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -736,13 +1043,31 @@ and then we can look up the type `t`. [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - M), - N), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + M); + ihash = 459143770; + ikey = "mt_M.r_Root.p_None"}, + N); + ihash = 887387323; + ikey = "mt_N.mt_M.r_Root.p_None"}, + t); + ihash = 652783314; + ikey = "t_t.mt_N.mt_M.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -753,9 +1078,22 @@ and then we can look up the type `t`. Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), M), - X); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + M); + ihash = 459143770; ikey = "mt_M.r_Root.p_None"}, + X); + ihash = 573009176; ikey = "m_X.mt_M.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -764,13 +1102,31 @@ and then we can look up the type `t`. [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`Module - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - M), - X), - B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + M); + ihash = 459143770; + ikey = "mt_M.r_Root.p_None"}, + X); + ihash = 573009176; + ikey = "m_X.mt_M.r_Root.p_None"}, + B); + ihash = 413241446; + ikey = "m_B.m_X.mt_M.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -782,62 +1138,49 @@ and then we can look up the type `t`. [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module - (`Module - (`ModuleType - (`Root - (Some - (`Page (None, None)), - Root), - M), - X), - B), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params - = []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = true; doc = []}); - p_path = - `Resolved - (`Identifier - (`ModuleType - (`ModuleType - (`Root - (Some (`Page (None, None)), - Root), - M), - N)))}); - canonical = None; hidden = false})]; - compiled = true; doc = []}); - canonical = None; hidden = false})]; - compiled = true; doc = []})}; - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), A); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.ModuleType - {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module - (`Root (Some (`Page (None, None)), Root), A), - N); - doc = ...; canonical = ...; expr = ...}; - ...]; - compiled = ...; doc = ...}); - p_path = ...}); - canonical = ...; hidden = ...}); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv + = + `Module + ({Odoc_model__Paths_types.iv + = + `ModuleType + ({Odoc_model__Paths_types.iv + = + `Root + (Some + {Odoc_model__Paths_types.iv + = ...; + ihash = + ...; + ikey = + ...}, + ...); + ihash = ...; + ikey = ...}, + ...); + ihash = ...; + ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}; + doc = ...; canonical = ...; + equation = ...; representation = ...}); + ...]; + compiled = ...; doc = ...}); + p_path = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...})}; ...]; compiled = ...; doc = ...}; expansion = ...; linked = ...; canonical = ...} @@ -860,7 +1203,13 @@ Ensure a substitution is taken into account during resolution: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -868,7 +1217,17 @@ Ensure a substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), A); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -877,9 +1236,22 @@ Ensure a substitution is taken into account during resolution: [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), - M); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; ikey = "m_M.mt_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -887,22 +1259,53 @@ Ensure a substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - A), - M), - S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + A); + ihash = 231492881; + ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; + ikey = "m_M.mt_A.r_Root.p_None"}, + S); + ihash = 3092406; + ikey = "mt_S.m_M.mt_A.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []}); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), - N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, + N); + ihash = 50158313; ikey = "m_N.mt_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -913,18 +1316,43 @@ Ensure a substitution is taken into account during resolution: (`OpaqueModuleType (`ModuleType (`Identifier - (`Module - (`ModuleType - (`Root - (Some (`Page (None, None)), Root), - A), - M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + A); + ihash = 231492881; + ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; + ikey = "m_M.mt_A.r_Root.p_None"}, S)))}); canonical = None; hidden = false})]; compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; + ikey = "m_B.r_Root.p"... (* string length 17; truncated *)}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -932,48 +1360,14 @@ Ensure a substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module (`Root (Some (`Page (None, None)), Root), B), S); - doc = []; canonical = None; - expr = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`Module - (`Root (Some (`Page (None, None)), Root), - B), - S), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = true; doc = []})}]; - compiled = true; doc = []}); - canonical = None; hidden = false}); - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), C); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.With - {Odoc_model.Lang.ModuleType.w_substitutions = - [Odoc_model.Lang.ModuleType.ModuleEq - (`Resolved (`Module (`Root (`ModuleType ...), ...)), ...); - ...]; - w_expansion = ...; w_expr = ...}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; doc = ...}; - expansion = ...; linked = ...; canonical = ...} + {Odoc_model__Paths_types.iv = ...; ihash = ...; ikey = ...}; + doc = ...; canonical = ...; expr = ...}; + ...]; + compiled = ...; doc = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...}; + expansion = ...; linked = ...; canonical = ...} ``` Ensure a destructive substitution is taken into account during resolution: @@ -993,7 +1387,13 @@ Ensure a destructive substitution is taken into account during resolution: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1001,7 +1401,17 @@ Ensure a destructive substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), A); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1010,9 +1420,22 @@ Ensure a destructive substitution is taken into account during resolution: [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), - M); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; ikey = "m_M.mt_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -1020,22 +1443,53 @@ Ensure a destructive substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - A), - M), - S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + A); + ihash = 231492881; + ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; + ikey = "m_M.mt_A.r_Root.p_None"}, + S); + ihash = 3092406; + ikey = "mt_S.m_M.mt_A.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []}); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module - (`ModuleType (`Root (Some (`Page (None, None)), Root), A), - N); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 231492881; ikey = "mt_A.r_Root.p_None"}, + N); + ihash = 50158313; ikey = "m_N.mt_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -1046,18 +1500,43 @@ Ensure a destructive substitution is taken into account during resolution: (`OpaqueModuleType (`ModuleType (`Identifier - (`Module - (`ModuleType - (`Root - (Some (`Page (None, None)), Root), - A), - M)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + A); + ihash = 231492881; + ikey = "mt_A.r_Root.p_None"}, + M); + ihash = 564635453; + ikey = "m_M.mt_A.r_Root.p_None"}, S)))}); canonical = None; hidden = false})]; compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; + ikey = "m_B.r_Root.p"... (* string length 17; truncated *)}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -1065,48 +1544,14 @@ Ensure a destructive substitution is taken into account during resolution: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Module (`Root (Some (`Page (None, None)), Root), B), S); - doc = []; canonical = None; - expr = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType - (`Module - (`Root (Some (`Page (None, None)), Root), - B), - S), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = true; doc = []})}]; - compiled = true; doc = []}); - canonical = None; hidden = false}); - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), C); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.With - {Odoc_model.Lang.ModuleType.w_substitutions = - [Odoc_model.Lang.ModuleType.ModuleSubst - (`Resolved (`Module (`Root (`ModuleType ...), ...)), ...); - ...]; - w_expansion = ...; w_expr = ...}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; doc = ...}; - expansion = ...; linked = ...; canonical = ...} + {Odoc_model__Paths_types.iv = ...; ihash = ...; ikey = ...}; + doc = ...; canonical = ...; expr = ...}; + ...]; + compiled = ...; doc = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; doc = ...}; + expansion = ...; linked = ...; canonical = ...} ``` Resolve a module alias: @@ -1121,7 +1566,13 @@ Resolve a module alias: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1129,7 +1580,17 @@ Resolve a module alias: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), A); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -1138,8 +1599,22 @@ Resolve a module alias: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module (`Root (Some (`Page (None, None)), Root), A), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + t); + ihash = 394964294; ikey = "t_t.m_A.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1149,18 +1624,48 @@ Resolve a module alias: canonical = None; hidden = false}); Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.Alias (`Resolved (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}), None); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + t); + ihash = 1016576344; ikey = "t_t.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; @@ -1171,17 +1676,40 @@ Resolve a module alias: (`Type (`Alias (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), A)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), B))), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; + ikey = + "m_B.r_Root"... (* string length 17; truncated *)}, + false)), t)), [])); constraints = []}; representation = None})]; compiled = true; doc = []}; - expansion = None; linked = false; canonical = None} + expansion = None; linked = false; canonical = ...} ``` Resolve a module alias: @@ -1197,7 +1725,13 @@ Resolve a module alias: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1205,7 +1739,17 @@ Resolve a module alias: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), A); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType @@ -1214,8 +1758,22 @@ Resolve a module alias: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Module (`Root (Some (`Page (None, None)), Root), A), t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, + t); + ihash = 394964294; ikey = "t_t.m_A.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1225,57 +1783,94 @@ Resolve a module alias: canonical = None; hidden = false}); Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), B); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.Alias (`Resolved (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A))), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}), None); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), C); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + C); + ihash = 43786577; ikey = "m_C.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.Alias (`Resolved (`Alias (`Identifier - (`Module (`Root (Some (`Page (None, None)), Root), A)), + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + A); + ihash = 353272258; ikey = "m_A.r_Root.p_None"}, `Identifier - (`Module (`Root (Some (`Page (None, None)), Root), B)))), + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + B); + ihash = 814134997; ikey = "m_B.r_Root.p_None"}, + false))), None); canonical = None; hidden = false}); Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type (`Root (Some (`Page (None, None)), Root), t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; - manifest = - Some - (Odoc_model.Lang.TypeExpr.Constr - (`Resolved - (`Type - (`Alias - (`Alias - (`Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), A)), - `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), B))), - `Identifier - (`Module - (`Root (Some (`Page (None, None)), Root), C))), - t)), - [])); - constraints = []}; - representation = None})]; - compiled = true; doc = []}; - expansion = None; linked = false; canonical = None} + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = `Root ...; ihash = ...; + ikey = ...}, + ...); + ihash = ...; ikey = ...}; + doc = ...; canonical = ...; equation = ...; representation = ...}); + ...]; + compiled = ...; doc = ...}; + expansion = ...; linked = ...; canonical = ...} ``` Resolve a functor: @@ -1294,7 +1889,13 @@ Resolve a functor: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1302,7 +1903,17 @@ Resolve a functor: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; ikey = "mt_S.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1311,9 +1922,22 @@ Resolve a functor: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType (`Root (Some (`Page (None, None)), Root), S), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; ikey = "mt_S.r_Root.p_None"}, + t); + ihash = 130637260; ikey = "t_t.mt_S.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1322,15 +1946,39 @@ Resolve a functor: compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), F); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType (Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Module (`Root (Some (`Page (None, None)), Root), F), X); + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + F); + ihash = 748202139; ikey = "m_F.r_Root.p_None"}, + X); + ihash = 930266402; ikey = "p_X.m_F.r_Root.p_None"}; expr = Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = @@ -1340,13 +1988,31 @@ Resolve a functor: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Parameter - (`Module - (`Root (Some (`Page (None, None)), Root), - F), - X), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + F); + ihash = 748202139; + ikey = "m_F.r_Root.p_None"}, + X); + ihash = 930266402; + ikey = "p_X.m_F.r_Root.p_None"}, + t); + ihash = 1065278958; + ikey = "t_t.p_X.m_F.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1357,59 +2023,34 @@ Resolve a functor: p_path = `Resolved (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), S)))}}, + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; + ikey = + "mt_S.r_Root.p_Non"... (* string length 18; truncated *)})}}, Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Result - (`Module (`Root (Some (`Page (None, None)), Root), F)), - Y); - expr = - Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`Parameter - (`Result - (`Module - (`Root - (Some (`Page (None, None)), Root), - F)), - Y), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; - private_ = false; manifest = None; - constraints = []}; - representation = None})]; - compiled = true; doc = []}); - p_path = - `Resolved - (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), S)))}}, - Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.TypeDecl.id = - `Type - (`Result - (`Result - (`Module (`Root (Some (`Page ...), ...), ...))), - ...); - doc = ...; canonical = ...; equation = ...; - representation = ...}); - ...]; - compiled = ...; doc = ...}))); + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Result + {Odoc_model__Paths_types.iv = `Module ...; + ihash = ...; ikey = ...}; + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}; + expr = ...}, + ...))); canonical = ...; hidden = ...}); ...]; compiled = ...; doc = ...}; @@ -1454,7 +2095,13 @@ Resolve a functor: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1462,7 +2109,17 @@ Resolve a functor: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), S); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; ikey = "mt_S.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1471,9 +2128,22 @@ Resolve a functor: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`ModuleType (`Root (Some (`Page (None, None)), Root), S), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; ikey = "mt_S.r_Root.p_None"}, + t); + ihash = 130637260; ikey = "t_t.mt_S.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1482,16 +2152,39 @@ Resolve a functor: compiled = true; doc = []})}; Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), S1); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S1); + ihash = 289200525; ikey = "mt_S1.r_Root.p_None"}; doc = []; canonical = None; expr = Some (Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`ModuleType (`Root (Some (`Page (None, None)), Root), S1), - _); + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S1); + ihash = 289200525; ikey = "mt_S1.r_Root.p_None"}, + _); + ihash = 797224953; ikey = "p__.mt_S1.r_Root.p_None"}; expr = Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = @@ -1501,13 +2194,31 @@ Resolve a functor: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Parameter - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - S1), - _), - t); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + S1); + ihash = 289200525; + ikey = "mt_S1.r_Root.p_None"}, + _); + ihash = 797224953; + ikey = "p__.mt_S1.r_Root.p_None"}, + t); + ihash = 993900890; + ikey = "t_t.p__.mt_S1.r_Root.p_None"}; doc = []; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; @@ -1518,8 +2229,20 @@ Resolve a functor: p_path = `Resolved (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), S)))}}, + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + S); + ihash = 527535255; + ikey = + "mt_S.r_Root.p_Non"... (* string length 18; truncated *)})}}, Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = Some @@ -1528,46 +2251,17 @@ Resolve a functor: [Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.TypeDecl.id = - `Type - (`Result - (`ModuleType - (`Root (Some (`Page (None, None)), Root), S1)), - t); - doc = []; canonical = None; - equation = - {Odoc_model.Lang.TypeDecl.Equation.params = []; - private_ = false; manifest = None; constraints = []}; - representation = None})]; - compiled = true; doc = []}); - p_path = - `Resolved - (`Identifier - (`ModuleType (`Root (Some (`Page (None, None)), Root), S)))}))}; - Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, - {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), F1); - doc = []; - type_ = - Odoc_model.Lang.Module.ModuleType - (Odoc_model.Lang.ModuleType.Functor - (Odoc_model.Lang.FunctorParameter.Named - {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Module (`Root (Some (`Page (None, None)), Root), F1), - Arg); - expr = - Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.Type - (Odoc_model.Lang.Signature.Ordinary, ...); - ...]; - compiled = ...; doc = ...}); - p_path = ...}}, - ...)); - canonical = ...; hidden = ...}); + {Odoc_model__Paths_types.iv = + `Type + ({Odoc_model__Paths_types.iv = ...; ihash = ...; + ikey = ...}, + ...); + ihash = ...; ikey = ...}; + doc = ...; canonical = ...; equation = ...; + representation = ...}); + ...]; + compiled = ...; doc = ...}); + p_path = ...}))}; ...]; compiled = ...; doc = ...}; expansion = ...; linked = ...; canonical = ...} @@ -1629,7 +2323,13 @@ Functor app nightmare: |} ;; - : Odoc_model.Lang.Compilation_unit.t = {Odoc_model.Lang.Compilation_unit.id = - `Root (Some (`Page (None, None)), Root); + {Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}; root = Common.root; digest = "nodigest"; imports = []; source = None; interface = true; hidden = false; content = @@ -1637,7 +2337,17 @@ Functor app nightmare: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType (`Root (Some (`Page (None, None)), Root), Type); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Type); + ihash = 359972898; ikey = "mt_Type.r_Root.p_None"}; doc = []; canonical = None; expr = Some @@ -1645,23 +2355,59 @@ Functor app nightmare: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`ModuleType - (`Root (Some (`Page (None, None)), Root), Type), - T); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Type); + ihash = 359972898; ikey = "mt_Type.r_Root.p_None"}, + T); + ihash = 1011869183; ikey = "mt_T.mt_Type.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []})}; Odoc_model.Lang.Signature.Module (Odoc_model.Lang.Signature.Ordinary, {Odoc_model.Lang.Module.id = - `Module (`Root (Some (`Page (None, None)), Root), App); + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + App); + ihash = 855073208; ikey = "m_App.r_Root.p_None"}; doc = []; type_ = Odoc_model.Lang.Module.ModuleType (Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Module (`Root (Some (`Page (None, None)), Root), App), T); + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + App); + ihash = 855073208; ikey = "m_App.r_Root.p_None"}, + T); + ihash = 730736887; ikey = "p_T.m_App.r_Root.p_None"}; expr = Odoc_model.Lang.ModuleType.Path {Odoc_model.Lang.ModuleType.p_expansion = @@ -1670,78 +2416,71 @@ Functor app nightmare: {Odoc_model.Lang.Signature.items = [Odoc_model.Lang.Signature.ModuleType {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Parameter - (`Module - (`Root (Some (`Page (None, None)), Root), - App), - T), - T); + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, None); + ihash = 236059787; + ikey = "p_None"}, + Root); + ihash = 818126955; + ikey = "r_Root.p_None"}, + App); + ihash = 855073208; + ikey = "m_App.r_Root.p_None"}, + T); + ihash = 730736887; + ikey = "p_T.m_App.r_Root.p_None"}, + T); + ihash = 167832761; + ikey = "mt_T.p_T.m_App.r_Root.p_None"}; doc = []; canonical = None; expr = None}]; compiled = true; doc = []}); p_path = `Resolved (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), Type)))}}, + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (None, None); + ihash = 236059787; ikey = "p_None"}, + Root); + ihash = 818126955; ikey = "r_Root.p_None"}, + Type); + ihash = 359972898; ikey = "mt_Type.r_Root.p_None"})}}, Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Result - (`Module (`Root (Some (`Page (None, None)), Root), App)), - F); - expr = - Odoc_model.Lang.ModuleType.Functor - (Odoc_model.Lang.FunctorParameter.Named - {Odoc_model.Lang.FunctorParameter.id = - `Parameter - (`Parameter - (`Result - (`Module - (`Root (Some (`Page (None, None)), Root), - App)), - F), - _); - expr = - Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.ModuleType - {Odoc_model.Lang.ModuleType.id = - `ModuleType - (`Parameter - (`Parameter - (`Result - (`Module - (`Root - (Some (`Page (None, None)), - Root), - App)), - F), - _), - T); - doc = []; canonical = None; expr = None}]; - compiled = true; doc = []}); - p_path = - `Resolved - (`Identifier - (`ModuleType - (`Root (Some (`Page (None, None)), Root), - Type)))}}, - Odoc_model.Lang.ModuleType.Path - {Odoc_model.Lang.ModuleType.p_expansion = - Some - (Odoc_model.Lang.ModuleType.Signature - {Odoc_model.Lang.Signature.items = - [Odoc_model.Lang.Signature.ModuleType - {Odoc_model.Lang.ModuleType.id = ...; doc = ...; - canonical = ...; expr = ...}; - ...]; - compiled = ...; doc = ...}); - p_path = ...})}, + {Odoc_model__Paths_types.iv = + `Parameter + ({Odoc_model__Paths_types.iv = + `Result + {Odoc_model__Paths_types.iv = + `Module + ({Odoc_model__Paths_types.iv = + `Root + (Some + {Odoc_model__Paths_types.iv = + `Page (...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}; + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}; + expr = ...}, ...))); canonical = ...; hidden = ...}); ...]; diff --git a/test/xref2/strengthen/test.md b/test/xref2/strengthen/test.md index c19ab53713..ae67e63cdb 100644 --- a/test/xref2/strengthen/test.md +++ b/test/xref2/strengthen/test.md @@ -24,8 +24,8 @@ type equations for all abstract types. |} ;; BEFORE ====== -type t/0 -type u/1 = local(t/0,false) +type t/1 +type u/0 = local(t/1,false) (removed=[]) AFTER ====== diff --git a/test/xref2/subst/test.md b/test/xref2/subst/test.md index e802bbe1f2..40c50e0773 100644 --- a/test/xref2/subst/test.md +++ b/test/xref2/subst/test.md @@ -68,9 +68,9 @@ the equations for t, u and v point to SubTargets rather than SubstituteMe BEFORE ====== S: sig -type tt/3 = local(SubstituteMe/2,false).t +type tt/5 = local(SubstituteMe/2,false).t type uu/4 = local(SubstituteMe/2,false).u -type vv/5 = local(SubstituteMe/2,false).v +type vv/3 = local(SubstituteMe/2,false).v (removed=[])end AFTER @@ -140,14 +140,14 @@ module SomeMonad/58 : sig val join/65 : ([[a] r(t/63)] r(t/63)) -> [a] r(t/63) (removed=[])) (removed=[])end -module ComplexTypeExpr/56 : sig +module ComplexTypeExpr/57 : sig type t/66 include : r(Monad/59) with [r(root(Monad/59).t) = ([r(int) * a] r(t/66) * [a * r(int)] r(t/66))] (sig = val map/67 : (([r(int) * a] r(t/66) * [a * r(int)] r(t/66))) -> ((a) -> b) -> ([r(int) * b] r(t/66) * [b * r(int)] r(t/66)) val join/68 : (([r(int) * ([r(int) * a] r(t/66) * [a * r(int)] r(t/66))] r(t/66) * [([r(int) * a] r(t/66) * [a * r(int)] r(t/66)) * r(int)] r(t/66))) -> ([r(int) * a] r(t/66) * [a * r(int)] r(t/66)) (removed=[])) (removed=[])end -module Erase/57 : sig +module Erase/56 : sig include : r(Monad/59) with [r(root(Monad/59).t) = a] (sig = val map/69 : (a) -> ((a) -> b) -> b val join/70 : (a) -> a (removed=[]))