https://facebook.github.io/reason/modules.html#modules-basic-modules
I don’t see any import or require in my file; how does module resolution work?
Reason/OCaml doesn’t require you to write any import; modules being referred to in the file are automatically searched in the project. Specifically, a module Hello asks the compiler to look for the file hello.re or hello.ml (and their corresponding interface file, hello.rei or hello.mli, if available).
A module name is the file name, capitalized. It has to be unique per project; this abstracts away the file system and allows you to move files around without changing code.
I tried reason modules system but can't understand how it works.
1) What the differents between open
and include
?
2) I have file foo.re
with defined module Foo
. I have file bar.re
and want to call function from module Foo
.
Should I open
or include
module Foo
at bar.re
? Or just direct access - Foo.someFunction
?
3) Module interfaces should be implemented only ay *.rei
files? And module interface file should be with same name but with rei
ext?