ReasonML treats each file as a module, the practice is to uppercase the file name so
Foo.re
Bar.re
let's also suppose that we define a function in Foo call bar and another in Bar call foo.
so we would have:
/* Inside Foo.re */
let bar = string => {}
/* Inside Bar.re */
let foo = string => {}
from with another module, which we have called Main.re, we can reference the above as.
let myResult = Foo.bar("happy");
let ourResult = Bar.foo("days);
or
open Foo, Bar;
let myResult = bar("happy");
let ourResult = foo("days");
So when asked for open MyProject.Foo
, you were asking for the submodule Foo within the module MyProject, which does not exist. Of course, if you created MyProject.re
and added a module to that file called Foo
, then your open MyProject.Foo
would work fine.
Further references:
The underlying Ocaml which the reasonML modules are based on.
The Basic modules section from Axel Rauschmayer book on ReasonML