The Ocaml interpreter is able to display (print) any kind of value. For example, if a function returns an array, it can print an array. Also, this works even with custom types. For example, if I do :
type dummy = DUMMY of int * string;; let x = DUMMY(1, "s");;
Then x;; prints on this on the screen :
-: dummy = DUMMY(1, "s")
My question is, how can I access this functionality? For example, if I'm debugging some code and want to print some non-standard object (i.e, something other than int, string etc), then how can I do that using the function the interpreter uses, without having to create a separate print function for everything?