I'm trying to get started with OCaml, and I've created a new project with:
dune init project 01_calorie_counting
And that created a sensible enough looking project skeleton:
.
├── 01_calorie_counting.opam
├── _build
│ └── log
├── bin
│ ├── dune
│ └── main.ml
├── dune-project
├── lib
│ └── dune
└── test
├── 01_calorie_counting.ml
└── dune
However, when I cd into the folder and run dune build I get this error:
File "lib/dune", line 2, characters 7-26: 2 | (name 01_calorie_counting))
^^^^^^^^^^^^^^^^^^^
Error: "01_calorie_counting" is an
invalid module name. Module names must be non-empty and composed only
of the following characters: 'A'..'Z', 'a'..'z', '_', ''' or '0'..'9'.
Hint: M01_calorie_counting would be a correct module name
So, am I going insane? Last I checked, that name only contains characters in the allowed range.
Is there an additional restriction on it not being able to start with a number that's not listed in the help message?
Module names must start with a letter, and the first letter will be upper-cased in the module name if the file name starts with a lower-case letter.
See the manual's section on how modules relate to the file system:
as well as the section on the lexical format of identifiers:
and of object names: