Quick Start to TypeRex

Warning! The packages available in OPAM are beta-version of the version 2 of typerex. These versions rely of the cmt files generated by the 4.00 OCaml compiler, with the -bin-annot option. Thus, most of the instructions given on this website are outdated. We are planning to improve the documentation.

1. update your Emacs config

The first thing you need is to modify your ~/.emacs file to use TypeRex. In TypeRex's source directory, type:

cat emacs.append >> ~/.emacs

2. create a .typerex file for your project

By default, TypeRex only looks for files in the current directory. If your project sources span several directories, you must create a .typerex file at the root of your project.

An example of .typerex file with 3 source directories and one library directory:

.
src/tools
src/libs
I +batteries

3. modify your Makefile to build binary annotation files

If you usually build in bytecode during development, just replace:

OCAMLC=ocamlc.opt
OCAMLOPT=ocamlopt.opt

by:

OCAMLC=ocp-ocamlc.opt
OCAMLOPT=ocp-ocamlopt.opt

4. Enjoy!

Open an .ml file with Emacs, then type C-o. This will show a list of available commands.