Batteries user guide

OCaml Batteries Included documentation.

OCaml Batteries included (or simply "Batteries") is a community-driven effort to standardize on an consistent, documented, and comprehensive development platform for the OCaml programming language.

For the moment, Batteries Included concentrates on:

For more information on the installation of Batteries Included, please read the Installation guide and for an example using it in different build systems, we have the Getting started manual.

Modules listed below can also be referenced as Batteries.<short name>--where <short name> is the module name without the initial "Bat"--or as <short name> alone, if Batteries has been opened. For example, BatLazyList can also be used as Batteries.LazyList, or as LazyList after executing open Batteries.

Do you have suggestions? Remarks? Bug reports ? To contact us or to be kept informed, don't hesitate to visit our website, Git repo, and our Issue tracker.

New Data Structures in Batteries

BatBitSet

Efficient bit sets.

BatCache

The data structure for a manual cache with keys 'a and values 'b.

BatDeque

Functional double-ended queues

BatDllist

A mutable, imperative, circular, doubly linked list library

BatDynArray

Dynamic arrays.

BatEnum

Enumeration over abstract collection of elements.

BatFingerTree

This module implements a generic finger tree datastructure as described here: Finger Trees: A Simple General-purpose Data Structure http://www.soi.city.ac.uk/~ross/papers/FingerTree.pdf

BatGlobal

Mutable global variable.

BatHashcons

Hash consing of data structures

BatHeap

Functional heaps over ordered types

BatIMap

DIET Maps from integers, packed using ranges

BatISet

DIET : Discrete Interval Encoding Trees

BatLazyList

Lazy lists of elements.

BatMultiPMap

Polymorphic Multi-Map.

BatRefList

Reference on lists.

BatSeq

Sequence of elements

BatSplay

Maps and sets based on splay trees

BatText

Heavyweight strings ("ropes")

BatUChar

Unicode characters.

BatUref

Unifiable references using destructive union-find

BatUTF8

UTF-8 encoded Unicode strings.

BatVect

Extensible vectors with constant-time append/prepend.

New Modules in Batteries

BatBase64

Base64 codec.

BatCharParser

Parsing character strings.

BatFile

File manipulation.

BatInterfaces

Common signatures for data structures.

BatIO

High-order abstract I/O.

BatLog

Simple logging

BatLogger

Logging Library

BatNumber

A common interface for numbers.

BatOptParse

Modules for GNU getopt(3)-style command line parsing.

BatParserCo

A simple parser combinator library.

BatResult

Monadic results of computations that can raise exceptions

BatReturn

Local exceptions/labels/goto/return.

Builtin Types as Modules

BatBool

Operations on booleans

BatChar

Operations on characters.

BatFloat

Operations on floating-point numbers.

BatInt

Operations on integers.

BatInt32

32-bit integers.

BatInt64

64-bit integers.

BatNativeint

Processor-native integers.

BatOption

Functions for the option type.