I wrote a interface for a map data structure in an MLI file and then the implementation of maps using association lists in a file of the same name but with extension of "ML". this works. but now I want to write a second implementation of the map interface using Direct Address Map and may be a 3rd implementation of map using binary search trees.
How do I do this? As per ocaml documentation I must have the MLI and ML file names the same for them to work.
If I pick a different name ex: map_interace.ml and associationlist_map.ml and binarysearchtree_map.ml then dune complains that it cannot even see the module signatures defined in "map_interface.ml".
What I want to do is to define the interface signatures of a map in one file and then have 3 separate files for 3 separate implementations of the map and 3 separate files for test cases for each of the map implementations.
but because of the file naming conventions of ocaml and dune I am stuck because they need the same file name for MLI, implementation and the test case. (sorry if I'm wrong here).
What is the right way to structure my project ... what kind of file names should I chose?
Edit: I found this thread on googling. Interface with multiple implementations in OCaml but it seems that its asking me to implement the same interface again and again in different MLI files. and this doesn't make any sense to me. why should I write the interface 3 times?