No description or website provided.
OCaml Ruby Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
_tags
build.sh
build_run.rb
problems11_20.ml
problems1_10.ml
problems21_30.ml
problems41_50.ml
problems61_70.ml
test.ml
test2.ml
test21_30.ml
test5.ml
test7.ml

README.md

99 Problems in OCaml

http://ocaml.org/tutorials/99problems.html

Dependencies

  • 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"
#camlp4o
#thread
#require "core.top"

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.