The ocp-index package provides a basic tool for finding API functions, such as
$ ocp-index locate '|>' /home/ivg/.opam/devel/build/ocaml/stdlib/pervasives.ml:39:0
ocp-browser is a great interface for this utility.
All are integrated with Emacs (and other popular text editors). Speaking of text editors and IDEs, Merlin is a killer feature, without which I can no longer imagine OCaml coding. He is able to go directly to the definition, retrieve documentation and incremental type checking.
Speaking of web search, the argot document generator appeared, which has an API search engine, text search and regular expressions. The project is somewhat abandoned and does not work with the latest OCaml.
We forked it, updated it to the latest OCaml, fixed several bugs and improved the unification procedure to get a better search by type. The result can be found here .
One of the main features is the search manifest by type, which ignores such irrelevant things as the order of parameters in functions, field names, differences between record names and tuples (for example, string * int
matches {name : string; age : int}
) and smoothing. For example, in our project there are many aliases, for example, type bil = stmt list = Stmt.t list = Stmt.t Core_kernel.Std.list = ...
You can select any name during the search (using the type manifest), since the algorithm will correctly combine all the aliases.
source share