odoc
odoc copied to clipboard
Reference a polymorphic variant constructor belonging to a type
Considering a polymorphic variant type:
type switch = [`On; `Off]
I'd like to be able to refer to the constructors in the documentation. It could be doable if the full path is specified; there's even an anchor generated in the html code, which suggests a possible syntax:
(** {!type-switch.On} *)
Thanks!
This is not a parser problem but a missing feature in the reference resolver. Speaking of parser, there's room already in the syntax for the `
: {!t."`Foo"}
.
This might be useful to disambiguate between a regular and a polymorphic constructor (as an alternative to a prefix like {!t.poly-Foo}
).
We already have code to handle ambiguous references, so it might be possible to handle cases like {!"`Foo"}
, which could mean "The constructor `Foo
in any type declaration in scope.".