Skip to content

Ocaml 5.5 compat#1406

Draft
panglesd wants to merge 5 commits intoocaml:masterfrom
panglesd:ocaml-5.5-compat
Draft

Ocaml 5.5 compat#1406
panglesd wants to merge 5 commits intoocaml:masterfrom
panglesd:ocaml-5.5-compat

Conversation

@panglesd
Copy link
Copy Markdown
Collaborator

@panglesd panglesd commented Mar 25, 2026

Support for 5.5 with:

  • Support for external types, displayed as abstract types
  • Support for module arrows.

The second one is trickier. In this PR, at least:

  • The type is written
  • There is no warning about missing elements from the environment.

However, the path referencing the module argument appear as unresolved links: underlined in red, suggesting an error...

The state of the PR is draft because it needs to be cleaned up and improved, but I already open it in case someone wants to try odoc on OCaml 5.5.

🤖 Generated with @xvw

Jon Ludlam's Agent and others added 5 commits March 11, 2026 10:38
- pack_cstrs renamed to pack_constraints in Types.package
- tpt_cstrs renamed to tpt_constraints in Typedtree.package_type
- typ_cstrs renamed to typ_constraints in Typedtree.type_declaration
- New Type_external/Ttype_external constructors for external types
- New Tfunctor/Ttyp_functor constructors in type_desc/core_type_desc
- New Local_opaque_item constructor in Shape.Uid
- Typemod.path_of_module moved to Typedtree.path_of_module

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The way it works is not ideal: we create a synthetic parent id for each module
argument (as they can be introduced multiple times with the same name in the
same type expression). This id is hidden and we don't render links to hidden
ids.

This is slightly bad because:
- The appearance of unresolved links suggest an error when there is no.
- There is no way to distinguish module args from normal modules

But let's say it is a good first step!
@panglesd panglesd mentioned this pull request Mar 25, 2026
"dune" {>= "3.21.0"}
"fpath" {>= "0.7.3"}
"ocaml" {>= "4.08.0" & < "5.5"}
"ocaml" {>= "4.08.0" & <= "5.5.1"}
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"ocaml" {>= "4.08.0" & <= "5.5.1"}
"ocaml" {>= "4.08.0" & < "5.6"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants