WWW/HTTP

With Eliom, you can implement client-server Web applications fully in OCaml.
Client parts, delimited by a syntax extension, are automatically extracted
from the application source code and compiled to Javascript using the
Js_of_ocaml compiler.
Eliom also provides very powerful tools to implement classical Web sites, and
makes it possible to mix usual Web interactions with advanced client side
features.

A small threaded line printer daemon whose primary goal was to enable the use of a windows-only printer, it should be easily modifiable for other purposes. A small module of pervasive-like functions for sockets on all platforms (including win9x) is bundled together.

This library implements an AMQP client for accessing a message broker. The supported protocol version is 0-9-1, and successful tests have been run against RabbitMQ.
The library is designed as an extension to Ocamlnet.

This library implements the client side of the WebDAV protocol (RFC 4918). The file locking part of WebDAV is omitted, though.
The library uses Ocamlnet's [netclient] library for client-side HTTP, and extends it by providing the required access methods for WebDAV. Additionally, there is also an implementation for Ocamlnet's Netfs.stream_fs abstraction modelling a simple file system.

Databases

Macaque (Macros for Caml Queries) is a DSL for OCaml, wich produce SQL requests from a comprehension syntax. Macaque can build queries by from simpler components, using phantom types used to ensure safety.

This is an early release of a DBMS driver for Objective Caml. There is a generic interface that must be instantiated with a so-called low level driver. Currently, there is only a driver for the Adabas DBMS.

General purpose libraries

THis library contains a lot of the routines the author find needing all the time that aren't in the standard library (Especially string searching and manipulation), and some other odds and ends that are useful at times. Highlights include wildcard globbing, lots of string searching and manipulation routines, locale support, ~user-style path expansion, and more.

ExtLib is a project aiming at providing a complete - yet small - standard library for the OCaml programming langage. The purpose of this library is to add new functions to OCaml Standard Library modules, to modify some functions in order to get better performances or more safety (tail-recursive) but also to provide new modules which should be useful for the average OCaml programmer.

Simple sequence abstract datatype, intented to transfer a finite number of elements from one data structure to another. Some transformations on sequences, like filter, map, take, drop and append can be performed before the sequence is iterated/folded on.

A small library (a module in fact) that is meant
to make it easy to produce pretty-printed text.
The data to be printed goes through a tree that carries all the
information required for pretty-printing. After that, a single call to
Easy_format.Pretty.to_stdout (for instance) outputs the indented result.

Uunf is an OCaml module for normalizing Unicode text. It supports all Unicode normalization forms and is independent from any IO mechanism or Unicode text data structure. Text can be processed without a complete in-memory representation.

Uutf is an non-blocking streaming Unicode codec for OCaml to decode and encode the UTF-8, UTF-16, UTF-16LE and UTF-16BE encoding schemes. It can efficiently work character by character without blocking on IO. Decoders perform character position tracking and support newline normalization.
Functions are also provided to fold over the characters of UTF encoded OCaml string values and to directly encode characters in OCaml Buffer.t values.

Numeric computation

An OCaml module for performing exact arithmetic on real numbers by representing them as continued fractions. It implements the well-known algorithm described by R.W. Gosper (see reference below). The continued fractions are lazy evaluated (eventually infinite) lists. Basic arithmetic operations as well as many transcendent functions are available.

Mathlib is a collection of hopefully-useful functions for working with floats, Complex numbers, and random numbers. It has the basic math functions added to the C99, trigonometric functions for complex numbers, the Mersenne Twister random number generator, and modules for generating random numbers in a variety of distributions.

Jsonm is a non-blocking streaming codec to decode and encode the JSON data format. It can process JSON text without blocking on IO and without a complete in-memory representation of the data.
The uncut codec also processes whitespace and (non-standard) JSON with JavaScript comments.

Ostap is an OCaml module to provide a set of parser combinators. The name of this library originates from Ostap Bender --- the central character of Ilya Ilf and Eugene Petrov's comedy "The Twelve Chairs". Bender is generally referred to as "The Great Combinator" since the word "combinator" in Russian also means "a swindler", "a sly man" etc.
Additionally to the common set of parser combinators Ostap provides a camlp4 syntax extension pa_ostap.cmo to embed grammar expressions written in BNF-like style into OCaml code. Another feature of pa_ostap is that it allows to consider streams as objects and so makes integration of lexers and parsers simpler. Please have a look at the documentation for details.

Data structures

Bindlib is a library and a camlp4 syntax extension for the OCaml language. It proposes a set of tools to manage data structures with bound and free variables. It includes fast substitution and management of variables names including renaming.

This module implements compact integer sets, represented as a (custom) list of integer intervals. Usual set operations are provided. The advantage compared to ordered lists is that the actual size may be smaller than the cardinal of a set when many elements are contiguous. Most set operations are linear w.r.t. the size of the structure, not the cardinal of the set.

Dum is a library for inspecting the runtime representation of arbitrary Objective Caml values.
Shared or cyclic data are detected and labelled. This guarantees that printing would always terminate. This makes it possible to print values such as closures, objects or exceptions in depth and without risk.

This library can read and write CSV files, including all extensions used by Excel - eg. quotes, newlines, 8 bit characters in fields, "0 etc.
The library comes with a handy command line tool called csvtool for handling CSV files from shell scripts.

A modular framework of Objective Caml libraries comprising general purpose utilities and functional data structures, a more flexible abstraction of the system network sockets layer than the standard library, and modules to support the development of concurrent, single-threaded network application services with a functional programming style.

Uuidm is an OCaml module implementing 128 bits universally unique
identifiers version 3, 5 (name based with MD5, SHA-1 hashing) and 4
(random based) according to RFC 4122.
Uuidm is made of a single, independent, module and distributed under
the new BSD license.

OCaml-safepass is a library offering facilities for the safe storage of user passwords. By "safe" we mean that passwords are salted and hashed using the Bcrypt algorithm. Salting prevents rainbow-table based attacks, whereas hashing by a very time-consuming algorithm such as Bcrypt renders brute-force password cracking impractical.

Password generator will return a password of configurable length. It can add special characters, digits, and capital letters to the password as well. The password is more human readable than a completely random secure password. The number of digits, special characters and capital letters is also configurable.

Multimedia

Audio

Ocaml-cry is an OCaml native implementation of the protocols used to send source data to icecast and shoutcast servers.
The main difference with the famous libshout implementation is that is allows to set custom fields for source headers, allowing in particular the use of any custom format. Also, contrary to libshout, this module does not handle synchronisation of the data sent to the server, which is then up to the programmer.

Programming languages

Typing

A module for runtime type checking in Ocaml.
Memcheck is very similar to SafeUnmarshal but without a few of SafeUnmarshal's limitations. In particular, with Memcheck it only takes seconds to check a few megabytes instead of hours as with
SafeUnmarshal.

Program analysis

manipulate, and generate valid .class files.Sawja is a library relying on Javalib to provide a high level representation of Java bytecode programs. Its name stands for Static Analysis Workshop for Java. Whereas Javalib is dedicated to isolated classes, Sawja handles bytecode programs with their class hierarchy and control flow algorithms. Moreover, Sawja provides some stackless intermediate representations of code. The transformation algorithm, common to these representations, has been formalized and proved to be semantics-preserving.An Eclipse plugin for Sawja analyses is also available: it allows developers to add an analysis in Eclipse without requiring any additional Java code generation.

Publishing

Camlhighlight provides syntax highlighting and pretty-printing facilities for displaying code samples in Ocsigen applications. The library works by parsing the output of Highlight, a widely available application supporting the most common programming and markup languages.

Melt is a set of libraries and tools which allows you to program LaTeX
documents using OCaml. This combines the typesetting power of LaTeX with
the programming power of OCaml. It can be combined with Mlpost to
include figures.

Typing

Wallace is a generic subtyping-constraint-handling library. It deals with constraint solving and simplification, and it is parameterized by the definition of a type algebra. Its goal is to serve as a plug-in component in the design of a constraint-based type-checker, regardless of the programming language being analyzed.

Robotics

LEGO Mindstorm® is a versatile robotic construction kit. The central component is the programmable NXT brick to which one can connect up to three motors and various sensors. The brick can run programs directly uploaded to it or can be controlled via bluethooth or USB.
This library allows you to communicate with  and drive  your NXT brick from OCaml programs through a bluetooth connection. The full LEGO® communication protocol (including all "direct commands") is supported. This library has been tested on Linux, Windows (without the fantom drivers installed) and Mac OSX.

HANSEI is the the embedded domain-specific language for probabilistic programming: for writing potentially infinite discrete-distribution models and performing exact inference, importance sampling and inference of inference.
HANSEI is an ordinary OCaml library, with probability distributions represented as ordinary OCaml programs. Delimited continuations let us reify non-deterministic programs as lazy search trees, which we may then traverse, explore, or sample. Thus an inference procedure and a model invoke each other as co-routines. Thanks to the delimited control, deterministic expressions look exactly like ordinary OCaml expressions, and are evaluated as such, without any overhead.
Inference procedures and probabilistic models are both ordinary OCaml functions. Both may be defined and extended by library users; both may appear in each other's code. Performing inference on a model that includes calls to inference procedures lets us parameterize distributions by distributions, and lets inference procedures measure their own accuracy. One application is modeling agents reasoning about each other's limited reasoning.

Linguistics

This package contains the OCaml Interface to WordNet 2.1. It enables Ocaml programs to use
the Wordnet dictionary for (english) word forms and meanings. This library directly parses the WordNet dictionary files, and does not depend on any other libraries. This library requires WordNet 2.1 to be installed (WordNet is available as a free download).

This library can be used to segment Newspaper style (english) text articles into sentences. It uses the Ocaml lexer with a simple set of lexical rules to classify those periods ('.') in the text that end sentences.

This toolkit offers a few fundamental structures useful for computational linguistics. It is implemented in Pidgin ML, which is a core subset of the Objective Caml programming language under the so-called revised syntax.

GenePool is a framework for writing evolutionary optimization algorithms in OCaml. This library is not a complete solution but rather is a generic skeleton which takes care of the plumbing and nuisances of optimization. You provide GenePool with functions that give meaning to fitness and reproduction and after a specified number of generation, GenePool returns an array of the best "genomes" it evolved.

The facility that prints results and types of expressions evaluated at
the top-level is now available anywhere in the program -- in bytecode-
or natively compiled programs. Generic printing is a (perhaps
unintentional) `side-effect' of MetaOCaml -- of the fact that a code
value is not merely AST; the code value also captures the type and the
type environment of variables and other values. Generic printing is a
library that works with the unmodified MetaOCaml (which is _fully_
compatible with the regular OCaml).

This software implements the researches of the thesis of Peggy Cénac. Use the CGR to build a new family of tests of structure of sequences (i.i.d., markovian), empirically check the level and power of the tests and apply them on DNA sequences. Generalize the dinucleotide abundance profile to a CGR-based relative abundance profile and use this profile on DNA sequences to build taxonomy trees. Define CGR-trees, which are Digital Search Trees built from sequences, and check that the empirical longest branches, shortest branches and insertion level match the theorical results of the thesis.

Software development

Objsize is a small OCaml library for computing size of OCaml values. It computes count of words used for values, count of values' headers, maximal depth of values. There are functions to get size of values in bytes too.

Language extensions

Ocaml-ast-analyze should provide an abstraction of the structure required to build pr_*.cmo module for camlp4. The idea is to provide a simple way to build Ocaml abstract syntax tree analyzer. This should be particularly useful for string extraction of Ocaml source code.

Resumable exceptions are the strict generalization of regular exceptions,
which lets the exception raising form return a value and so the
computation may continue. It's the exception handler that decides
either to abort the exceptional computation or to resume it with a
particular value. We show a conservative and elementary implementation of resumable
exceptions in OCaml: the implementation is a self-contained 100% pure
OCaml library.

Debugging

Inspect is a small library to inspect arbitrary OCaml values and their
associated object graph by either dumping them as S-expressions (with
sharing and references), or by writing output in the DOT-language
which can then be further processed by Graphviz
(http://www.graphviz.org/).

Orpc is a tool for generating RPC clients and servers. It can generate
clients / servers for use with Ocamlnet's ONC RPC implementation (like
ocamlrpcgen), and also for RPC over HTTP for use with ocamljs. To
describe interfaces, you give orpc an OCaml signature instead of an
RFC-1831/1832-format file. Most OCaml types (including polymorphic
types), exceptions, and functions with labelled/optional arguments are
supported.

RPC is a package supporting the Sun RPC protocol. RPC programs, procedures, clients, and servers can be dynamically represented and modified. Of course, there is also a classical RPC generator which generates functions doing the language mapping from XDR values to language values and vice versa.

System programming

'Concurrent Cell' is a library for multi-thread programming with CML(Concurrent ML) style synchronous message passing communications.
The Threads library, a part of OCaml, realizes the CML style event value, but does not support shared variables like ivar and mvar. This library implements these variables without creating any new thread. This means that ivar and mvar are lightweight and GC target.

"io" is an IO combinator library for safe I/O over strings and channels,
in the style of "picklers" which can then be used with various backends
to safely load and save data. Currently available backends include :
human readable ASCII, binary and compressed binary. A type-independent
command can convert between different representations. The
representation for records and sum types is upwards compatible. Note
that sharing and circular structures are not supported.

Lpd is a Line Printer Daemon (LPD) server library written entirely in OCaml. It allows to define your own actions for LPD events. An example of a spooler that prints jobs on win32 machines (through GSPRINT) is provided.

An advanced scheduler. The basics of this scheduler is to implement a wrapper around Unix.select in
order to be able to wait for events on a socket and/or a given delay and
execute a task when one of the waited events occured.

This library implements the xdg-basedir specification. It helps to define
standard locations for configuration, cache and data files in the user
directory and on the system.
It is a straightforward implementation on UNIX platform and try to apply
consistent policies with regard to Windows directories.

Shell programming

Hardware

HDCaml provides a framework for describing hardware structures in OCaml.
Given a functional hardware description, HDCaml will produce a Verilog
netlist for verification and implementation.
HDCaml also has decent PSL support for assertion based verification.

Distributed and parallel programming

A library to help writing distributed programs. The library manages all the details relevant to process launching, channel creation, and network communication so as to let the programmer stick to the core of the problem. This allows to write programs that can be distributed on several machines in a concise way, with all the parallel aspects kept implicit (no synchronisation).

coThreads is a concurrent programming library for OCaml. It enhances the Threads library of the standard OCaml distribution in two dimensions: coThreads implements the same API of the standard Threads library on different execution engines (process, netwoker(todo)), so that a single copy of source code can be compiled and deployed to different environments without modification; coThreads is also a super set of the standard Threads library, with extra components (STM etc.), functions (spawn etc.) and features (object-level compatibility etc.).

Froc is a library for function reactive programming in OCaml. The
interface is similar to FrTime and FlapJax, but (of course) typed,
implementing a monad of changeable values. The implementation is
data-driven, using the dynamic dependency graphs of Acar et al.'s
adaptive functional programming.
Froc can be used with ocamljs, and with the included Froc-dom library
can be used for web browser programming.

Lwt is a library for cooperative threads in OCaml. It is using monadic style, which makes it really easy to use. With respect to preemptive threads, cooperative threads are not using a scheduler to distribute processor time between threads. Each thread must instead tell other threads that it wants them to continue. An uncooperative thread will keep other threads blocked until it has completed its work.

ODisco is a library for implementing Disco map-reduce jobs in OCaml.
It implements the Disco worker protocol, and provides the plumbing to
connect user-specified computations to Disco data sources and results.

A functional-reactive approach for developing distributed systems in Objective Caml. In Opis, a protocol description consists of a reactive function (called event function) describing the behavior of a distributed system node. The event functions in Opis are built from pure functions as building blocks, composed using the Arrow combinators. This facilitates reasoning about event functions both informally and using interactive provers. For example, this approach leads to simple termination arguments.

React is an OCaml module for
functional reactive programming (FRP). It
provides support to program with time varying values : applicative
events and signals. React doesn't define any primitive event or
signal, this lets the client chooses the concrete timeline.

Release is a multi-process Lwt-enabled daemon framework for OCaml, providing facilities for type-safe inter-process communication and privilege-dropping.
Its goal is to make it easy to write servers that are released from the calling terminal and to release root privileges when those are not necessary.

Rtime is an OCaml module implementing timelines for React [1]. It manages time stamp
events, delayed events and delayed signals along timelines. The client chooses the
concrete timeline by providing an absolute notion of time. Running the timeline at the
appropriate pace is left to the client.

Scampi (Simple CAml to MPI interface) is small library allowing Caml programs to make calls to MPI-1 communication routines. For now only a few calls are provided (basically, getting communicator size, rank and making synchronous and asynchronous send/receive of polymorphic data plus a couple of collective comm), but it is expected that subsequent versions will enlarge the set of provided bindings. This first version, however, effectivily allows building parallel Caml programs running in SPMD mode on a network of workstations for example.

This is a user-space implementation of STM (Software Transactional Memory)
library for OCaml. It's mainly inspired by the STM library of Haskell, with
some exceptions due to the different nature of languages and different
strategies of implementation.

User interfaces

A message catalog system for localising text in OCaml programs.
The approach taken is partly inspired by Perl's Locale::Maketext module. In an attempt to provide the flexibility needed to adapt sentence structure and morphology to numeric parameters in messages, the library uses a general-purpose template engine, CamlTemplate as a language for writing message templates.

Graphical toolkits

Some code to make it relatively easy to develop custom tree models using LablGTK (GTK+ 2.0 in OCaml).
This means that you can have a tree structure coded naturally in OCaml and treat it more or less directly as a tree model, instead of having to shove values into a GTree.tree_store. There are some caveats as described in the README file.

A simple GUI for OCaml. It offers two kinds of widgets, to wit, buttons and an Emacs like mini-editor.The idea is to create a GUI with a very small footprint, that is easy to handle for final users, and productive for developers.

Command line

Cmdliner is an OCaml module for the declarative definition of command line interfaces.
It provides a simple and compositional mechanism to convert command line arguments to OCaml values and pass them to your functions. The module automatically handles syntax errors, help messages and UNIX man page generation. It supports programs with single or multiple commands (like darcs or git) and respects most of the POSIX and GNU conventions.

XML

Galax is an open-source implementation of XQuery 1.0, the W3C XML Query Language. Galax closely tracks the definition of XQuery 1.0 as specified by the W3C and also implements XPath 2.0, which is a subset of XQuery 1.0.

XmlRPCServer is a server side implementation for the XmlRPC package developed by Shawn Wagner. This package provides methods to transform between OCaml data-types and their XmlRPC representation, and visa versa. In addition it provide the client side functionality which enables OCaml clients to call servers written in other languages using XmlRPC. However the current version of the package does not support writing the server side in OCaml, unless you do most of the work yourself.

This package implements the XPath recommendation; XPath is a simple query language for XML. A compact XPath expression can perform a relatively complex search on the document tree. XPath is used by XLink and XSLT.
The package is modularized and functorial: the evaluator is a functor taking as argument an implementation of the XPath Data Model as defined in the recommendation. The package include a lightweight implementation, build from the Pxp document tree. A future version will include a Data Model implementation working directly on this document tree.

XML formats

A quite simple program to do some basic routing over Open Streat Map maps. It parses an .osm.bz2 file, creates a compact data structure in memory (which is saved into a cache to speed up next searches), finds the OSM nodes closest to the source and goal points given as (latitude, longitude) couples, does the routing itself, prints it on the screen and saves it in .osm XML format (for example to load it into JOSM).

Uucd is an OCaml module to decode the data of the Unicode character database from its XML representation. It provides high-level (but not necessarily efficient) access to the data so that efficient representations can be extracted.

Tony is a simple XML parser and pretty printer for Objective Caml. While you would most likely use it as a library it comes for demonstration purposes as an application. Tony reads an XML file and pretty prints it nicely. The parser is implemented using Lex and Yacc, the pretty printer using Philip Wadler's pretty-printing algebra. Today more complete (and complex) XML parsers for OCaml exist; Tony is still useful if you want to cover the basic case.

Tyxml is a library that makes it almost impossible for your OCaml programs to generate wrong XML ouput, using static typing.
Modules exist for XHTML1, HTML5 and SVG.
Tyxml also defines pretty printers for these types.

XHTML is a O'Caml module for creating valid XHTML 1.1 (and XHTML 1.0) documents. The validity of the pages is guaranteed by the O'Caml type system. (NB: at the time of writing, forms support was not complete, only basic forms are implemented. Image maps are also not implemented yet.)

XML Light is a minimal XML parser & printer for OCaml. It provide functions to parse an XML document into an OCaml data structure, work with it, and print it back to an XML document.
Since version 2, XML Light add also support for DTD and PCDATA.

Xmlm is an OCaml module providing streaming XML input/output. It aims
at making XML processing robust and painless. The streaming interface
can process documents without building an in-memory representation. It
lets the programmer translate its data structures to XML documents and
vice-versa. Functions are provided to easily transform arborescent
data structures to/from XML documents.

(X)HTML

HTCaML enables the embedding of XHTML fragments in your OCaml program
(the EDSL translates directly to Xmlm) using quotations. It also allows
you to auto-generate boilerplate XHTML fragments from type definitions.

Others

CamlGI is a library to enable you to write CGI and FastCGI in OCaml. It is written 100% in OCaml so should run on many platforms. The library supports multiple simultaneous connections and request multiplexing while presenting an easy to use interface.

OCaml-Reins is a data structure library for O'Caml that includes cursor based iterators, a collection of functors to minimize client-side boilerplate, a powerful on-line benchmarking system and Quickcheck style testing infrastructure.