Module NS

Global namespace intended to be opened in each source file

Support for @@deriving compare, equal, sexp on builtin types

include module type of Ppx_compare_lib.Builtin
val compare_bool : bool Base__Ppx_compare_lib.compare
val compare_char : char Base__Ppx_compare_lib.compare
val compare_float : float Base__Ppx_compare_lib.compare
val compare_int : int Base__Ppx_compare_lib.compare
val compare_int32 : int32 Base__Ppx_compare_lib.compare
val compare_int64 : int64 Base__Ppx_compare_lib.compare
val compare_nativeint : nativeint Base__Ppx_compare_lib.compare
val compare_string : string Base__Ppx_compare_lib.compare
val compare_unit : unit Base__Ppx_compare_lib.compare
val compare_array : 'a Base__Ppx_compare_lib.compare -> 'a array Base__Ppx_compare_lib.compare
val compare_list : 'a Base__Ppx_compare_lib.compare -> 'a list Base__Ppx_compare_lib.compare
val compare_option : 'a Base__Ppx_compare_lib.compare -> 'a option Base__Ppx_compare_lib.compare
val compare_ref : 'a Base__Ppx_compare_lib.compare -> 'a Stdlib.ref Base__Ppx_compare_lib.compare
val equal_bool : bool Base__Ppx_compare_lib.equal
val equal_char : char Base__Ppx_compare_lib.equal
val equal_float : float Base__Ppx_compare_lib.equal
val equal_int : int Base__Ppx_compare_lib.equal
val equal_int32 : int32 Base__Ppx_compare_lib.equal
val equal_int64 : int64 Base__Ppx_compare_lib.equal
val equal_nativeint : nativeint Base__Ppx_compare_lib.equal
val equal_string : string Base__Ppx_compare_lib.equal
val equal_unit : unit Base__Ppx_compare_lib.equal
val equal_array : 'a Base__Ppx_compare_lib.equal -> 'a array Base__Ppx_compare_lib.equal
val equal_list : 'a Base__Ppx_compare_lib.equal -> 'a list Base__Ppx_compare_lib.equal
val equal_option : 'a Base__Ppx_compare_lib.equal -> 'a option Base__Ppx_compare_lib.equal
val equal_ref : 'a Base__Ppx_compare_lib.equal -> 'a Stdlib.ref Base__Ppx_compare_lib.equal
module Sexp = Sexplib.Sexp
include module type of Ppx_sexp_conv_lib.Conv
val default_string_of_float : (float -> string) Stdlib.ref
val write_old_option_format : bool Stdlib.ref
val read_old_option_format : bool Stdlib.ref
val list_map : ('a -> 'b) -> 'a list -> 'b list
val sexp_of_unit : unit -> Sexplib0__.Sexp.t
val sexp_of_bool : bool -> Sexplib0__.Sexp.t
val sexp_of_string : string -> Sexplib0__.Sexp.t
val sexp_of_bytes : bytes -> Sexplib0__.Sexp.t
val sexp_of_char : char -> Sexplib0__.Sexp.t
val sexp_of_int : int -> Sexplib0__.Sexp.t
val sexp_of_float : float -> Sexplib0__.Sexp.t
val sexp_of_int32 : int32 -> Sexplib0__.Sexp.t
val sexp_of_int64 : int64 -> Sexplib0__.Sexp.t
val sexp_of_nativeint : nativeint -> Sexplib0__.Sexp.t
val sexp_of_ref : ('a -> Sexplib0__.Sexp.t) -> 'a Stdlib.ref -> Sexplib0__.Sexp.t
val sexp_of_lazy_t : ('a -> Sexplib0__.Sexp.t) -> 'a lazy_t -> Sexplib0__.Sexp.t
val sexp_of_option : ('a -> Sexplib0__.Sexp.t) -> 'a option -> Sexplib0__.Sexp.t
val sexp_of_pair : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('a * 'b) -> Sexplib0__.Sexp.t
val sexp_of_triple : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('c -> Sexplib0__.Sexp.t) -> ('a * 'b * 'c) -> Sexplib0__.Sexp.t
val sexp_of_list : ('a -> Sexplib0__.Sexp.t) -> 'a list -> Sexplib0__.Sexp.t
val sexp_of_array : ('a -> Sexplib0__.Sexp.t) -> 'a array -> Sexplib0__.Sexp.t
val sexp_of_hashtbl : ('a -> Sexplib0__.Sexp.t) -> ('b -> Sexplib0__.Sexp.t) -> ('a, 'b) Stdlib.Hashtbl.t -> Sexplib0__.Sexp.t
val sexp_of_opaque : 'a -> Sexplib0__.Sexp.t
val sexp_of_fun : ('a -> 'b) -> Sexplib0__.Sexp.t
exception Of_sexp_error of exn * Sexplib0__.Sexp.t
val record_check_extra_fields : bool Stdlib.ref
val of_sexp_error : string -> Sexplib0__.Sexp.t -> 'a
val of_sexp_error_exn : exn -> Sexplib0__.Sexp.t -> 'a
val unit_of_sexp : Sexplib0__.Sexp.t -> unit
val bool_of_sexp : Sexplib0__.Sexp.t -> bool
val string_of_sexp : Sexplib0__.Sexp.t -> string
val bytes_of_sexp : Sexplib0__.Sexp.t -> bytes
val char_of_sexp : Sexplib0__.Sexp.t -> char
val int_of_sexp : Sexplib0__.Sexp.t -> int
val float_of_sexp : Sexplib0__.Sexp.t -> float
val int32_of_sexp : Sexplib0__.Sexp.t -> int32
val int64_of_sexp : Sexplib0__.Sexp.t -> int64
val nativeint_of_sexp : Sexplib0__.Sexp.t -> nativeint
val ref_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a Stdlib.ref
val lazy_t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a lazy_t
val option_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a option
val pair_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> Sexplib0__.Sexp.t -> 'a * 'b
val triple_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> (Sexplib0__.Sexp.t -> 'c) -> Sexplib0__.Sexp.t -> 'a * 'b * 'c
val list_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a list
val array_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a array
val hashtbl_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> (Sexplib0__.Sexp.t -> 'b) -> Sexplib0__.Sexp.t -> ('a, 'b) Stdlib.Hashtbl.t
val opaque_of_sexp : Sexplib0__.Sexp.t -> 'a
val fun_of_sexp : Sexplib0__.Sexp.t -> 'a
val sexp_grammar_with_tags : Sexplib0__.Sexp_grammar.grammar -> tags:(string * Sexplib0__.Sexp.t) list -> Sexplib0__.Sexp_grammar.grammar
val sexp_grammar_with_tag_list : 'a Sexplib0__.Sexp_grammar.with_tag_list -> tags:(string * Sexplib0__.Sexp.t) list -> 'a Sexplib0__.Sexp_grammar.with_tag_list
val unit_sexp_grammar : unit Sexplib0__.Sexp_grammar.t
val bool_sexp_grammar : bool Sexplib0__.Sexp_grammar.t
val string_sexp_grammar : string Sexplib0__.Sexp_grammar.t
val bytes_sexp_grammar : bytes Sexplib0__.Sexp_grammar.t
val char_sexp_grammar : char Sexplib0__.Sexp_grammar.t
val int_sexp_grammar : int Sexplib0__.Sexp_grammar.t
val float_sexp_grammar : float Sexplib0__.Sexp_grammar.t
val int32_sexp_grammar : int32 Sexplib0__.Sexp_grammar.t
val int64_sexp_grammar : int64 Sexplib0__.Sexp_grammar.t
val nativeint_sexp_grammar : nativeint Sexplib0__.Sexp_grammar.t
val sexp_t_sexp_grammar : Sexplib0__.Sexp.t Sexplib0__.Sexp_grammar.t
val ref_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t -> 'a Stdlib.ref Sexplib0__.Sexp_grammar.t
val lazy_t_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t -> 'a lazy_t Sexplib0__.Sexp_grammar.t
val option_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t -> 'a option Sexplib0__.Sexp_grammar.t
val list_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t -> 'a list Sexplib0__.Sexp_grammar.t
val array_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t -> 'a array Sexplib0__.Sexp_grammar.t
val opaque_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t
val fun_sexp_grammar : 'a Sexplib0__.Sexp_grammar.t
val sexp_of_exn : exn -> Sexplib0__.Sexp.t
val printexc_prefer_sexp : exn -> string
val sexp_of_exn_opt : exn -> Sexplib0__.Sexp.t option
module Exn_converter : sig ... end
val ignore : 'a -> unit

Comparison

val min : int -> int -> int
val max : int -> int -> int
val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val equal : int -> int -> bool
module Poly : sig ... end

Polymorphic comparison and hashing

module Ord : sig ... end

Function combinators

val let@ : ('a -> 'b) -> 'a -> 'b

let@ x = e in b is equivalent to e @@ fun x -> b, that is, e (fun x -> b)

val (>>) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c

Composition of functions: (f >> g) x is exactly equivalent to g (f (x)). Left associative.

val (<<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c

Reverse composition of functions: (g << f) x is exactly equivalent to g (f (x)). Left associative.

val ($) : ('a -> unit) -> ('a -> 'b) -> 'a -> 'b

Sequential composition of functions: (f $ g) x is exactly equivalent to (f x) ; (g x). Left associative.

val ($>) : 'a -> ('a -> unit) -> 'a

Reverse apply and ignore function: x $> f is exactly equivalent to f x ; x. Left associative.

val (<$) : ('a -> unit) -> 'a -> 'a

Apply and ignore function: f <$ x is exactly equivalent to f x ; x. Left associative.

Tuple operations

val fst3 : ('a * _ * _) -> 'a

First projection from a triple.

val snd3 : (_ * 'b * _) -> 'b

Second projection from a triple.

val trd3 : (_ * _ * 'c) -> 'c

Third projection from a triple.

Map-and-construct operations that preserve physical equality

val map1 : ('a -> 'a) -> 'b -> ('a -> 'b) -> 'a -> 'b
val map2 : ('a -> 'a) -> 'b -> ('a -> 'a -> 'b) -> 'a -> 'a -> 'b
val map3 : ('a -> 'a) -> 'b -> ('a -> 'a -> 'a -> 'b) -> 'a -> 'a -> 'a -> 'b
val map4 : ('a -> 'a) -> 'b -> ('a -> 'a -> 'a -> 'a -> 'b) -> 'a -> 'a -> 'a -> 'a -> 'b
val mapN : ('a -> 'a) -> 'b -> ('a array -> 'b) -> 'a array -> 'b
val fold_map_from_map : ('a -> f:('b -> 'c) -> 'd) -> 'a -> 's -> f:('b -> 's -> 'c * 's) -> 'd * 's

Pretty-printing

type 'a pp = Stdlib.Format.formatter -> 'a -> unit

Pretty-printer for argument type.

type ('a, 'b) fmt = ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4

Format strings.

Monadic syntax

module type Applicative_syntax = sig ... end
module type Monad_syntax = sig ... end

Monads

module Monad : sig ... end

Data types

module Sign : sig ... end
module Char = Containers.Char
module Int : sig ... end
module Z : sig ... end
module Q : sig ... end
module Float : sig ... end
module String : sig ... end

Iterators

module Iter : sig ... end
include module type of Iter.Import
type +'a iter = ('a -> unit) -> unit

Containers

module Comparer : sig ... end

Singleton types for compare functions

module Option : sig ... end
include module type of Option.Import
val (|>=) : 'a option -> ('a -> 'b) -> 'b option
val (>>=) : 'a option -> ('a -> 'b option) -> 'b option
val let* : 'a option -> ('a -> 'b option) -> 'b option
val and* : 'a option -> 'b option -> ('a * 'b) option
val let+ : 'a option -> ('a -> 'b) -> 'b option
val and+ : 'a option -> 'b option -> ('a * 'b) option
module Result : sig ... end
type 'a zero_one_many =
  1. | Zero
  2. | One of 'a
  3. | Many
type ('a, 'b) zero_one_many2 =
  1. | Zero2
  2. | One2 of 'a * 'b
  3. | Many2
module Pair = Containers.Pair
module List : sig ... end
module RAL : sig ... end
module Array : sig ... end
module IArray : sig ... end

IArray - Immutable view of an array

include module type of IArray.Import
type 'a iarray
val compare_iarray : ('a -> 'a -> int) -> 'a iarray -> 'a iarray -> int
val equal_iarray : ('a -> 'a -> bool) -> 'a iarray -> 'a iarray -> bool
val sexp_of_iarray : ('a -> Sexplib0.Sexp.t) -> 'a iarray -> Sexplib0.Sexp.t
val iarray_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a iarray
module Set : sig ... end
module Map : sig ... end
module Multiset : sig ... end

Multiset - Set with multiplicity for each element

module Bijection = CCBijection
module HashSet : sig ... end
module HashTable : sig ... end

Hash tables

module HashQueue = Core.Hash_queue

System interfaces

module Sys : sig ... end
module Timer : sig ... end

Timers for runtime statistics

module Invariant : sig ... end

Invariants

Failures

exception Replay of exn * Sexp.t
exception Unimplemented of string
val fail : ('a, unit -> _) fmt -> 'a

Emit a message at the current indentation level, and raise a Failure exception indicating a fatal error.

val todo : ('a, unit -> _) fmt -> 'a

Raise an Unimplemented exception indicating that an input is valid but not handled by the current implementation.

val warn : ('a, unit -> unit) fmt -> 'a

Issue a warning for a survivable problem.

Assertions

val assertf : bool -> ('a, unit -> unit) fmt -> 'a

Raise an Failure exception if the bool argument is false, indicating that the expected condition was not satisfied.

val checkf : bool -> ('a, unit -> bool) fmt -> 'a

As assertf but returns the argument bool.

val check : ('a -> unit) -> 'a -> 'a

Assert that function does not raise on argument, and return argument.

val violates : ('a -> unit) -> 'a -> _

Assert that function raises on argument.

val register_sexp_of_exn : exn -> (exn -> Sexp.t) -> unit

Register a function to convert exceptions with the same constructor as the given one to sexps.

module Hashtbl : sig ... end