@sebbes wrote:
Hello,
I have troubles in splitting my app into modules & submodules using dune.
Here is my current project tree (following this SO answer: https://stackoverflow.com/a/53325230/3421913 ) :
├── dune ├── dune-project ├── booleanFormulae │ ├── booleanFormulae.ml // begins with "open Types" │ ├── booleanFormulae.mli // begins with "open Types" │ ├── dune │ ├── parser.ml // begins with "open Types" │ └── types.ml ├── main.ml ├── test │ ├── dune │ └── test.mlHere is the root dune file:
(executable (name main) (libraries BooleanFormulae))Here is
lib/dune:(library (name BooleanFormulae) (libraries angstrom) (preprocess (pps ppx_deriving.show ppx_deriving.ord)))In the dune docs (https://dune.readthedocs.io/en/stable/dune-files.html), it is said
By default dune will use all the .ml/.re files in the same directory as the
dunefile.So if I understand well, in the
main.mlI should be able toopen BooleanFormulae.Parseror
open BooleanFormulae.Types.
However,dune build main.execomplains:File "main.ml", line 2, characters 5-27: 2 | open BooleanFormulae.Parser ^^^^^^^^^^^^^^^^^^^^^^ Error: Unbound module BooleanFormulae.ParserJust referring to
Parserinmain.mldoesn’t work either.What should I do? And is my project globally well structured?
Posts: 7
Participants: 3