Reputation: 1438
Two questions:
In SML, a standard "trick" was to define a dummy module and open in it a module the contents of which I wanted to inspect. The signature of the dummy module would then list the contents of the module in SML. This does not work in ocaml.
Found this: To see the packages pre-loaded, use #use "topfind";;
to use the topfind package, and the #list;;
will list the pre-loaded packages!
Upvotes: 1
Views: 72
Reputation: 66808
I don't know a way to list the modules currently loaded.
To show the contents of a module:
# #show_module Pervasives;;
module Pervasives :
sig
external raise : exn -> 'a = "%raise"
external raise_notrace : exn -> 'a = "%raise_notrace"
val invalid_arg : string -> 'a
. . .
val unsafe_really_input : in_channel -> bytes -> int -> int -> unit
val do_at_exit : unit -> unit
end
The initial set of top-level directives is given in Section 9.2 of the OCaml manual.
Upvotes: 2