If I want to extend
List with additional functions, I can just do:
include module type of List val flat_map : ('a -> 'b list) -> 'a list -> 'b list
include List let flat_map f l = flatten (map f) l
and that’s fine. But if I want to extend
Format, this simple trick doesn’t work so well, because the new module will have distinct types. So I need:
include module type of Format with type formatter = Format.formatter and type formatter_out_functions = Format.formatter_out_functions and type formatter_tag_functions = Format.formatter_tag_functions val foo : …
include Format let foo = …
which is much less satisfactory because if
Format gets new types, I have to remember to alias them properly.
It would be much simpler to have a form of
include in signatures, that would automatically alias the existing types… Thoughts on that?