Skip to content

Use implementations from Stdlib if available - #1476

Open
Leonidas-from-XIV wants to merge 2 commits into
ocaml:masterfrom
Leonidas-from-XIV:use-stdlib-if-available
Open

Use implementations from Stdlib if available#1476
Leonidas-from-XIV wants to merge 2 commits into
ocaml:masterfrom
Leonidas-from-XIV:use-stdlib-if-available

Conversation

@Leonidas-from-XIV

Copy link
Copy Markdown
Member

In my include functor PR I've used List.partition_map, which made the CI fail on OCaml 4.11, so I looked for the place where Odoc (like every project) would have its own Stdlib extensions.

However the way it is currently implemented the Odoc implementations take preference over the OCaml stdlib. This is mostly fine, however it would be somewhat nicer if Odoc could profit from potential future improvements. In Dune we have arrived at a pattern which allows us to polyfill missing functions while also using the compilers implementation of them - without having to resort to conditional compilation.

This PR implements that pattern.

@Leonidas-from-XIV Leonidas-from-XIV added the no changelog This pull request does not need a changelog entry label Aug 12, 2026
@dbuenzli

Copy link
Copy Markdown
Contributor

Note it's not against your PR, but I note that for myself I would likely not do that.

When additions are made to the stdlib, your own functions get automatically overriden without you noticing. I think I'd rather first check that we are on page that the semantics matches. Stuff like differences in iteration order in the implementation of functions can make it for the odd and hard to track bug that depends on which version of OCaml you installed.

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

Labels

no changelog This pull request does not need a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants