I’m a fan of the OCaml toplevel and before consulting the documentation on some module I always try some #show_module
directives in the toplevel.
This does not work well in utop, however, because for some reason utop’s #show_module
directive nearly never displays the same output as, say, ocamlc -i mymodule.mli
, but nearly always replaces any type with an equivalent, more complicated, less readable type.
Typically, where ocamlc -i
would print string
, #show_module
will print CamlinternalFormatBasics.char_set
.
I get by by doing Sys.command “ocamlc -i mymodule.mli”;; which is definitely longer and has no autocompletion.
Any improvements on this ?
Have you tried the -short-paths
option?
Thanks for your feedback.
The -short-paths option changes nothing, unfortunately.
Is there a place where all the options for utop are listed ? I found nothing at http://diml.github.io/utop/UTop.html
The behavior that you are seeing is definitely anormal, I have never seen utop pick unrelated type equalities to display string
as CamlInternalFormatBasics.char_set
. Could you precise your configuration,: ocaml and utop version, os and eventually an example triggering the issue?
Here is an example on my Mac OS 10.11.3 :
To narrow the problem, I imagine that the same issue also triggers with the basic ocaml
toplevel? Do you have any .ocamlinit
file? Have you tried with more recent versions of OCaml? Testing with 4.04.1 or at least 4.02.3 (which integrate a sizeable amount of bug fixes) might be a good idea.
No, I never have this problem with the ocaml toplevel. I really noticed that during my transition phase between utop and the basic toplevel.
That’s definitely an utop issue, not an OCaml issue
I just switched to OCaml 4.04.1 and the problem disappeared. Thank you