DEV Community

loading...

Discussion on: OCaml interface files–hero or menace?

Collapse
johnridesabike profile image
John Jackson

Great post. I think it's also worth mentioning another benefit to interface files: they let the compiler do more optimizations. When the compiler knows that certain values are only internal to a module, it can compile them more efficiently.

And related to that, the compiler can also give you more warnings about unused values. That's especially useful if you have a large module with lots of internal helper functions and you want to clean them up.