Legend:
Library
Module
Module type
Parameter
Class
Class type
This module is the toplevel of the Base library; it's what you get when you write open Base.
The goal of Base is both to be a more complete standard library, with richer APIs, and to be more consistent in its design. For instance, in the standard library some things have modules and others don't; in Base, everything is a module.
Base extends some modules and data structures from the standard library, like Array, Buffer, Bytes, Char, Hashtbl, Int32, Int64, Lazy, List, Map, Nativeint, Printf, Random, Set, String, Sys, and Uchar. One key difference is that Base doesn't use exceptions as much as the standard library and instead makes heavy use of the Result type, as in:
type ('a,'b) result = Ok of 'a | Error of 'b
Base also adds entirely new modules, most notably:
Comparable, Comparator, and Comparisons in lieu of polymorphic compare.
Container, which provides a consistent interface across container-like data structures (arrays, lists, strings).
Result, Error, and Or_error, supporting the or-error pattern.
This module defines signatures that are to be included in other signatures to ensure a consistent interface to equal functions. There is a signature (S, S1, S2, S3) for each arity of type. Usage looks like:
Provides generic signatures for containers that support indexed iteration (iteri, foldi, ...). In principle, any container that has iter can also implement iteri, but the idea is that Indexed_container_intf should be included only for containers that have a meaningful underlying ordering.
This module defines signatures that are to be included in other signatures to ensure a consistent interface to invariant-style functions. There is a signature (S, S1, S2, S3) for each arity of type. Usage looks like:
Immutable, singly-linked lists, giving fast access to the front of the list, and slow (i.e., O(n)) access to the back of the list. The comparison functions on lists are lexicographic.
A monad is an abstraction of the concept of sequencing of computations. A value of type 'a monad represents a computation that returns a value of type 'a.
An uninhabited type. This is useful when interfaces require that a type be specified, but the implementer knows this type will not be used in their implementation of the interface.
The option type indicates whether a meaningful value is present. It is frequently used to represent success or failure, using None for failure. To be more descriptive about why a function failed, see the Or_error module.
'a Option_array.t is a compact representation of 'a option array: it avoids allocating heap objects representing Some x, usually representing them with x instead. It uses a special representation for None that's guaranteed to never collide with any representation of Some x.
A module containing the ad-hoc polymorphic comparison functions. Useful when you want to use polymorphic compare in some small scope of a file within which polymorphic compare has been hidden
This module defines various abstract interfaces that are convenient when one needs a module that matches a bare signature with just a type. This sometimes occurs in functor arguments and in interfaces.