-
Notifications
You must be signed in to change notification settings - Fork 90
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
Remove core types and exceptions from identifiers #1242
Conversation
They are not used anywhere and do not belong to identifiers: we cannot generate a link from them.
Instead, put them into (unresolved) path types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, the code simplification is impressive!
Do you have an idea what causes the mdx issue in the tests?
Yes: the mdx tests are only run on |
I'm not convinced this is the right approach, though it's not without its merits. Perhaps we can try removing core types only from identifiers instead? |
I tried your suggested approach: moving "path to core types" from identifiers to resolved paths. So paths to core type are represented by:
As a consequence of considering core types path as resolved, taking an identifier out of a path type returns an option. |
You mean so that we can link to e.g. https://github.com/ocaml/ocaml/blob/trunk/stdlib/bool.mli#L22 each time there is a bool, or is there other benefits to having these references? is it useful for the search? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new diff looks good by the way.
Sorry, I did not meant references but paths. module Int : sig
type t = int
(** @canonical int *)
end
val plus_one : Int.t -> Int.t If the feature I was mentioning were implemented, it would make the rendered signature of |
This is a very nice change now! |
Identifiers are values that can be turned into a link. Core types and values cannot, so they should not have an ID.
This PR fixes this. Core types can appear in unresolved path, and that's all. This better representation allows to:
Url.from_identifier
not return a result type (which removes manyassert false
from the code!)Predefined
module, which did not made sense.