Change module structure without aliases?
As as user of ppx_import
, I'm used to import types into a new module structure. For instance, with a module Foo
(foo.mli
) such as the following:
module Bar = struct
type t =
| A
end
I can do:
module Baz = struct
type t = [%import: Foo.Bar.t]
let to_string =
function
| A -> "A"
end
let () =
Printf.printf "Baz: %s\n" (Baz.to_string A)
To achieve the same thing with the Override PPX, I have to first make a duplicate of the module structure, and then alias it:
module%override Foo = struct
module%override Bar = struct
type t = _
let to_string =
function
| A -> "A"
end
end
module Baz = Foo.Bar
let () =
Printf.printf "Baz: %s\n" (Baz.to_string A)
That's not a big issue but I'm wondering if I'm missing something that would make it possible to avoid the intermediate repetition of the overridden module structure?