@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.ml
Here 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
dune
file.So if I understand well, in the
main.ml
I should be able toopen BooleanFormulae.Parser
or
open BooleanFormulae.Types
.
However,dune build main.exe
complains:File "main.ml", line 2, characters 5-27: 2 | open BooleanFormulae.Parser ^^^^^^^^^^^^^^^^^^^^^^ Error: Unbound module BooleanFormulae.Parser
Just referring to
Parser
inmain.ml
doesn’t work either.What should I do? And is my project globally well structured?
Posts: 7
Participants: 3