Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
OCaml Other

This branch is even with ocaml-batteries-team:inf-array

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
doc
examples
libs
qtest
src
testsuite
.gitignore
ChangeLog
FAQ
LICENSE
META.in
Makefile
README
README.folders
README.md
VERSION
_tags
batteries.odocl
battop.ml
byte.itarget
myocamlbuild.ml
native.itarget
ocamlinit
shared.itarget
syntax.itarget

README.md

Welcome to OCaml Batteries Included

OCaml Batteries Included, or just Batteries, is a community-maintained foundation library for your OCaml projects. Batteries

  • defines a standard set of libraries which may be expected on every compliant installation of OCaml;

  • organizes these libraries into a hierarchy of modules, with a single source of documentation; and

  • provides a consistent API for otherwise independent libraries.

Building Batteries

Requirements

You will need the following libraries:

Configuration and Installation

To install the full version of Batteries, execute

$ make all
$ make test test          [ optional ]
$ sudo make install

$ make doc                [ optional ]
$ sudo make install-doc   [ optional ]

If you want the documentation installed elsewhere, set this before starting the build process because this location is stored in the Batteries_config module generated during compilation.

$ export DOCROOT=/path/to/new/docroot/

If you want findlib to use a -destdir argument to ocamlfind install, set

$ export DESTDIR=/path/to/findlib/dest

To disable native compilation:

$ export BATTERIES_NATIVE=false

To disable building of native shared libraries:

$ export BATTERIES_NATIVE_SHLIB=false

Using Batteries

To get started using Batteries at the toplevel, copy the ocamlinit file to ~/.ocamlinit:

$ cp ocamlinit ~/.ocamlinit

If you already have findlib in your ~/.ocamlinit, you only need the last line in our ocamlinit to load batteries.

More usage help available on the batteries-included wiki.

ExtLib Compatibility

If your project currently uses ExtLib, most likely you can just change -package extlib to -package batteries and add open Extlibcompat to the top of any extlib-using modules. Batteries' modules are all named BatFoo to differentiate them from extlib's modules, so one can use Batteries and ExtLib in the same project.

COMPATIBILITY NOTE: If you're using ExtLib's Unzip module, it does not have a corresponding module in batteries at the moment.

Extending Batteries

See doc/batteries/GUIDELINES and the guidelines wiki page.

Something went wrong with that request. Please try again.