How to find the interface i.e. the set of provided function of an OCaml package?

100 Views Asked by At

I need to use parse an OCaml source file into a typed AST and I believe ppx_jane is the right package to do the work. After installing it using opam, I still don't know what functions are available.

This is a link to the ppx_jane package on opam. It tells no more than the basic info and dependencies.

Though I could search on Github to see how other programmers call functions provided by this package, I still cannot get an exhaustive list of all available functions.

1

There are 1 best solutions below

1
On

A bit late but for your original problem, (OCaml source file -> typed AST ) doesn't ocamlc -dtypedtree a.ml do the job?

About knowing the set of function provided by an OCaml module there are several options. Here's few of them:

  1. looking at the doc online
  2. in your favorite toplevel :

    #require "package_name";;
    #show Module_name;;
    
  3. ocamlc -i module.ml