That’s actually why I don’t use this kind of notation in serious code. Code review is hard, and I like it very much when I don’t need a lot of context to understand what operator I’m reading.
So (again in the context of recreational coding), .%{}
for Hashtbl.get
is fine, since I know that I only use generic Hashtbl.t
(because keys are integers, strings, or tuples of those).
But if I start to introduce a Syntax
module (say in the Hashtbl.Make
) functor and start using
open
or let open
far from the use of the operator then everything becomes murky when reading diffs or looking at code in isolation. I’d rather see HString.find table key
rather than table.%{key}
without knowing what this is about. An alternative is to put the indexing operators inside the module itself so : table.HString.%{key}
but then you don’t win a lot.