Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-duplicate signatues in {index,search}.mli #186

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

craigfe
Copy link
Member

@craigfe craigfe commented Jun 25, 2020

Pure refactor; no behavioural changes. Create some _intf files to avoid duplicating large module types in .{ml,mli} pairs. We need to do some gymnastics to avoid linking to those files in the docs (but once ocaml/odoc#439 is released we won't need to do even that).

Depends on #185, for no particular reason other than my own laziness...

@craigfe craigfe force-pushed the deduplicate-module-types branch from 5528504 to 9212d6f Compare June 25, 2020 21:28
Comment on lines -80 to -81
module Entry = Entry
module Array = Array
Copy link
Member Author

Choose a reason for hiding this comment

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

Tiny code change here. We don't need to create these modules in the struct since we used destructive substitution in the return type.

Comment on lines +168 to +173
module type Key = sig
(* N.B. We use [sig ... end] redirections to avoid linking to the [_intf]
file in the generated docs. Once Odoc 2 is released, this can be
removed. *)

include Key
(** @inline *)
end
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the gymnastics in question. It's sufficient to do:

module type Key = Key

but then Odoc will add an extra link indirection through the _intf file: not a great UX.

@craigfe craigfe force-pushed the deduplicate-module-types branch from 9212d6f to 76c728f Compare June 25, 2020 21:32
@craigfe craigfe force-pushed the deduplicate-module-types branch 2 times, most recently from d213f6f to 29eb2e5 Compare June 26, 2020 12:32
@craigfe craigfe force-pushed the deduplicate-module-types branch from 29eb2e5 to fbb75e3 Compare June 26, 2020 13:03
@craigfe craigfe merged commit 5572a7a into mirage:master Jun 26, 2020
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