It matters whether in the signature of a module that is produced by the functor, the type of the key is still the same as the type of the key parameter. If it is not, then debugger cannot know, whether the output type is a key or not. Probably, if you add a sharing constraint between the functor parameter signature and the resulting module signature the debugger with capture it. Especially, if this would be an erasing signature (although it is not always possible), e.g.,
module M = sig type key type t end
module Make(Key : T) : M with type key = Key.t
or
module Make(Key : T) : M with type key := Key.t
If these approaches do not work for you, then you can define a printer yourself in a separate module (that is loaded with `load_printer` command). In this printer you may apply a functor,
and since functors are applicative in OCaml the debugger might be clever enough to pick this printer. It is not guaranteed, though, as the debugger is using lots of heuristics, and sometimes, they do fail.
Best wishes,
Ivan