Purely functional modules

Assuming circular imports are disallowed, imported modules do not know about your namespace. Therefore, for any type you have access to, its owner cannot override methods defined in your own namespace; it’s safe to use any type in any manner you want, for functions in your namespace. This flexibility allows you to write “integration” modules, which freely use third party types to create new groupings of functionality.

The only restriction is you cannot define methods for functions in other (foreign) modules, led by other module’s types. You can lead a foreign method definition with your own type, or you must define the method in your own namespace.

I’m following these rules in my multi-module app. It’s small size relatively but hopefully this still makes sense over the long run.