No description or website provided.
OCaml Ruby Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

99 Problems in OCaml


  • Opam
  • Batteries: use this package for goodies like List.take and List.drop

I. Install OCaml + OPAM

See Yaron Minsky's documentation here.

II. Install utop (from Real World OCaml)

$ opam init
$ opam switch 4.00.1+short-types
$ opam install utop core_extended 
$ eval `opam config -env`

You may need to add `opam config -env` to your .bash_profile (there may be a better way of doing this). Now, go get a cup of coffee or a beer, this is going to take a while to install.

III. Create an OCaml init (from Real World OCaml)

Create an init file, such as ~/.ocamlinit

Then add these lines:

#use "topfind"
#require ""

IV. Installing packages

opam install {package_name} (i.e. batteries)

add the new dependency to your _tags file: <*>: package(batteries) (The tags file will be created when you compile using ocamlbuild, shown below.)

V. Using packages

  • We open the package namespace, like this: open Batteries;;

VI. Compiling and running

  • ocamlbuild -use-ocamlfind {file_name}.native
  • ./{file_name}.native

VII. Resources

  • #ocaml on IRC is ok for asking questions. But be sure to give a detailed expalation of what you are doing.