I’d like to be able to write things like this:
module F(X) = struct
module Y = X
end
module Param = struct let x = 123 end
module M = F(Param)
let () = print_int M.Y.x
i.e. I want the argument passed to F
to keep its original signature. I want M.Y
to be known as an alias for Param
, so I can jump to the documentation of Param
when looking at occurrences of Y
.
Is this something we might want to have in OCaml one day or is it fundamentally incompatible with existing features?
Any recommendations for achieving similar effects? (a solution is to use a macro/template instead of a functor).