There is series of functions like print_int, print_endline and Printf in OCaml. I can't do something like:
let n = 10 in
print n;; (* And I haven't to change `print` in case type of `n` changed *)
That is polymorphic print like in Java, C#, Python and others. Instead, we have C-like with type explicitly defined by programmer. So I think that OCaml losing type information during compilation and doesn't have it at runtime, right? And this is the reason why we need mli files also?
EDIT: I'm tired to write function like *print_listi*, *print_list_tuple2i* and so on. How can I do it better?
Printf
module and all the stuff that goes with it. At least it's an improvement and is somewhat type safe. I don't do enough ocaml to know if there's any other builtin alternatives. – Jeff Mercado