You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ocamlib RFC, it seems the name of the package name/lib name has been formalized. I am wondering if this proposal can be extended to further formalize how one can access modules/types with such library.
For example,
Let's say lib ptime.clock.jsoo defines modules A, B and C. In my hello.exe application I add reference to it from my dune file like so,
Now, in my hello.ml file, ocaml would enforce the lib namespace such that to access any modules in ptime.clock.jsoo, I would access the modules in it like so,
open Ptime.Clock.Jsoo
let () = A.hello()
of a full path
let () = Ptime.Clock.Jsoo.A.hello()
At the moment Dune (by default) implements a similar mechanism where in a lib_name also serves as its toplevel namespace but doesn't take into account . in the module path name.
In the ocamlib RFC, it seems the name of the package name/lib name has been formalized. I am wondering if this proposal can be extended to further formalize how one can access modules/types with such library.
For example,
Let's say lib
ptime.clock.jsoo
defines modulesA, B and C
. In myhello.exe
application I add reference to it from my dune file like so,Now, in my hello.ml file, ocaml would enforce the lib namespace such that to access any modules in
ptime.clock.jsoo
, I would access the modules in it like so,of a full path
At the moment Dune (by default) implements a similar mechanism where in a lib_name also serves as its toplevel namespace but doesn't take into account
.
in the module path name.[1] https://github.com/ocaml/RFCs/blob/master/rfcs/ocamlib.md#libraries-and-ocamlpath
The text was updated successfully, but these errors were encountered: