I have an OCaml program that has a lot of functions that depend on a parameter, i.e. "dimensions". This parameter is determined once at the beginning of the code run and remains constant until completion.
My question is: how can I write code shorter, so my functions do not all require the dimension parameter. These modules call functions from each other, so there is no strict hierarchy between the modules (or I do not see this).
How does ocaml style address this issue? Should I use functors or are there other ways?
source
share