ocaml-containers
ocaml-containers copied to clipboard
Default implementations for Map.S, Set.S
I was wondering why Containers does not provide a default implementation for Map.S or Set.S in modules for List, String, etc... Most of the time the default comparison function is used and this could avoid the to duplicate the functor instantiation.
For example, it would be nice to write
type 'a t = 'a String.Map.t
or
type t = Int.Set.t
It's just a bit hard to know where to stop :-). In my projects I tend to have a common_.ml module with the functor instantiations I need, opened in the rest of the files.
I suppose we could have this for Set/Map/Tbl instantiated on int/string, and nothing more.