Modules/module types–many-to-many relationship

In OCaml, modules can structurally conform to many module types. I think this is kind of widely and implicitly understood to be the way to make data types or APIs conform to various ‘protocols’ or ‘typeclasses’, but can anyone point to any reading materials which walk through this? E.g., something that explores writing a module with types/functions that make it automatically conform to various signatures. So far I’ve been able to find materials that only allude to this rather than emphasizing it. E.g. in

This works because many modules in Core, including Int and String , satisfy an extended version of the Comparable signature described previously. Such standardized signatures are good practice, both because they make functors easier to use, and because they encourage standardization that makes your codebase easier to navigate.

Some of the material in this reply may be of interest.

Thanks. I’ll take a look at some of those resources. It may be that there’s a niche for an article that describes exactly the OCaml approach to extensible and decoupled generic programming with modules. A lot of materials I’ve seen have talked about ascribing types to modules at definition site. But I feel it should be the other way around–module types should only be specified at the callsite for truly generic programs. This also prevents issues with types becoming too abstract.