package batteries

All checked builds pass
  1. Overview
  2. Docs
A community-maintained standard library extension

Install

dune-project
 Dependency

Authors

Maintainers

Sources

batteries-3.11.0.tar.gz
md5=096be9e83e347b4c7b5b6e5b2af22992
sha512=621dca842c4a7adf0ac1e907bf44c1405e0b66a088987a138a4f4e98ca744815913bf87fd780619151cb049a07d7fdb1e8adb7b65698ab46b8c2dfe46cd7119d

Description

Added to opam-repository:

README

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.

Documentation

Building Batteries

Requirements

You will need the following libraries:

  • OCaml >= 3.12.1
  • Findlib >= 1.5.3
  • GNU make
  • OUnit to build and run the tests (optional)
  • qtest >= 2.0.1 to build and run the tests (optional)
  • ocaml-benchmark to build and run the performance tests (optional)

Configuration and Installation

To install the full version of Batteries, execute

    $ make all
$ make 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/

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 Extlib 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 the guidelines wiki page.

If you use emacs, the file batteries_dev.el has extra highlighting to support writing quicktests.

Dependencies (5)

  1. num
  2. ocamlfind >= "1.5.3"
  3. camlp-streams
  4. ocaml >= "4.05" & < "5.6"
  5. dune >= "2.7"

Dev Dependencies (4)

  1. odoc with-doc
  2. benchmark with-test & >= "1.6"
  3. qcheck with-test & >= "0.9" & < "0.14"
  4. qtest with-test & >= "2.5"

Optional Dependencies

None

Build status

Results of building batteries with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
3.11.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure