DEV Community

Discussion on: OCaml interface files–hero or menace?

Collapse
 
yawaramin profile image
Yawar Amin

Yes–apply the signature to the module at its point of use, not its point of definition. This keeps the module definition as general as possible but you can expose different facets of the module to different consumers.

Personally I don't recommend that, however. I think that unit tests should test using the exact same interface that's exposed in production. They shouldn't become deeply coupled to implementation details, because that leads to fragile tests.