I have some very basic and simple functions shared by several .ml files: for instance, warn, error… I would like to know, instead of repeating their definition in each .ml file, how to define them in a common place, and just call them when necessary? Is it necessarily a module?
Thank you very much!
Every file in OCaml defines a module. For instance, you could place your common definitions in:
And then use it from other files as such:
Or as such: