I am new to OCaml and I would like to put part of the code in another file, say foo.ml , like in C ++ or Python. But this piece of code alone does not form a module.
I included #use "foo.ml" at the beginning of my main source file. But when I create my project using ocamlbuild , it reports I/O error: "foo.ml: No such file or directory" . But it is clear that foo.ml is in the current working directory.
I wonder if anyone knows how to achieve this goal in OCaml, and let my project be built, or if it is not an agreement in OCaml? Any suggestion is welcome.
tfboy source share