The library name is derived from the module name, and the module name is derived from the file name. If the module name is OTP, then the file name has to be either OTP.ml or oTP.ml since the compiler automatically uppercases the first letter of the file name. If you name the library otp then the file name can be otp.ml and the module name will be Otp.
Thanks, that helps. So what is the practice concerning the naming of libraries ? Using the same name as modules (with a capital letter in front) or using lower case everywhere ?
Yes, the convention is lower-cased. But the convention is quite ambiguous whether dashes or underscores are separators. Almost all PPX-es use underscores, yet the majority of other packages seem to use dashes.
Instead of the insider baseball / tribal knowledge, I’d encourage just re-using the same casing for the module name, library name and opam package name. That way the users of your library have one less reason to complain about how unnecessarily complicated OCaml is. Example: index (MlFront_ZipFile.index)