package core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Core is an extension of Core_kernel with Unix APIs. The unmodified libraries can be found there.

In particular, Core has comprehensive implementation of times (see Time, Time_ns, Timing_wheel_float, and Schedule_v5), where some details are platform-specific (like timing wheels based on floats).

Some modules are mere extensions of those existing in Core_kernel, like Bigbuffer, Bigstring, Caml, Time, and Md5, where what's added is handlers for reading from or writing to Unix sockets and file descriptors, or support for floating-point numbers. Other modules are entirely new, like:

  • Command, a richly featured tool for creating command-line programs.
  • Daemon, for daemonizing processes.
  • Iobuf, which lets you use contiguous ranges of bytes for I/O purposes.
  • Lock_file, for managing OS-level locks.
  • Crc, for cyclic redundancy checks.
  • Linux_ext, providing a wrapper around Linux-specific system calls.
  • Mac_address, for managing MAC addresses.
  • Signal, for handling Unix signals like SIGHUP and SIGKILL.

A few modules in Core don't have any platform-specific functionality but haven't yet been ported to Core_kernel for technical reasons (like a dependency on Time, which until recently was only in Core):

  • Interval
  • Squeue
  • Uuid
module Bigbuffer : sig ... end
module Bigstring : sig ... end

String type based on Bigarray, for use in I/O and C-bindings, extending Core_kernel.Bigstring.

module Bigstring_marshal : sig ... end

Utility functions for marshalling to and from bigstring, extending Core_kernel.Bigstring_marshal.

module Caml : sig ... end
module Command : sig ... end

Purely functional command line parsing.

module Condition : sig ... end
module Core_stable : sig ... end
module Crc : sig ... end

CRC functions.

module Daemon : sig ... end

This module provides support for daemonizing a process. It provides flexibility as to where the standard file descriptors (stdin, stdout and stderr) are connected after daemonization has occurred.

module Date : sig ... end
module Filename : sig ... end

Warning! this library assumes we are in a POSIX compliant OS.

module Interval : sig ... end

Module for simple closed intervals over arbitrary types. Used by calling the Make functor with a type that satisfies Comparable (for correctly ordering elements).

module Interval_intf : sig ... end
module Iobuf : sig ... end

A non-moving (in the GC sense) contiguous range of bytes, useful for I/O operations.

module Iobuf_debug : sig ... end

Iobufs with extra controls for debugging.

module Iobuf_intf : sig ... end
module Linux_ext : sig ... end

Interface to Linux-specific system calls.

module Lock_file : sig ... end

Mutual exclusion between processes using flock and lockf. A file is considered locked only if both of these mechanisms work.

module Mac_address : sig ... end

Functions for working with and formatting 48-bit MAC addresses.

module Md5 : sig ... end
module Digest = Md5
module Mutex : sig ... end
module Nano_mutex : sig ... end

A nano-mutex is a lightweight mutex that can be used only within a single OCaml runtime.

module Piecewise_linear : sig ... end

Piecewise linear interpolation from float-like types to float.

module Process_env : sig ... end

Utility functions for dealing with the environment.

module Schedule_v4_deprecated : sig ... end

Deprecated version of Schedule, which defines a type for schedules like "every 5 min after the hour" or "every weekday at 3pm."

module Schedule_v5 : sig ... end

Latest version of Schedule, which defines a type for schedules like "every 5 min after the hour" or "every weekday at 3pm." More expressive than V4, for example by adding the Zoned_between variant, which behaves like Between but allows expressing the start and end times in different zones.

module Signal : sig ... end

Signal handlers.

module Squeue : sig ... end

Thread-safe queue module, using locks.

module Sys : sig ... end

System interface.

module Thread : sig ... end

Lightweight threads.

module Time : sig ... end
module Time_common : sig ... end
module Time_ns : sig ... end
module Time_stamp_counter : sig ... end

High-performance timing.

module Timing_wheel_float : sig ... end

A timing wheel in which time is represented by Time.t, i.e., by a floating-point number of seconds since the epoch. This is a wrapper around Timing_wheel_ns, which is preferable both because it has better performance and because it avoids issues having to do with floating point (im)precision.

module Unix : sig ... end

This file is a modified version of unixLabels.mli from the OCaml distribution.

module User_and_group : sig ... end

A pair of Unix username and primary Unix group.

module Uuid : sig ... end

Implements universally unique identifiers based on version 3 of the UUID specification. Identifier generation is thread safe, and fast.

module Version_util : sig ... end
module Weak_hashtbl : sig ... end

A hashtable that keeps a weak pointer to each key's data and uses a finalizer to detect when the data is no longer referenced (by any non-weak pointers).

val (^/) : string -> string -> string
OCaml

Innovation. Community. Security.