Creating Interface Files for Modules
You don’t have to do anything special to let others use your modules. As long as the compiler can find the re file, you’re good to go, and other people can use everything in your modules. However, you might want to have certain private functions or types that aren’t available to people using your modules. You can accomplish this by creating interface files.
Interface files, which end with rei, specify function names and types without the function bodies, so the annotation looks like the alternate annotation style we examined, with no equal sign after the function name and the return type after the =>. These rei files are useful for documentation. Much like header files in a language like C or C++, they ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access