From c358f4e1c01aaf5e0c5c04953672e89f95a80b9f Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 1 Feb 2018 19:02:38 -0600 Subject: [PATCH] update doc --- 2.0/containers/CCArray/index.html | 25 +++++------ 2.0/containers/CCArrayLabels/index.html | 23 +++++----- 2.0/containers/CCArray_slice/index.html | 18 ++++---- 2.0/containers/CCBool/index.html | 2 +- 2.0/containers/CCChar/index.html | 2 +- 2.0/containers/CCEqual/Infix/index.html | 2 +- 2.0/containers/CCEqual/index.html | 4 +- 2.0/containers/CCFloat/Infix/index.html | 2 +- 2.0/containers/CCFloat/index.html | 9 ++-- 2.0/containers/CCFormat/Dump/index.html | 2 +- 2.0/containers/CCFormat/index.html | 27 ++++++------ 2.0/containers/CCFun/Monad/index.html | 2 +- 2.0/containers/CCFun/index.html | 13 +++--- 2.0/containers/CCHash/index.html | 7 +-- 2.0/containers/CCHashtbl/Poly/index.html | 14 +++--- 2.0/containers/CCHashtbl/index.html | 14 +++--- .../CCHashtbl/module-type-S/index.html | 14 +++--- .../CCHeap/Make/argument-1-E/index.html | 2 +- 2.0/containers/CCHeap/Make/index.html | 14 ++++-- .../CCHeap/module-type-PARTIAL_ORD/index.html | 2 +- .../CCHeap/module-type-S/index.html | 14 ++++-- 2.0/containers/CCIO/File/index.html | 12 +++--- 2.0/containers/CCIO/index.html | 12 +++--- 2.0/containers/CCInt/Infix/index.html | 2 +- 2.0/containers/CCInt/index.html | 11 ++--- 2.0/containers/CCInt64/index.html | 10 ++--- 2.0/containers/CCList/Assoc/index.html | 2 +- 2.0/containers/CCList/Infix/index.html | 2 +- .../CCList/Traverse/argument-1-M/index.html | 2 +- 2.0/containers/CCList/Traverse/index.html | 2 +- 2.0/containers/CCList/index.html | 32 +++++++------- .../CCList/module-type-MONAD/index.html | 2 +- 2.0/containers/CCListLabels/Assoc/index.html | 2 +- 2.0/containers/CCListLabels/Infix/index.html | 2 +- .../Traverse/argument-1-M/index.html | 2 +- .../CCListLabels/Traverse/index.html | 2 +- 2.0/containers/CCListLabels/index.html | 43 +++++++++++-------- .../CCListLabels/module-type-MONAD/index.html | 2 +- 2.0/containers/CCMap/module-type-S/index.html | 2 +- 2.0/containers/CCOpt/Infix/index.html | 2 +- 2.0/containers/CCOpt/index.html | 7 +-- 2.0/containers/CCOrd/Infix/index.html | 4 +- 2.0/containers/CCOrd/index.html | 6 +-- 2.0/containers/CCPair/index.html | 6 +-- 2.0/containers/CCParse/Infix/index.html | 13 +++++- 2.0/containers/CCParse/U/index.html | 2 +- 2.0/containers/CCParse/index.html | 26 +++++------ 2.0/containers/CCRandom/index.html | 6 +-- 2.0/containers/CCRef/index.html | 2 +- 2.0/containers/CCResult/Infix/index.html | 5 ++- .../CCResult/Traverse/argument-1-M/index.html | 2 +- 2.0/containers/CCResult/index.html | 25 +++++------ .../CCResult/module-type-MONAD/index.html | 2 +- 2.0/containers/CCSet/module-type-S/index.html | 4 +- 2.0/containers/CCString/Sub/index.html | 4 +- 2.0/containers/CCString/index.html | 12 +++--- .../CCString/module-type-S/index.html | 4 +- 2.0/containers/CCVector/index.html | 26 +++++------ 2.0/containers/Containers/Hashtbl/index.html | 14 +++--- .../Hashtbl/module-type-S'/index.html | 14 +++--- 2.0/index.html | 16 +++---- 61 files changed, 306 insertions(+), 252 deletions(-) diff --git a/2.0/containers/CCArray/index.html b/2.0/containers/CCArray/index.html index c156b693..761208dc 100644 --- a/2.0/containers/CCArray/index.html +++ b/2.0/containers/CCArray/index.html @@ -1,5 +1,7 @@ -CCArray (containers.CCArray)

Module CCArray

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of Array
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val init : int ‑> (int ‑> 'a) ‑> 'a array
val make_matrix : int ‑> int ‑> 'a ‑> 'a array array
val create_matrix : int ‑> int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> int ‑> int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> int ‑> int ‑> 'a ‑> unit
val blit : 'a array ‑> int ‑> 'a array ‑> int ‑> int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : ('a ‑> unit) ‑> 'a array ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val map : ('a ‑> 'b) ‑> 'a array ‑> 'b array
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b array ‑> 'a
val fold_right : ('b ‑> 'a ‑> 'a) ‑> 'b array ‑> 'a ‑> 'a
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val for_all : ('a ‑> bool) ‑> 'a array ‑> bool
val exists : ('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> 'a array ‑> bool
val memq : 'a ‑> 'a array ‑> bool
val sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
type 'a t = 'a array
val empty : 'a t
val equal : 'a equal ‑> 'a t equal
val compare : 'a ord ‑> 'a t ord
val swap : 'a t ‑> int ‑> int ‑> unit

swap arr i j swaps elements at indices i and j.

  • Since: 1.4
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. +CCArray (containers.CCArray)

Module CCArray

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of Array
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val init : int ‑> (int ‑> 'a) ‑> 'a array
val make_matrix : int ‑> int ‑> 'a ‑> 'a array array
val create_matrix : int ‑> int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> int ‑> int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> int ‑> int ‑> 'a ‑> unit
val blit : 'a array ‑> int ‑> 'a array ‑> int ‑> int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : ('a ‑> unit) ‑> 'a array ‑> unit
val iteri : (int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val map : ('a ‑> 'b) ‑> 'a array ‑> 'b array
val mapi : (int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b array ‑> 'a
val fold_right : ('b ‑> 'a ‑> 'a) ‑> 'b array ‑> 'a ‑> 'a
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val for_all : ('a ‑> bool) ‑> 'a array ‑> bool
val exists : ('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> 'a array ‑> bool
val memq : 'a ‑> 'a array ‑> bool
val sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
type 'a t = 'a array
val empty : 'a t

The empty array, physically equal to ||.

val equal : 'a equal ‑> 'a t equal

Hoist an equality test for elements to arrays. +Arrays are only equal if their lengths are the same and +corresponding elements test equal.

val compare : 'a ord ‑> 'a t ord
val swap : 'a t ‑> int ‑> int ‑> unit

swap arr i j swaps elements at indices i and j.

  • Since: 1.4
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. The first element has number 0. The last element has number length a - 1. You can also write a.(n) instead of get a n.

Raise Invalid_argument "index out of bounds" @@ -12,9 +14,8 @@ indicated by the accumulator.

  • Since: 1.2
val scan_left : ('acc ‑> 'a ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'acc t

scan_left f acc a returns the array [|acc; f acc x0; f (f acc a.(0)) a.(1); …|] .

  • Since: 1.2
val iter : ('a ‑> unit) ‑> 'a t ‑> unit

iter f a applies function f in turn to all the elements of a. It is equivalent to -f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as Array.iter, but the -function is applied with the index of the element as first argument, -and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit v1 o1 v2 o2 len copies len elements +f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Like Array.iter, but the function is applied to the index of the +element as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit v1 o1 v2 o2 len copies len elements from array v1, starting at element number o1, to array v2, starting at element number o2. It works correctly even if v1 and v2 are the same array, and the source and @@ -32,19 +33,19 @@ that f x = Some y, else it returns and p x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> 'a ‑> 'a t ‑> int option

Lookup the index of some value in a sorted array. Undefined behavior if the array is not sorted wrt cmp. Complexity: O(log (n)) (dichotomic search).

  • Returns None if the key is not present, or -Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

Same as lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp x arr finds the index of the object x in the array arr, +Some i (i the index of the key) otherwise.

val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

Like lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp x arr finds the index of the object x in the array arr, provided arr is sorted using cmp. If the array is not sorted, -the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array -(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) x = 0 (for some i)
    • `All_lower if all elements of arr are lower than x
    • `All_bigger if all elements of arr are bigger than x
    • `Just_after i if arr.(i) < x < arr.(i+1)
    • `Empty if the array is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array +the result is not specified (may

  • Raises Invalid_argument: ).

    Complexity: O(log n) where n is the length of the array +(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) x = 0 (for some i).
    • `All_lower if all elements of arr are lower than x.
    • `All_bigger if all elements of arr are bigger than x.
    • `Just_after i if arr.(i) < x < arr.(i+1).
    • `Empty if the array is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array satisfy the predicate p. That is, it returns -(p a1) && (p a2) && ... && (p an).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of +(p a1) && (p a2) && ... && (p an).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of the array satisfies the predicate p. That is, it returns -(p a1) || (p a2) || ... || (p an).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence
val to_gen : 'a t ‑> 'a gen
val to_klist : 'a t ‑> 'a klist

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

map f a applies function f to all the elements of a, +(p a1) || (p a2) || ... || (p an).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

Return a sequence of the elements of an array.

val to_gen : 'a t ‑> 'a gen

Return a gen of the elements of an array.

val to_klist : 'a t ‑> 'a klist

Return a klist of the elements of an array.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

map f a applies function f to all the elements of a, and builds an array with the results returned by f: [| f a.(0); f a.(1); ...; f a.(length a - 1) |].

val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

map2 f a b applies function f to all the elements of a and b, and builds an array with the results returned by f: [| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|].

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val rev : 'a t ‑> 'a t

Copy + reverse in place.

  • Since: 0.20
val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

Filter elements out of the array. Only the elements satisfying -the given predicate will be kept.

val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

Map each element into another value, or discard it.

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b array

Transform each element into an array, then flatten.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

Remove given index, obtaining the list of the other elements.

val (--) : int ‑> int ‑> int t

Range array.

val (--^) : int ‑> int ‑> int t

Range array, excluding right bound.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

Sort the array, without allocating (eats stack space though). Performance +the given predicate will be kept.

val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

Map each element into another value, or discard it.

val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b array

Transform each element into an array, then flatten.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

Remove given index, obtaining the list of the other elements.

val (--) : int ‑> int ‑> int t

Range array. Bounds included.

val (--^) : int ‑> int ‑> int t

Range array, excluding right bound.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

Sort the array, without allocating (eats stack space though). Performance might be lower than Array.sort.

  • Since: 0.14
\ No newline at end of file diff --git a/2.0/containers/CCArrayLabels/index.html b/2.0/containers/CCArrayLabels/index.html index 98800f43..d49bfd41 100644 --- a/2.0/containers/CCArrayLabels/index.html +++ b/2.0/containers/CCArrayLabels/index.html @@ -1,5 +1,7 @@ -CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of ArrayLabels
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
val init : int ‑> f:(int ‑> 'a) ‑> 'a array
val make_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
val create_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> pos:int ‑> len:int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> pos:int ‑> len:int ‑> 'a ‑> unit
val blit : src:'a array ‑> src_pos:int ‑> dst:'a array ‑> dst_pos:int ‑> len:int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : f:('a ‑> unit) ‑> 'a array ‑> unit
val map : f:('a ‑> 'b) ‑> 'a array ‑> 'b array
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b array ‑> 'a
val fold_right : f:('b ‑> 'a ‑> 'a) ‑> 'b array ‑> init:'a ‑> 'a
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val exists : f:('a ‑> bool) ‑> 'a array ‑> bool
val for_all : f:('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> set:'a array ‑> bool
val memq : 'a ‑> set:'a array ‑> bool
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
type 'a t = 'a array
val empty : 'a t
val equal : 'a equal ‑> 'a t equal
val compare : 'a ord ‑> 'a t ord
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. +CCArrayLabels (containers.CCArrayLabels)

Module CCArrayLabels

Array utils

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit

Arrays

include module type of ArrayLabels
external length : 'a array ‑> int = "%array_length"
external get : 'a array ‑> int ‑> 'a = "%array_safe_get"
external set : 'a array ‑> int ‑> 'a ‑> unit = "%array_safe_set"
external make : int ‑> 'a ‑> 'a array = "caml_make_vect"
external create : int ‑> 'a ‑> 'a array = "caml_make_vect"
  • Deprecated Use Array.make instead.
val init : int ‑> f:(int ‑> 'a) ‑> 'a array
val make_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
val create_matrix : dimx:int ‑> dimy:int ‑> 'a ‑> 'a array array
  • Deprecated Use Array.make_matrix instead.
val append : 'a array ‑> 'a array ‑> 'a array
val concat : 'a array list ‑> 'a array
val sub : 'a array ‑> pos:int ‑> len:int ‑> 'a array
val copy : 'a array ‑> 'a array
val fill : 'a array ‑> pos:int ‑> len:int ‑> 'a ‑> unit
val blit : src:'a array ‑> src_pos:int ‑> dst:'a array ‑> dst_pos:int ‑> len:int ‑> unit
val to_list : 'a array ‑> 'a list
val of_list : 'a list ‑> 'a array
val iter : f:('a ‑> unit) ‑> 'a array ‑> unit
val map : f:('a ‑> 'b) ‑> 'a array ‑> 'b array
val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a array ‑> unit
val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a array ‑> 'b array
val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b array ‑> 'a
val fold_right : f:('b ‑> 'a ‑> 'a) ‑> 'b array ‑> init:'a ‑> 'a
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a array ‑> 'b array ‑> unit
val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a array ‑> 'b array ‑> 'c array
val exists : f:('a ‑> bool) ‑> 'a array ‑> bool
val for_all : f:('a ‑> bool) ‑> 'a array ‑> bool
val mem : 'a ‑> set:'a array ‑> bool
val memq : 'a ‑> set:'a array ‑> bool
external create_float : int ‑> float array = "caml_make_float_vect"
val make_float : int ‑> float array
  • Deprecated Use Array.create_float instead.
val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a array ‑> unit
external unsafe_get : 'a array ‑> int ‑> 'a = "%array_unsafe_get"
external unsafe_set : 'a array ‑> int ‑> 'a ‑> unit = "%array_unsafe_set"
type 'a t = 'a array
val empty : 'a t

The empty array, physically equal to ||.

val equal : 'a equal ‑> 'a t equal

Hoist an equality test for elements to arrays. +Arrays are only equal if their lengths are the same and +corresponding elements test equal.

val compare : 'a ord ‑> 'a t ord
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. The first element has number 0. The last element has number length a - 1. You can also write a.(n) instead of get a n.

Raise Invalid_argument "index out of bounds" @@ -10,9 +12,8 @@ if n is outside the range 0 to leng where n is the length of the array a.

val foldi : f:('a ‑> int ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b t ‑> 'a

Fold left on array, with index.

val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'a

Fold left on array until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • Since: 0.8
val iter : f:('a ‑> unit) ‑> 'a t ‑> unit

iter f a applies function f in turn to all the elements of a. It is equivalent to -f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as Array.iter, but the -function is applied with the index of the element as first argument, -and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit v1 o1 v2 o2 len copies len elements +f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Like Array.iter, but the function is applied to the index of the +element as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit v1 o1 v2 o2 len copies len elements from array v1, starting at element number o1, to array v2, starting at element number o2. It works correctly even if v1 and v2 are the same array, and the source and @@ -30,19 +31,19 @@ that f x = Some y, else it returns and p x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> key:'a ‑> 'a t ‑> int option

Lookup the index of some value in a sorted array. Undefined behavior if the array is not sorted wrt cmp. Complexity: O(log (n)) (dichotomic search).

  • Returns None if the key is not present, or -Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> key:'a ‑> 'a t ‑> int

Same as lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> key:'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp key arr finds the index of the object key in the array arr, +Some i (i the index of the key) otherwise.

val lookup_exn : cmp:'a ord ‑> key:'a ‑> 'a t ‑> int

Like lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> key:'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp key arr finds the index of the object key in the array arr, provided arr is sorted using cmp. If the array is not sorted, the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array -(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) key = 0 (for some i)
    • `All_lower if all elements of arr are lower than key
    • `All_bigger if all elements of arr are bigger than key
    • `Just_after i if arr.(i) < key < arr.(i+1)
    • `Empty if the array is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : f:('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array +(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) key = 0 (for some i).
    • `All_lower if all elements of arr are lower than key.
    • `All_bigger if all elements of arr are bigger than key.
    • `Just_after i if arr.(i) < key < arr.(i+1).
    • `Empty if the array is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : f:('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array satisfy the predicate p. That is, it returns -(p a1) && (p a2) && ... && (p an).

val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val exists : f:('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of +(p a1) && (p a2) && ... && (p an).

val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : f:('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of the array satisfies the predicate p. That is, it returns -(p a1) || (p a2) || ... || (p an).

val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val fold2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> init:'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence
val to_gen : 'a t ‑> 'a gen
val to_klist : 'a t ‑> 'a klist

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

map f a applies function f to all the elements of a, +(p a1) || (p a2) || ... || (p an).

val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> init:'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

Return a sequence of the elements of an array.

val to_gen : 'a t ‑> 'a gen

Return a gen of the elements of an array.

val to_klist : 'a t ‑> 'a klist

Return a klist of the elements of an array.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

map f a applies function f to all the elements of a, and builds an array with the results returned by f: [| f a.(0); f a.(1); ...; f a.(length a - 1) |].

val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

map2 f a b applies function f to all the elements of a and b, and builds an array with the results returned by f: [| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|].

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val rev : 'a t ‑> 'a t

Copy + reverse in place.

  • Since: 0.20
val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

Filter elements out of the array. Only the elements satisfying -the given predicate will be kept.

val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

Map each element into another value, or discard it.

val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b array

Transform each element into an array, then flatten.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

Remove given index, obtaining the list of the other elements.

val (--) : int ‑> int ‑> int t

Range array.

val (--^) : int ‑> int ‑> int t

Range array, excluding right bound.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

Sort the array, without allocating (eats stack space though). Performance +the given predicate will be kept.

val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

Map each element into another value, or discard it.

val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b array

Transform each element into an array, then flatten.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Infix version of flat_map.

val (>>|) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

Infix version of map.

  • Since: 0.8
val except_idx : 'a t ‑> int ‑> 'a list

Remove given index, obtaining the list of the other elements.

val (--) : int ‑> int ‑> int t

Range array. Bounds included.

val (--^) : int ‑> int ‑> int t

Range array, excluding right bound.

  • Since: 0.17
val random : 'a random_gen ‑> 'a t random_gen
val random_non_empty : 'a random_gen ‑> 'a t random_gen
val random_len : int ‑> 'a random_gen ‑> 'a t random_gen

Generic Functions

module type MONO_ARRAY : sig ... end
val sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) ‑> cmp:('elt ‑> 'elt ‑> int) ‑> 'arr ‑> unit

Sort the array, without allocating (eats stack space though). Performance might be lower than Array.sort.

  • Since: 0.14
\ No newline at end of file diff --git a/2.0/containers/CCArray_slice/index.html b/2.0/containers/CCArray_slice/index.html index 4c514f9a..755a91cb 100644 --- a/2.0/containers/CCArray_slice/index.html +++ b/2.0/containers/CCArray_slice/index.html @@ -1,5 +1,5 @@ -CCArray_slice (containers.CCArray_slice)

Module CCArray_slice

Array Slice

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a t

Array slice, containing elements of type 'a.

val empty : 'a t
val equal : 'a equal ‑> 'a t equal
val compare : 'a ord ‑> 'a t ord
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. +CCArray_slice (containers.CCArray_slice)

Module CCArray_slice

Array Slice

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
type 'a gen = unit ‑> 'a option
type 'a equal = 'a ‑> 'a ‑> bool
type 'a ord = 'a ‑> 'a ‑> int
type 'a random_gen = Random.State.t ‑> 'a
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a t

Array slice, containing elements of type 'a.

val empty : 'a t

The empty array slice.

val equal : 'a equal ‑> 'a t equal
val compare : 'a ord ‑> 'a t ord
val get : 'a t ‑> int ‑> 'a

get a n returns the element number n of array a. The first element has number 0. The last element has number length a - 1. You can also write a.(n) instead of get a n.

Raise Invalid_argument "index out of bounds" @@ -12,7 +12,7 @@ if n is outside the range 0 to leng where n is the length of the array a.

val foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

Fold left on array, with index.

val fold_while : ('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> 'a ‑> 'b t ‑> 'a

Fold left on array until a stop condition via ('a, `Stop) is indicated by the accumulator.

  • Since: 0.8
val iter : ('a ‑> unit) ‑> 'a t ‑> unit

iter f a applies function f in turn to all the elements of a. It is equivalent to -f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Same as Array.iter, but the +f a.(0); f a.(1); ...; f a.(length a - 1); ().

val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

Like Array.iter, but the function is applied with the index of the element as first argument, and the element itself as second argument.

val blit : 'a t ‑> int ‑> 'a t ‑> int ‑> int ‑> unit

blit v1 o1 v2 o2 len copies len elements from array v1, starting at element number o1, to array v2, @@ -30,13 +30,13 @@ in sorted cmp a. a is not mo lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).

  • Since: 1.0
val find : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

find f a returns Some y if there is an element x such that f x = Some y, else it returns None.

val findi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

Like find, but also pass the index to the predicate function.

  • Since: 0.3.4
val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

find_idx p x returns Some (i,x) where x is the i-th element of l, and p x holds. Otherwise returns None.

  • Since: 0.3.4
val lookup : cmp:'a ord ‑> 'a ‑> 'a t ‑> int option

Lookup the index of some value in a sorted array.

  • Returns None if the key is not present, or -Some i (i the index of the key) otherwise.
val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

Same as lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp x arr finds the index of the object x in the array arr, +Some i (i the index of the key) otherwise.

val lookup_exn : cmp:'a ord ‑> 'a ‑> 'a t ‑> int

Like lookup, but

  • Raises Not_found: if the key is not present.
val bsearch : cmp:('a ‑> 'a ‑> int) ‑> 'a ‑> 'a t ‑> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]

bsearch ?cmp x arr finds the index of the object x in the array arr, provided arr is sorted using cmp. If the array is not sorted, -the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array -(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) x = 0 (for some i)
    • `All_lower if all elements of arr are lower than x
    • `All_bigger if all elements of arr are bigger than x
    • `Just_after i if arr.(i) < x < arr.(i+1)
    • `Empty if the array is empty
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array +the result is not specified (may raise Invalid_argument).

Complexity: O(log n) where n is the length of the array +(dichotomic search).

  • Returns

    • `At i if cmp arr.(i) x = 0 (for some i).
    • `All_lower if all elements of arr are lower than x.
    • `All_bigger if all elements of arr are bigger than x.
    • `Just_after i if arr.(i) < x < arr.(i+1).
    • `Empty if the array is empty.
  • Raises Invalid_argument: if the array is found to be unsorted w.r.t cmp.
  • Since: 0.13
val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

for_all p [|a1; ...; an|] checks if all elements of the array satisfy the predicate p. That is, it returns -(p a1) && (p a2) && ... && (p an).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of +(p a1) && (p a2) && ... && (p an).

val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Forall on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val exists : ('a ‑> bool) ‑> 'a t ‑> bool

exists p [|a1; ...; an|] checks if at least one element of the array satisfies the predicate p. That is, it returns -(p a1) || (p a2) || ... || (p an).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths -allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence
val to_gen : 'a t ‑> 'a gen
val to_klist : 'a t ‑> 'a klist

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

\ No newline at end of file +(p a1) || (p a2) || ... || (p an).

val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a t ‑> 'b t ‑> bool

Exists on pairs of arrays.

  • Raises Invalid_argument: if they have distinct lengths. +Allow different types.
  • Since: 0.20
val fold2 : ('acc ‑> 'a ‑> 'b ‑> 'acc) ‑> 'acc ‑> 'a t ‑> 'b t ‑> 'acc

Fold on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

Iterate on two arrays stepwise.

  • Raises Invalid_argument: if they have distinct lengths.
  • Since: 0.20
val shuffle : 'a t ‑> unit

Shuffle randomly the array, in place.

val shuffle_with : Random.State.t ‑> 'a t ‑> unit

Like shuffle but using a specialized random state.

val random_choose : 'a t ‑> 'a random_gen

Choose an element randomly.

  • Raises Not_found: if the array/slice is empty.
val to_seq : 'a t ‑> 'a sequence

Return a sequence of the elements of a slice.

val to_gen : 'a t ‑> 'a gen

Return a gen of the elements of a slice.

val to_klist : 'a t ‑> 'a klist

Return a klist of the elements of a slice.

IO

val pp : ?⁠sep:string ‑> 'a printer ‑> 'a t printer

Print an array of items with printing function.

val pp_i : ?⁠sep:string ‑> (int ‑> 'a printer) ‑> 'a t printer

Print an array, giving the printing function both index and item.

\ No newline at end of file diff --git a/2.0/containers/CCBool/index.html b/2.0/containers/CCBool/index.html index a43d7198..fb335818 100644 --- a/2.0/containers/CCBool/index.html +++ b/2.0/containers/CCBool/index.html @@ -1,2 +1,2 @@ -CCBool (containers.CCBool)

Module CCBool

Basic Bool functions

type t = bool
val compare : t ‑> t ‑> int

Total ordering on booleans, similar to Pervasives.compare

val equal : t ‑> t ‑> bool
val negate : t ‑> t

Negation on booleans (functional version of not)

  • Deprecated since 1.3, simply use not instead
type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : t printer
\ No newline at end of file +CCBool (containers.CCBool)

Module CCBool

Basic Bool functions

type t = bool
val compare : t ‑> t ‑> int

Total ordering on booleans, similar to Pervasives.compare.

val equal : t ‑> t ‑> bool
val negate : t ‑> t

Negation on booleans (functional version of not).

  • Deprecated since 1.3, simply use not instead.
type 'a printer = Format.formatter ‑> 'a ‑> unit
val pp : t printer
\ No newline at end of file diff --git a/2.0/containers/CCChar/index.html b/2.0/containers/CCChar/index.html index 2c2c40e1..9ad6ee99 100644 --- a/2.0/containers/CCChar/index.html +++ b/2.0/containers/CCChar/index.html @@ -6,4 +6,4 @@ allows the module Char to be passed as argument to the using the US-ASCII character set.

  • Since: 0.20
val uppercase_ascii : t ‑> t

Convert the given character to its equivalent uppercase character, using the US-ASCII character set.

  • Since: 0.20
val of_int_exn : int ‑> t

Alias to Char.chr. Return the character with the given ASCII code.

  • Raises Invalid_argument: if the int is not within 0,...,255.
  • Since: 1.0
val of_int : int ‑> t option

Safe version of of_int_exn.

  • Since: 1.0
val to_int : t ‑> int

Alias to Char.code. -Return the ASCII code of the argument.

  • Since: 1.0
val pp : Buffer.t ‑> t ‑> unit
val print : Format.formatter ‑> t ‑> unit
\ No newline at end of file +Return the ASCII code of the argument.

  • Since: 1.0
val pp_buf : Buffer.t ‑> t ‑> unit

Used to be pp, changed name

  • Since: 2.0
val pp : Format.formatter ‑> t ‑> unit

Used to be print, changed name

  • Since: 2.0
\ No newline at end of file diff --git a/2.0/containers/CCEqual/Infix/index.html b/2.0/containers/CCEqual/Infix/index.html index 0eadc4f7..a69ba8ed 100644 --- a/2.0/containers/CCEqual/Infix/index.html +++ b/2.0/containers/CCEqual/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCEqual.Infix)

Module CCEqual.Infix

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t
\ No newline at end of file +Infix (containers.CCEqual.Infix)

Module CCEqual.Infix

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

\ No newline at end of file diff --git a/2.0/containers/CCEqual/index.html b/2.0/containers/CCEqual/index.html index d33b321c..77d10d54 100644 --- a/2.0/containers/CCEqual/index.html +++ b/2.0/containers/CCEqual/index.html @@ -1,7 +1,7 @@ -CCEqual (containers.CCEqual)

Module CCEqual

Equality Combinators

  • Since: 1.2
type 'a t = 'a ‑> 'a ‑> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality

val physical : 'a t

Standard physical equality

  • Since: 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

map f eq is the equality function that, given objects x and y, +CCEqual (containers.CCEqual)

Module CCEqual

Equality Combinators

  • Since: 1.2
type 'a t = 'a ‑> 'a ‑> bool

Equality function. Must be transitive, symmetric, and reflexive.

val poly : 'a t

Standard polymorphic equality.

val physical : 'a t

Standard physical equality.

  • Since: 2.0
val int : int t
val string : string t
val bool : bool t
val float : float t
val unit : unit t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

map f eq is the equality function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with eq. Example: map fst int compares values of type (int * 'a) by their -first component.

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map

module Infix : sig ... end
\ No newline at end of file +first component.

val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

Infix equivalent of map.

module Infix : sig ... end
\ No newline at end of file diff --git a/2.0/containers/CCFloat/Infix/index.html b/2.0/containers/CCFloat/Infix/index.html index 11aacbb7..78d8a088 100644 --- a/2.0/containers/CCFloat/Infix/index.html +++ b/2.0/containers/CCFloat/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCFloat.Infix)

Module CCFloat.Infix

Infix Operators

  • Since: 0.17
val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
\ No newline at end of file +Infix (containers.CCFloat.Infix)

Module CCFloat.Infix

val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
\ No newline at end of file diff --git a/2.0/containers/CCFloat/index.html b/2.0/containers/CCFloat/index.html index 4db558f0..300e4229 100644 --- a/2.0/containers/CCFloat/index.html +++ b/2.0/containers/CCFloat/index.html @@ -1,5 +1,8 @@ -CCFloat (containers.CCFloat)

Module CCFloat

Basic Float functions

  • Since: 0.6.1
type t = float
type fpclass = Pervasives.fpclass =
| FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
val nan : t
val max_value : t
val min_value : t
val max_finite_value : t
val epsilon : t
val is_nan : t ‑> bool
val add : t ‑> t ‑> t
val sub : t ‑> t ‑> t
val neg : t ‑> t
val abs : t ‑> t
val scale : t ‑> t ‑> t
val min : t ‑> t ‑> t
val max : t ‑> t ‑> t
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
val pp : t printer
val hash : t ‑> int
val random : t ‑> t random_gen
val random_small : t random_gen
val random_range : t ‑> t ‑> t random_gen
val fsign : t ‑> t

fsign x is one of -1., -0., +0., +1., or nan if x is NaN.

  • Since: 0.7
val round : t ‑> t

round f returns the closest integer value, either above or below

  • Since: 0.20
exception TrapNaN of string
val sign_exn : t ‑> int

sign_exn x will return the sign of x as 1, 0 or -1, or raise an -exception TrapNaN if x is a NaN. +CCFloat (containers.CCFloat)

Module CCFloat

Basic operations on floating-point numbers

  • Since: 0.6.1
type t = float
type fpclass = Pervasives.fpclass =
| FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
val nan : t

Equal to Pervasives.nan.

val max_value : t

Positive infinity. Equal to Pervasives.infinity.

val min_value : t

Negative infinity. Equal to Pervasives.neg_infinity.

val max_finite_value : t

Equal to Pervasives.max_float.

val epsilon : t

The smallest positive float x such that 1.0 +. x <> 1.0. +Equal to Pervasives.epsilon_float.

val is_nan : t ‑> bool

is_nan f returns true if f is NaN, false otherwise.

val add : t ‑> t ‑> t

Equal to (+.).

val sub : t ‑> t ‑> t

Equal to (-.).

val neg : t ‑> t

Equal to (~-.).

val abs : t ‑> t

The absolute value of a floating-point number. +Equal to Pervasives.abs_float.

val scale : t ‑> t ‑> t

Equal to ( *. ).

val min : t ‑> t ‑> t
val max : t ‑> t ‑> t
val equal : t ‑> t ‑> bool
val compare : t ‑> t ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit
type 'a random_gen = Random.State.t ‑> 'a
val pp : t printer
val hash : t ‑> int
val random : t ‑> t random_gen
val random_small : t random_gen
val random_range : t ‑> t ‑> t random_gen
val fsign : t ‑> t

fsign x is one of -1., -0., +0., +1., or nan if x is NaN.

  • Since: 0.7
val round : t ‑> t

round f returns the closest integer value, either above or below.

  • Since: 0.20
exception TrapNaN of string
val sign_exn : t ‑> int

sign_exn x will return the sign of x as 1, 0 or -1, or raise an +exception TrapNaN if x is NaN. Note that infinities have defined signs in OCaml.

  • Since: 0.7
val to_int : t ‑> int

Alias to int_of_float. -Unspecified if outside of the range of integers.

val of_int : int ‑> t

Alias to float_of_int

val to_string : t ‑> string
val of_string_exn : string ‑> t

Alias to float_of_string

  • Raises Failure: in case of failure
  • Since: 1.2
val of_string : string ‑> t

Alias to float_of_string.

  • Deprecated since 1.2, use of_string_exn instead
  • Raises Failure: in case of failure
val equal_precision : epsilon:t ‑> t ‑> t ‑> bool

Equality with allowed error up to a non negative epsilon value

val classify : t ‑> fpclass
module Infix : sig ... end

Infix Operators

include module type of Infix

Infix Operators

  • Since: 0.17
val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
\ No newline at end of file +Unspecified if outside of the range of integers.

val of_int : int ‑> t

Alias to float_of_int.

val to_string : t ‑> string
val of_string_exn : string ‑> t

Alias to float_of_string.

  • Raises Failure: in case of failure.
  • Since: 1.2
val of_string : string ‑> t

Alias to float_of_string.

  • Deprecated since 1.2, use of_string_exn instead.
  • Raises Failure: in case of failure.
val equal_precision : epsilon:t ‑> t ‑> t ‑> bool

Equality with allowed error up to a non negative epsilon value.

val classify : t ‑> fpclass

Return the class of the given floating-point number: +normal, subnormal, zero, infinite or nan (not a number).

Infix Operators

  • Since: 0.17
module Infix : sig ... end
include module type of Infix
val (=) : t ‑> t ‑> bool
  • Since: 0.17
val (<>) : t ‑> t ‑> bool
  • Since: 0.17
val (<) : t ‑> t ‑> bool
  • Since: 0.17
val (>) : t ‑> t ‑> bool
  • Since: 0.17
val (<=) : t ‑> t ‑> bool
  • Since: 0.17
val (>=) : t ‑> t ‑> bool
  • Since: 0.17
\ No newline at end of file diff --git a/2.0/containers/CCFormat/Dump/index.html b/2.0/containers/CCFormat/Dump/index.html index 4e4116e9..b488489f 100644 --- a/2.0/containers/CCFormat/Dump/index.html +++ b/2.0/containers/CCFormat/Dump/index.html @@ -1,2 +1,2 @@ -Dump (containers.CCFormat.Dump)

Module CCFormat.Dump

type 'a t = 'a printer
val unit : unit t
val int : int t
val string : string t
val bool : bool t
val float : float t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val result : 'a t ‑> ('a, string) Result.result t
val result' : 'a t ‑> 'e t ‑> ('a'e) Result.result t
val to_string : 'a t ‑> 'a ‑> string
\ No newline at end of file +Dump (containers.CCFormat.Dump)

Module CCFormat.Dump

type 'a t = 'a printer
val unit : unit t
val int : int t
val string : string t
val bool : bool t
val float : float t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val option : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val result : 'a t ‑> ('a, string) Result.result t
val result' : 'a t ‑> 'e t ‑> ('a'e) Result.result t
val to_string : 'a t ‑> 'a ‑> string
\ No newline at end of file diff --git a/2.0/containers/CCFormat/index.html b/2.0/containers/CCFormat/index.html index 21586267..27df39d4 100644 --- a/2.0/containers/CCFormat/index.html +++ b/2.0/containers/CCFormat/index.html @@ -1,37 +1,38 @@ -CCFormat (containers.CCFormat)

Module CCFormat

Helpers for Format

  • Since: 0.8
type 'a sequence = ('a ‑> unit) ‑> unit
include module type of sig ... end
val open_box : int ‑> unit
val close_box : unit ‑> unit
val print_string : string ‑> unit
val print_as : int ‑> string ‑> unit
val print_int : int ‑> unit
val print_float : float ‑> unit
val print_char : char ‑> unit
val print_bool : bool ‑> unit
val print_space : unit ‑> unit
val print_cut : unit ‑> unit
val print_break : int ‑> int ‑> unit
val print_flush : unit ‑> unit
val print_newline : unit ‑> unit
val force_newline : unit ‑> unit
val print_if_newline : unit ‑> unit
val set_margin : int ‑> unit
val get_margin : unit ‑> int
val set_max_indent : int ‑> unit
val get_max_indent : unit ‑> int
val set_max_boxes : int ‑> unit
val get_max_boxes : unit ‑> int
val over_max_boxes : unit ‑> bool
val open_hbox : unit ‑> unit
val open_vbox : int ‑> unit
val open_hvbox : int ‑> unit
val open_hovbox : int ‑> unit
val set_ellipsis_text : string ‑> unit
val get_ellipsis_text : unit ‑> string
type tag = string
val open_tag : tag ‑> unit
val close_tag : unit ‑> unit
val set_tags : bool ‑> unit
val set_print_tags : bool ‑> unit
val set_mark_tags : bool ‑> unit
val get_print_tags : unit ‑> bool
val get_mark_tags : unit ‑> bool
val set_formatter_out_channel : Pervasives.out_channel ‑> unit
val set_formatter_output_functions : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val get_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
type formatter_out_functions = Format.formatter_out_functions = {
out_string : string ‑> int ‑> int ‑> unit;
out_flush : unit ‑> unit;
out_newline : unit ‑> unit;
out_spaces : int ‑> unit;
}
val set_formatter_out_functions : formatter_out_functions ‑> unit
val get_formatter_out_functions : unit ‑> formatter_out_functions
type formatter_tag_functions = Format.formatter_tag_functions = {
mark_open_tag : tag ‑> string;
mark_close_tag : tag ‑> string;
print_open_tag : tag ‑> unit;
print_close_tag : tag ‑> unit;
}
val set_formatter_tag_functions : formatter_tag_functions ‑> unit
val get_formatter_tag_functions : unit ‑> formatter_tag_functions
type formatter = Format.formatter
val formatter_of_out_channel : Pervasives.out_channel ‑> formatter
val std_formatter : formatter
val err_formatter : formatter
val formatter_of_buffer : Buffer.t ‑> formatter
val stdbuf : Buffer.t
val str_formatter : formatter
val flush_str_formatter : unit ‑> string
val make_formatter : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> formatter
val pp_open_hbox : formatter ‑> unit ‑> unit
val pp_open_vbox : formatter ‑> int ‑> unit
val pp_open_hvbox : formatter ‑> int ‑> unit
val pp_open_hovbox : formatter ‑> int ‑> unit
val pp_open_box : formatter ‑> int ‑> unit
val pp_close_box : formatter ‑> unit ‑> unit
val pp_open_tag : formatter ‑> string ‑> unit
val pp_close_tag : formatter ‑> unit ‑> unit
val pp_print_string : formatter ‑> string ‑> unit
val pp_print_as : formatter ‑> int ‑> string ‑> unit
val pp_print_int : formatter ‑> int ‑> unit
val pp_print_float : formatter ‑> float ‑> unit
val pp_print_char : formatter ‑> char ‑> unit
val pp_print_bool : formatter ‑> bool ‑> unit
val pp_print_break : formatter ‑> int ‑> int ‑> unit
val pp_print_cut : formatter ‑> unit ‑> unit
val pp_print_space : formatter ‑> unit ‑> unit
val pp_force_newline : formatter ‑> unit ‑> unit
val pp_print_flush : formatter ‑> unit ‑> unit
val pp_print_newline : formatter ‑> unit ‑> unit
val pp_print_if_newline : formatter ‑> unit ‑> unit
val pp_set_tags : formatter ‑> bool ‑> unit
val pp_set_print_tags : formatter ‑> bool ‑> unit
val pp_set_mark_tags : formatter ‑> bool ‑> unit
val pp_get_print_tags : formatter ‑> unit ‑> bool
val pp_get_mark_tags : formatter ‑> unit ‑> bool
val pp_set_margin : formatter ‑> int ‑> unit
val pp_get_margin : formatter ‑> unit ‑> int
val pp_set_max_indent : formatter ‑> int ‑> unit
val pp_get_max_indent : formatter ‑> unit ‑> int
val pp_set_max_boxes : formatter ‑> int ‑> unit
val pp_get_max_boxes : formatter ‑> unit ‑> int
val pp_over_max_boxes : formatter ‑> unit ‑> bool
val pp_set_ellipsis_text : formatter ‑> string ‑> unit
val pp_get_ellipsis_text : formatter ‑> unit ‑> string
val pp_set_formatter_out_channel : formatter ‑> Pervasives.out_channel ‑> unit
val pp_set_formatter_output_functions : formatter ‑> (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val pp_get_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
val pp_set_formatter_tag_functions : formatter ‑> formatter_tag_functions ‑> unit
val pp_get_formatter_tag_functions : formatter ‑> unit ‑> formatter_tag_functions
val pp_set_formatter_out_functions : formatter ‑> formatter_out_functions ‑> unit
val pp_get_formatter_out_functions : formatter ‑> unit ‑> formatter_out_functions
val pp_flush_formatter : formatter ‑> unit
val pp_print_list : ?⁠pp_sep:(formatter ‑> unit ‑> unit) ‑> (formatter ‑> 'a ‑> unit) ‑> formatter ‑> 'a list ‑> unit
val pp_print_text : formatter ‑> string ‑> unit
val fprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val printf : ('aformatter, unit) Pervasives.format ‑> 'a
val eprintf : ('aformatter, unit) Pervasives.format ‑> 'a
val sprintf : ('a, unit, string) Pervasives.format ‑> 'a
val asprintf : ('aformatter, unit, string) Pervasives.format4 ‑> 'a
val ifprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ikfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ksprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
val kasprintf : (string ‑> 'a) ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val bprintf : Buffer.t ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
  • Deprecated Use Format.ksprintf instead.
val set_all_formatter_output_functions : out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.set_formatter_out_functions instead.
val get_all_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.get_formatter_out_functions instead.
val pp_set_all_formatter_output_functions : formatter ‑> out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.pp_set_formatter_out_functions instead.
val pp_get_all_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.pp_get_formatter_out_functions instead.
val pp_open_tbox : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_close_tbox : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_print_tbreak : formatter ‑> int ‑> int ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_set_tab : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_print_tab : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val open_tbox : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val close_tbox : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val print_tbreak : int ‑> int ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val set_tab : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val print_tab : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
type t = Format.formatter
type 'a printer = t ‑> 'a ‑> unit

Combinators

val silent : 'a printer

Prints nothing

val unit : unit printer

Prints "()"

val int : int printer
val string : string printer
val bool : bool printer
val float3 : float printer
val float : float printer
val newline : unit printer

Force newline (see Format.pp_force_newline)

  • Since: 1.2
val substring : (string * int * int) printer

Print the substring (s,i,len), where i is the offset +CCFormat (containers.CCFormat)

Module CCFormat

Helpers for Format

  • Since: 0.8
type 'a sequence = ('a ‑> unit) ‑> unit
include module type of sig ... end
val open_box : int ‑> unit
val close_box : unit ‑> unit
val print_string : string ‑> unit
val print_as : int ‑> string ‑> unit
val print_int : int ‑> unit
val print_float : float ‑> unit
val print_char : char ‑> unit
val print_bool : bool ‑> unit
val print_space : unit ‑> unit
val print_cut : unit ‑> unit
val print_break : int ‑> int ‑> unit
val print_flush : unit ‑> unit
val print_newline : unit ‑> unit
val force_newline : unit ‑> unit
val print_if_newline : unit ‑> unit
val set_margin : int ‑> unit
val get_margin : unit ‑> int
val set_max_indent : int ‑> unit
val get_max_indent : unit ‑> int
val set_max_boxes : int ‑> unit
val get_max_boxes : unit ‑> int
val over_max_boxes : unit ‑> bool
val open_hbox : unit ‑> unit
val open_vbox : int ‑> unit
val open_hvbox : int ‑> unit
val open_hovbox : int ‑> unit
val set_ellipsis_text : string ‑> unit
val get_ellipsis_text : unit ‑> string
type tag = string
val open_tag : tag ‑> unit
val close_tag : unit ‑> unit
val set_tags : bool ‑> unit
val set_print_tags : bool ‑> unit
val set_mark_tags : bool ‑> unit
val get_print_tags : unit ‑> bool
val get_mark_tags : unit ‑> bool
val set_formatter_out_channel : Pervasives.out_channel ‑> unit
val set_formatter_output_functions : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val get_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
type formatter_out_functions = Format.formatter_out_functions = {
out_string : string ‑> int ‑> int ‑> unit;
out_flush : unit ‑> unit;
out_newline : unit ‑> unit;
out_spaces : int ‑> unit;
}
val set_formatter_out_functions : formatter_out_functions ‑> unit
val get_formatter_out_functions : unit ‑> formatter_out_functions
type formatter_tag_functions = Format.formatter_tag_functions = {
mark_open_tag : tag ‑> string;
mark_close_tag : tag ‑> string;
print_open_tag : tag ‑> unit;
print_close_tag : tag ‑> unit;
}
val set_formatter_tag_functions : formatter_tag_functions ‑> unit
val get_formatter_tag_functions : unit ‑> formatter_tag_functions
type formatter = Format.formatter
val formatter_of_out_channel : Pervasives.out_channel ‑> formatter
val std_formatter : formatter
val err_formatter : formatter
val formatter_of_buffer : Buffer.t ‑> formatter
val stdbuf : Buffer.t
val str_formatter : formatter
val flush_str_formatter : unit ‑> string
val make_formatter : (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> formatter
val pp_open_hbox : formatter ‑> unit ‑> unit
val pp_open_vbox : formatter ‑> int ‑> unit
val pp_open_hvbox : formatter ‑> int ‑> unit
val pp_open_hovbox : formatter ‑> int ‑> unit
val pp_open_box : formatter ‑> int ‑> unit
val pp_close_box : formatter ‑> unit ‑> unit
val pp_open_tag : formatter ‑> string ‑> unit
val pp_close_tag : formatter ‑> unit ‑> unit
val pp_print_string : formatter ‑> string ‑> unit
val pp_print_as : formatter ‑> int ‑> string ‑> unit
val pp_print_int : formatter ‑> int ‑> unit
val pp_print_float : formatter ‑> float ‑> unit
val pp_print_char : formatter ‑> char ‑> unit
val pp_print_bool : formatter ‑> bool ‑> unit
val pp_print_break : formatter ‑> int ‑> int ‑> unit
val pp_print_cut : formatter ‑> unit ‑> unit
val pp_print_space : formatter ‑> unit ‑> unit
val pp_force_newline : formatter ‑> unit ‑> unit
val pp_print_flush : formatter ‑> unit ‑> unit
val pp_print_newline : formatter ‑> unit ‑> unit
val pp_print_if_newline : formatter ‑> unit ‑> unit
val pp_set_tags : formatter ‑> bool ‑> unit
val pp_set_print_tags : formatter ‑> bool ‑> unit
val pp_set_mark_tags : formatter ‑> bool ‑> unit
val pp_get_print_tags : formatter ‑> unit ‑> bool
val pp_get_mark_tags : formatter ‑> unit ‑> bool
val pp_set_margin : formatter ‑> int ‑> unit
val pp_get_margin : formatter ‑> unit ‑> int
val pp_set_max_indent : formatter ‑> int ‑> unit
val pp_get_max_indent : formatter ‑> unit ‑> int
val pp_set_max_boxes : formatter ‑> int ‑> unit
val pp_get_max_boxes : formatter ‑> unit ‑> int
val pp_over_max_boxes : formatter ‑> unit ‑> bool
val pp_set_ellipsis_text : formatter ‑> string ‑> unit
val pp_get_ellipsis_text : formatter ‑> unit ‑> string
val pp_set_formatter_out_channel : formatter ‑> Pervasives.out_channel ‑> unit
val pp_set_formatter_output_functions : formatter ‑> (string ‑> int ‑> int ‑> unit) ‑> (unit ‑> unit) ‑> unit
val pp_get_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit)
val pp_set_formatter_tag_functions : formatter ‑> formatter_tag_functions ‑> unit
val pp_get_formatter_tag_functions : formatter ‑> unit ‑> formatter_tag_functions
val pp_set_formatter_out_functions : formatter ‑> formatter_out_functions ‑> unit
val pp_get_formatter_out_functions : formatter ‑> unit ‑> formatter_out_functions
val pp_flush_formatter : formatter ‑> unit
val pp_print_list : ?⁠pp_sep:(formatter ‑> unit ‑> unit) ‑> (formatter ‑> 'a ‑> unit) ‑> formatter ‑> 'a list ‑> unit
val pp_print_text : formatter ‑> string ‑> unit
val fprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val printf : ('aformatter, unit) Pervasives.format ‑> 'a
val eprintf : ('aformatter, unit) Pervasives.format ‑> 'a
val sprintf : ('a, unit, string) Pervasives.format ‑> 'a
val asprintf : ('aformatter, unit, string) Pervasives.format4 ‑> 'a
val ifprintf : formatter ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ikfprintf : (formatter ‑> 'a) ‑> formatter ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val ksprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
val kasprintf : (string ‑> 'a) ‑> ('bformatter, unit, 'a) Pervasives.format4 ‑> 'b
val bprintf : Buffer.t ‑> ('aformatter, unit) Pervasives.format ‑> 'a
val kprintf : (string ‑> 'a) ‑> ('b, unit, string, 'a) Pervasives.format4 ‑> 'b
  • Deprecated Use Format.ksprintf instead.
val set_all_formatter_output_functions : out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.set_formatter_out_functions instead.
val get_all_formatter_output_functions : unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.get_formatter_out_functions instead.
val pp_set_all_formatter_output_functions : formatter ‑> out:(string ‑> int ‑> int ‑> unit) ‑> flush:(unit ‑> unit) ‑> newline:(unit ‑> unit) ‑> spaces:(int ‑> unit) ‑> unit
  • Deprecated Use Format.pp_set_formatter_out_functions instead.
val pp_get_all_formatter_output_functions : formatter ‑> unit ‑> (string ‑> int ‑> int ‑> unit) * (unit ‑> unit) * (unit ‑> unit) * (int ‑> unit)
  • Deprecated Use Format.pp_get_formatter_out_functions instead.
val pp_open_tbox : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_close_tbox : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_print_tbreak : formatter ‑> int ‑> int ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_set_tab : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val pp_print_tab : formatter ‑> unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val open_tbox : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val close_tbox : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val print_tbreak : int ‑> int ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val set_tab : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
val print_tab : unit ‑> unit
  • Deprecated Tabulation boxes are not supported any more.
type t = Format.formatter
type 'a printer = t ‑> 'a ‑> unit

Combinators

val silent : 'a printer

Prints nothing

val unit : unit printer

Prints "()".

val int : int printer
val string : string printer
val bool : bool printer
val float3 : float printer
val float : float printer
val newline : unit printer

Force newline (see Format.pp_force_newline).

  • Since: 1.2
val substring : (string * int * int) printer

Print the substring (s,i,len), where i is the offset in s and len the number of bytes in the substring.

  • Raises Invalid_argument: if the triple (s,i,len) does not describe a proper substring.
  • Since: 1.2
val text : string printer

Print string, but replacing spaces with breaks and newlines with newline. See pp_print_text on recent versions of OCaml.

  • Since: 1.2
val char : char printer
  • Since: 0.14
val int32 : int32 printer
  • Since: 0.14
  • Since: 0.14
val int64 : int64 printer
  • Since: 0.14
  • Since: 0.14
val nativeint : nativeint printer
  • Since: 0.14
  • Since: 0.14
val flush : unit printer

Alias to Format.pp_print_flush.

  • Since: 1.2
val string_quoted : string printer

Similar to CCString.print.

  • Since: 0.14
val list : ?⁠sep:unit printer ‑> 'a printer ‑> 'a list printer
val array : ?⁠sep:unit printer ‑> 'a printer ‑> 'a array printer
val arrayi : ?⁠sep:unit printer ‑> (int * 'a) printer ‑> 'a array printer
val seq : ?⁠sep:unit printer ‑> 'a printer ‑> 'a sequence printer
val opt : 'a printer ‑> 'a option printer

opt pp prints options as follows: -Some x will become "some foo" if pp x ---> "foo"None will become "none"

In the tuple printers, the sep argument is only available

  • Since: 0.17
val pair : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer
val triple : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> ('a * 'b * 'c) printer
val quad : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> 'd printer ‑> ('a * 'b * 'c * 'd) printer
val within : string ‑> string ‑> 'a printer ‑> 'a printer

within a b p wraps p inside the strings a and b. Convenient, -for instances, for brackets, parenthesis, quotes, etc.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'b printer ‑> 'a printer
val vbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a vertical box

  • Parameter i: level of indentation within the box (default 0)
  • Since: 0.16
val hvbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal/vertical box

  • Parameter i: level of indentation within the box (default 0)
  • Since: 0.16
val hovbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal or vertical box

  • Parameter i: level of indentation within the box (default 0)
  • Since: 0.16
val hbox : 'a printer ‑> 'a printer

Wrap the printer in an horizontal box

  • Since: 0.16
val return : ('a__'a) Pervasives.format4 ‑> unit printer

return "some_format_string" takes a argument-less format string +Some x will become "some foo" if pp x ---> "foo". +None will become "none".

In the tuple printers, the sep argument is only available.

  • Since: 0.17
val pair : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer
val triple : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> ('a * 'b * 'c) printer
val quad : ?⁠sep:unit printer ‑> 'a printer ‑> 'b printer ‑> 'c printer ‑> 'd printer ‑> ('a * 'b * 'c * 'd) printer
val within : string ‑> string ‑> 'a printer ‑> 'a printer

within a b p wraps p inside the strings a and b. Convenient, +for instances, for brackets, parenthesis, quotes, etc.

  • Since: 0.17
val map : ('a ‑> 'b) ‑> 'b printer ‑> 'a printer
val vbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hvbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal/vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hovbox : ?⁠i:int ‑> 'a printer ‑> 'a printer

Wrap the printer in a horizontal or vertical box.

  • Parameter i: level of indentation within the box (default 0).
  • Since: 0.16
val hbox : 'a printer ‑> 'a printer

Wrap the printer in an horizontal box.

  • Since: 0.16
val return : ('a__'a) Pervasives.format4 ‑> unit printer

return "some_format_string" takes a argument-less format string and returns a printer actionable by (). Examples:

  • return ",@ "
  • return "@{<Red>and then@}@,"
  • return "@[<v>a@ b@]"
  • Since: 1.0
val of_to_string : ('a ‑> string) ‑> 'a printer

of_to_string f converts its input to a string using f, -then prints the string

  • Since: 1.0
val const : 'a printer ‑> 'a ‑> unit printer

const pp x is a unit printer that uses pp on x

  • Since: 1.0
val some : 'a printer ‑> 'a option printer

some pp will print options as follows: -

  • Some x is printed using pp on x
  • None is not printed at all
  • Since: 1.0

ANSI codes

Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code +then prints the string.

  • Since: 1.0
val const : 'a printer ‑> 'a ‑> unit printer

const pp x is a unit printer that uses pp on x.

  • Since: 1.0
val some : 'a printer ‑> 'a option printer

some pp will print options as follows: +

  • Some x is printed using pp on x.
  • None is not printed at all.
  • Since: 1.0

ANSI codes

Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code to put some colors on the terminal.

This uses tags in format strings to specify the style. Current styles are the following:

  • "reset" resets style
  • "black"
  • "red"
  • "green"
  • "yellow"
  • "blue"
  • "magenta"
  • "cyan"
  • "white"
  • "bold" bold font
  • "Black" bold black
  • "Red" bold red
  • "Green" bold green
  • "Yellow" bold yellow
  • "Blue" bold blue
  • "Magenta" bold magenta
  • "Cyan" bold cyan
  • "White" bold white

Example:

      set_color_default true;;
 
       Format.printf
-        "what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;

status: unstable

  • Since: 0.15
val set_color_tag_handling : t ‑> unit

adds functions to support color tags to the given formatter.

  • Since: 0.15
val set_color_default : bool ‑> unit

set_color_default b enables color handling on the standard formatters + "what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;

status: unstable

  • Since: 0.15
val set_color_tag_handling : t ‑> unit

Add functions to support color tags to the given formatter.

  • Since: 0.15
val set_color_default : bool ‑> unit

set_color_default b enables color handling on the standard formatters (stdout, stderr) if b = true as well as on sprintf formatters; it disables the color handling if b = false.

val with_color : string ‑> 'a printer ‑> 'a printer

with_color "Blue" pp behaves like the printer pp, but with the given style. status: unstable

  • Since: 0.16
val with_colorf : string ‑> t ‑> ('at, unit, unit) Pervasives.format4 ‑> 'a

with_colorf "Blue" out "%s %d" "yolo" 42 will behave like Format.fprintf, -but wrapping the content with the given style +but wrapping the content with the given style. status: unstable

  • Since: 0.16
val with_color_sf : string ‑> ('at, unit, string) Pervasives.format4 ‑> 'a

with_color_sf "Blue" out "%s %d" "yolo" 42 will behave like -sprintf, but wrapping the content with the given style +sprintf, but wrapping the content with the given style. Example:

      CCFormat.with_color_sf "red" "%a" CCFormat.Dump.(list int) [1;2;3] |> print_endline;;

status: unstable

  • Since: 0.21
val with_color_ksf : f:(string ‑> 'b) ‑> string ‑> ('at, unit, 'b) Pervasives.format4 ‑> 'a

with_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like -ksprintf, but wrapping the content with the given style +ksprintf, but wrapping the content with the given style. Example: the following with raise Failure with a colored message -

      CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;
  • Since: 1.2

IO

val output : t ‑> 'a printer ‑> 'a ‑> unit
val to_string : 'a printer ‑> 'a ‑> string
val of_chan : Pervasives.out_channel ‑> t

Alias to Format.formatter_of_out_channel

  • Since: 1.2
val with_out_chan : Pervasives.out_channel ‑> (t ‑> 'a) ‑> 'a

with_out_chan oc f turns oc into a formatter fmt, and call f fmt. +

      CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;
  • Since: 1.2

IO

val output : t ‑> 'a printer ‑> 'a ‑> unit
val to_string : 'a printer ‑> 'a ‑> string
val of_chan : Pervasives.out_channel ‑> t

Alias to Format.formatter_of_out_channel.

  • Since: 1.2
val with_out_chan : Pervasives.out_channel ‑> (t ‑> 'a) ‑> 'a

with_out_chan oc f turns oc into a formatter fmt, and call f fmt. Behaves like f fmt from then on, but whether the call to f fails or returns, fmt is flushed before the call terminates.

  • Since: 1.2
val stdout : t
val stderr : t
val tee : t ‑> t ‑> t

tee a b makes a new formatter that writes in both a and b.

  • Since: 1.0
val sprintf : ('at, unit, string) Pervasives.format4 ‑> 'a

Print into a string any format string that would usually be compatible -with fprintf. Similar to Format.asprintf.

val sprintf_no_color : ('at, unit, string) Pervasives.format4 ‑> 'a

Similar to sprintf but never prints colors

  • Since: 0.16
val sprintf_dyn_color : colors:bool ‑> ('at, unit, string) Pervasives.format4 ‑> 'a

Similar to sprintf but enable/disable colors depending on colors. +with fprintf. Similar to Format.asprintf.

val sprintf_no_color : ('at, unit, string) Pervasives.format4 ‑> 'a

Similar to sprintf but never prints colors.

  • Since: 0.16
val sprintf_dyn_color : colors:bool ‑> ('at, unit, string) Pervasives.format4 ‑> 'a

Similar to sprintf but enable/disable colors depending on colors. Example:

      (* with colors *)
       CCFormat.sprintf_dyn_color ~colors:true "@{<Red>%a@}"
@@ -39,8 +40,8 @@ Example:
 
       (* without colors *)
       CCFormat.sprintf_dyn_color ~colors:false "@{<Red>%a@}"
-        CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
  • Since: 0.21
val fprintf : t ‑> ('at, unit) Pervasives.format ‑> 'a

Alias to Format.fprintf

  • Since: 0.14
val fprintf_dyn_color : colors:bool ‑> t ‑> ('at, unit) Pervasives.format ‑> 'a

Similar to fprintf but enable/disable colors depending on colors

  • Since: 0.21
val ksprintf : f:(string ‑> 'b) ‑> ('a, Format.formatter, unit, 'b) Pervasives.format4 ‑> 'a

ksprintf fmt ~f formats using fmt, in a way similar to sprintf, -and then calls f on the resulting string.

  • Since: 0.14
val to_file : string ‑> ('at, unit, unit) Pervasives.format4 ‑> 'a

Print to the given file

Dump

Print structures as OCaml values, so that they can be parsed back + CCFormat.Dump.(list int) [1;2;3] |> print_endline;;

  • Since: 0.21
val fprintf : t ‑> ('at, unit) Pervasives.format ‑> 'a

Alias to Format.fprintf.

  • Since: 0.14
val fprintf_dyn_color : colors:bool ‑> t ‑> ('at, unit) Pervasives.format ‑> 'a

Similar to fprintf but enable/disable colors depending on colors.

  • Since: 0.21
val ksprintf : f:(string ‑> 'b) ‑> ('a, Format.formatter, unit, 'b) Pervasives.format4 ‑> 'a

ksprintf fmt ~f formats using fmt, in a way similar to sprintf, +and then calls f on the resulting string.

  • Since: 0.14
val to_file : string ‑> ('at, unit, unit) Pervasives.format4 ‑> 'a

Print to the given file.

Dump

Print structures as OCaml values, so that they can be parsed back by OCaml (typically, in the toplevel, for debugging).

Example:

      Format.printf "%a@." CCFormat.Dump.(list int) CCList.(1 -- 200);;
 
diff --git a/2.0/containers/CCFun/Monad/index.html b/2.0/containers/CCFun/Monad/index.html
index 28ec149e..67350d69 100644
--- a/2.0/containers/CCFun/Monad/index.html
+++ b/2.0/containers/CCFun/Monad/index.html
@@ -1,2 +1,2 @@
 
-Monad (containers.CCFun.Monad)

Module CCFun.Monad

Parameters

X : sig ... end

Signature

type 'a t = X.t ‑> 'a
val return : 'a ‑> 'a t
val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
\ No newline at end of file +Monad (containers.CCFun.Monad)

Module CCFun.Monad

Parameters

X : sig ... end

Signature

type 'a t = X.t ‑> 'a
val return : 'a ‑> 'a t

Monadic return.

val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

Monadic bind.

\ No newline at end of file diff --git a/2.0/containers/CCFun/index.html b/2.0/containers/CCFun/index.html index 8c62a05f..7d3ef072 100644 --- a/2.0/containers/CCFun/index.html +++ b/2.0/containers/CCFun/index.html @@ -1,14 +1,17 @@ -CCFun (containers.CCFun)

Module CCFun

Basic Functions

val (|>) : 'a ‑> ('a ‑> 'b) ‑> 'b

Pipeline. x |> f is the same as f x.

val compose : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Composition

val compose_binop : ('a ‑> 'b) ‑> ('b ‑> 'b ‑> 'c) ‑> 'a ‑> 'a ‑> 'c

compose_binop f g is fun x y -> g (f x) (f y) +CCFun (containers.CCFun)

Module CCFun

Basic Functions

val (|>) : 'a ‑> ('a ‑> 'b) ‑> 'b

A 'pipe' operator. x |> f is the same as f x.

val compose : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Composition. compose f g x is g (f x).

val compose_binop : ('a ‑> 'b) ‑> ('b ‑> 'b ‑> 'c) ‑> 'a ‑> 'a ‑> 'c

compose_binop f g is fun x y -> g (f x) (f y). Example (partial order): -List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false]

  • Since: 0.6
val (%>) : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Alias to compose

val (@@) : ('a ‑> 'b) ‑> 'a ‑> 'b

f @@ x is the same as f x, but right-associative.

  • Since: 0.5
val id : 'a ‑> 'a

Identity function

val const : 'a ‑> 'b ‑> 'a

const x y = x for any y

val flip : ('a ‑> 'b ‑> 'c) ‑> 'b ‑> 'a ‑> 'c

Flip arguments

val curry : (('a * 'b) ‑> 'c) ‑> 'a ‑> 'b ‑> 'c
val uncurry : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c
val tap : ('a ‑> _) ‑> 'a ‑> 'a

tap f x evaluates f x, discards it, then returns x. Useful +List.sort (compose_binop fst CCInt.compare) [1, true; 2, false; 1, false].

  • Since: 0.6
val (%>) : ('a ‑> 'b) ‑> ('b ‑> 'c) ‑> 'a ‑> 'c

Alias to compose.

val (@@) : ('a ‑> 'b) ‑> 'a ‑> 'b

f @@ x is the same as f x, but right-associative.

  • Since: 0.5
val id : 'a ‑> 'a

Identity function.

val const : 'a ‑> 'b ‑> 'a

Produce a function that just returns its first argument. +const x y = x for any y.

val flip : ('a ‑> 'b ‑> 'c) ‑> 'b ‑> 'a ‑> 'c

Reverse the order of arguments for a binary function.

val curry : (('a * 'b) ‑> 'c) ‑> 'a ‑> 'b ‑> 'c

Convert a function which accepts a pair of arguments into a function which accepts two arguments. +curry f x y is f (x,y).

val uncurry : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

Convert a function which accepts a two arguments into a function which accepts a pair of arguments. +uncurry f (x,y) is f x y.

val tap : ('a ‑> _) ‑> 'a ‑> 'a

tap f x evaluates f x, discards it, then returns x. Useful in a pipeline, for instance:

CCArray.(1 -- 10)
       |> tap CCArray.shuffle
-      |> tap @@ CCArray.sort Pervasives.compare
val (%) : ('b ‑> 'c) ‑> ('a ‑> 'b) ‑> 'a ‑> 'c

Mathematical composition

val lexicographic : ('a ‑> 'a ‑> int) ‑> ('a ‑> 'a ‑> int) ‑> 'a ‑> 'a ‑> int

Lexicographic combination of comparison functions

val finally : h:(unit ‑> _) ‑> f:(unit ‑> 'a) ‑> 'a

finally h f calls f () and returns its result. If it raises, the + |> tap @@ CCArray.sort Pervasives.compare

val (%) : ('b ‑> 'c) ‑> ('a ‑> 'b) ‑> 'a ‑> 'c

Mathematical composition. (%) f g x is f (g x).

val lexicographic : ('a ‑> 'a ‑> int) ‑> ('a ‑> 'a ‑> int) ‑> 'a ‑> 'a ‑> int

Lexicographic combination of comparison functions.

val finally : h:(unit ‑> _) ‑> f:(unit ‑> 'a) ‑> 'a

finally h f calls f () and returns its result. If it raises, the same exception is raised; in any case, h () is called after f () terminates.

val finally1 : h:(unit ‑> _) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b

finally1 ~h f x is the same as f x, but after the computation, h () is called whether f x rose an exception or not.

  • Since: 0.16
val finally2 : h:(unit ‑> _) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c

finally2 ~h f x y is the same as f x y, but after the computation, h () is called whether f x y rose an exception or not.

  • Since: 0.16
val opaque_identity : 'a ‑> 'a

opaque_identity x is like x, but prevents Flambda from using x's -definition for optimizing it (flambda is an optimization/inlining pass -in OCaml >= 4.03).

  • Since: 0.18

Monad

Functions with a fixed domain are monads in their codomain

module Monad : functor (X : sig ... end) -> sig ... end
\ No newline at end of file +definition for optimizing it. (flambda is an optimization/inlining pass +in OCaml >= 4.03).

Monad

Functions with a fixed domain are monads in their codomain.

module Monad : functor (X : sig ... end) -> sig ... end
\ No newline at end of file diff --git a/2.0/containers/CCHash/index.html b/2.0/containers/CCHash/index.html index 5d973e96..f1655064 100644 --- a/2.0/containers/CCHash/index.html +++ b/2.0/containers/CCHash/index.html @@ -1,7 +1,8 @@ -CCHash (containers.CCHash)

Module CCHash

Hash combinators

Definitions

type hash = int

A hash value is a positive integer

type 'a t = 'a ‑> hash

A hash function for values of type 'a

val const : hash ‑> _ t

return h hashes any value into h. Use with caution!.

val const0 : _ t

Always return 0. Useful for ignoring elements. +CCHash (containers.CCHash)

Module CCHash

Hash combinators

Definitions

type hash = int

A hash value is a positive integer.

type 'a t = 'a ‑> hash

A hash function for values of type 'a.

val const : hash ‑> _ t

const h hashes any value into h. Use with caution!.

val const0 : _ t

Always return 0. Useful for ignoring elements. Example: Hash.(pair string const0) will map pairs ("a", 1) -and ("a", 2) to the same hash, but not the same as ("b", 1)

  • Since: 1.5
val int : int t
val bool : bool t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val slice : string ‑> int ‑> int t

slice s i len state hashes the slice i, ... i+len-1 of s -into state

val string : string t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val opt : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val if_ : bool ‑> 'a t ‑> 'a t ‑> 'a t

Decide which hash function to use depending on the boolean

val poly : 'a t

the regular polymorphic hash function

val list_comm : 'a t ‑> 'a list t

Commutative version of list. Lists that are equal up to permutation +and ("a", 2) to the same hash, but not the same as ("b", 1).

  • Since: 1.5
val int : int t
val bool : bool t
val char : char t
val int32 : int32 t
val int64 : int64 t
val nativeint : nativeint t
val slice : string ‑> int ‑> int t

slice s i len state hashes the slice i, ... i+len-1 of s +into state.

val string : string t
val list : 'a t ‑> 'a list t
val array : 'a t ‑> 'a array t
val opt : 'a t ‑> 'a option t
val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
val quad : 'a t ‑> 'b t ‑> 'c t ‑> 'd t ‑> ('a * 'b * 'c * 'd) t
val if_ : bool ‑> 'a t ‑> 'a t ‑> 'a t

Decide which hash function to use depending on the boolean.

val poly : 'a t

The regular polymorphic hash function. +poly x is Hashtbl.hash x.

val list_comm : 'a t ‑> 'a list t

Commutative version of list. Lists that are equal up to permutation will have the same hash.

  • Since: 1.0
val array_comm : 'a t ‑> 'a array t

Commutative version of array. Arrays that are equal up to permutation will have the same hash.

  • Since: 1.0

Base hash combinators

val combine : 'a t ‑> hash ‑> 'a ‑> hash
val combine2 : hash ‑> hash ‑> hash
val combine3 : hash ‑> hash ‑> hash ‑> hash
val combine4 : hash ‑> hash ‑> hash ‑> hash ‑> hash

Iterators

type 'a sequence = ('a ‑> unit) ‑> unit
type 'a gen = unit ‑> 'a option
type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
val seq : 'a t ‑> 'a sequence t
val gen : 'a t ‑> 'a gen t
val klist : 'a t ‑> 'a klist t
\ No newline at end of file diff --git a/2.0/containers/CCHashtbl/Poly/index.html b/2.0/containers/CCHashtbl/Poly/index.html index 422f6198..c1fce9a1 100644 --- a/2.0/containers/CCHashtbl/Poly/index.html +++ b/2.0/containers/CCHashtbl/Poly/index.html @@ -1,20 +1,20 @@ -Poly (containers.CCHashtbl.Poly)

Module CCHashtbl.Poly

val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, -and returns default otherwise (if k doesn't belong in tbl)

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter)

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +Poly (containers.CCHashtbl.Poly)

Module CCHashtbl.Poly

val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find.

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table.

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list.

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; -otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Same as incr but substract 1 (or the value of by). +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. -This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is -not bound, it becomes bound to [y].

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table.

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order.

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each -element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Similar to add_seq_count, but allocates a new table and returns it

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified)

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, +element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Similar to add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified).

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted -using Hashtbl.replace

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

  • Since: 1.0
val pp : 'a printer ‑> 'b printer ‑> ('a'b) Hashtbl.t printer
\ No newline at end of file diff --git a/2.0/containers/CCHashtbl/index.html b/2.0/containers/CCHashtbl/index.html index 2657f658..5b202b9f 100644 --- a/2.0/containers/CCHashtbl/index.html +++ b/2.0/containers/CCHashtbl/index.html @@ -1,20 +1,20 @@ -CCHashtbl (containers.CCHashtbl)

Module CCHashtbl

Extension to the standard Hashtbl

  • Since: 0.4
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a eq = 'a ‑> 'a ‑> bool
type 'a hash = 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit

Polymorphic tables

This sub-module contains the extension of the standard polymorphic hashtbl.

module Poly : sig ... end
include module type of Poly
val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, -and returns default otherwise (if k doesn't belong in tbl)

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter)

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +CCHashtbl (containers.CCHashtbl)

Module CCHashtbl

Extension to the standard Hashtbl

  • Since: 0.4
type 'a sequence = ('a ‑> unit) ‑> unit
type 'a eq = 'a ‑> 'a ‑> bool
type 'a hash = 'a ‑> int
type 'a printer = Format.formatter ‑> 'a ‑> unit

Polymorphic tables

This sub-module contains the extension of the standard polymorphic Hashtbl.

module Poly : sig ... end
include module type of Poly
val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

Safe version of Hashtbl.find.

val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val keys : ('a'b) Hashtbl.t ‑> 'a sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : ('a'b) Hashtbl.t ‑> 'b sequence

Iterate on values in the table.

val keys_list : ('a'b) Hashtbl.t ‑> 'a list

keys_list t is the list of keys in t.

  • Since: 0.8
val values_list : ('a'b) Hashtbl.t ‑> 'b list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

Map on a hashtable's items, collect into a list.

val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; -otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Same as incr but substract 1 (or the value of by). +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

Like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. -This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is -not bound, it becomes bound to [y].

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +This does nothing if the key is not already present in the table.

  • Since: 0.16
val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence

Iterate on bindings in the table.

val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val of_seq : ('a * 'b) sequence ‑> ('a'b) Hashtbl.t

From the given bindings, added in order.

val add_seq_count : ('a, int) Hashtbl.t ‑> 'a sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each -element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Similar to add_seq_count, but allocates a new table and returns it

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified)

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, +element of seq occurs.

  • Since: 0.16
val of_seq_count : 'a sequence ‑> ('a, int) Hashtbl.t

Similar to add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

List of bindings (order unspecified).

val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

Build a table from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted -using Hashtbl.replace

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

  • Since: 1.0
val pp : 'a printer ‑> 'b printer ‑> ('a'b) Hashtbl.t printer

Functor

module type S : sig ... end
module Make : functor (X : Hashtbl.HashedType) -> S with type Make.key = X.t and type 'a Make.t = 'a Hashtbl.Make(X).t
\ No newline at end of file diff --git a/2.0/containers/CCHashtbl/module-type-S/index.html b/2.0/containers/CCHashtbl/module-type-S/index.html index e9d85a5c..d5ee11c4 100644 --- a/2.0/containers/CCHashtbl/module-type-S/index.html +++ b/2.0/containers/CCHashtbl/module-type-S/index.html @@ -1,20 +1,20 @@ -S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Hashtbl.S
type key
type 'a t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> Hashtbl.statistics
val get : 'a t ‑> key ‑> 'a option

Safe version of Hashtbl.find

val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

get_or tbl k ~default returns the value associated to k if present, -and returns default otherwise (if k doesn't belong in tbl)

  • Since: 0.16
val add_list : 'a list t ‑> key ‑> 'a ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is -not bound, it becomes bound to [y].

  • Since: 0.16
val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. +S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Hashtbl.S
type key
type 'a t
val create : int ‑> 'a t
val clear : 'a t ‑> unit
val reset : 'a t ‑> unit
val copy : 'a t ‑> 'a t
val add : 'a t ‑> key ‑> 'a ‑> unit
val remove : 'a t ‑> key ‑> unit
val find : 'a t ‑> key ‑> 'a
val find_opt : 'a t ‑> key ‑> 'a option
val find_all : 'a t ‑> key ‑> 'a list
val replace : 'a t ‑> key ‑> 'a ‑> unit
val mem : 'a t ‑> key ‑> bool
val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
val length : 'a t ‑> int
val stats : 'a t ‑> Hashtbl.statistics
val get : 'a t ‑> key ‑> 'a option

Safe version of Hashtbl.find.

val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

  • Since: 0.16
val add_list : 'a list t ‑> key ‑> 'a ‑> unit

add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

  • Since: 0.16
val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; -otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1
  • Since: 0.16
val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

Same as incr but substract 1 (or the value of by). +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

  • Parameter by: if specified, the int value is incremented by by rather than 1.
  • Since: 0.16
val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

Like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. -This does nothing if the key is not already present in the table.

  • Since: 0.16
val keys : 'a t ‑> key sequence

Iterate on keys (similar order as Hashtbl.iter)

val values : 'a t ‑> 'a sequence

Iterate on values in the table

val keys_list : _ t ‑> key list

keys t is the list of keys in t.

  • Since: 0.8
val values_list : 'a t ‑> 'a list

values t is the list of values in t.

  • Since: 0.8
val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

Map on a hashtable's items, collect into a list

val to_seq : 'a t ‑> (key * 'a) sequence

Iterate on values in the table

val of_seq : (key * 'a) sequence ‑> 'a t

From the given bindings, added in order

val add_seq : 'a t ‑> (key * 'a) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val add_seq_count : int t ‑> key sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq +This does nothing if the key is not already present in the table.

  • Since: 0.16
val keys : 'a t ‑> key sequence

Iterate on keys (similar order as Hashtbl.iter).

val values : 'a t ‑> 'a sequence

Iterate on values in the table.

val keys_list : _ t ‑> key list

keys_list t is the list of keys in t.

  • Since: 0.8
val values_list : 'a t ‑> 'a list

values_list t is the list of values in t.

  • Since: 0.8
val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

Map on a hashtable's items, collect into a list.

val to_seq : 'a t ‑> (key * 'a) sequence

Iterate on values in the table.

val of_seq : (key * 'a) sequence ‑> 'a t

From the given bindings, added in order.

val add_seq : 'a t ‑> (key * 'a) sequence ‑> unit

Add the corresponding pairs to the table, using Hashtbl.add.

  • Since: 0.16
val add_seq_count : int t ‑> key sequence ‑> unit

add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each -element of seq occurs.

  • Since: 0.16
val of_seq_count : key sequence ‑> int t

Similar to add_seq_count, but allocates a new table and returns it

  • Since: 0.16
val to_list : 'a t ‑> (key * 'a) list

List of bindings (order unspecified)

val of_list : (key * 'a) list ‑> 'a t

Build a table from the given list of bindings k_i -> v_i, +element of seq occurs.

  • Since: 0.16
val of_seq_count : key sequence ‑> int t

Similar to add_seq_count, but allocates a new table and returns it.

  • Since: 0.16
val to_list : 'a t ‑> (key * 'a) list

List of bindings (order unspecified).

val of_list : (key * 'a) list ‑> 'a t

Build a table from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

val update : 'a t ‑> f:(key ‑> 'a option ‑> 'a option) ‑> k:key ‑> unit

update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted -using Hashtbl.replace

  • Since: 0.14
val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

get_or_add tbl ~k ~f finds and returns the binding of k +using Hashtbl.replace.

  • Since: 0.14
val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

  • Since: 1.0
val pp : key printer ‑> 'a printer ‑> 'a t printer
\ No newline at end of file diff --git a/2.0/containers/CCHeap/Make/argument-1-E/index.html b/2.0/containers/CCHeap/Make/argument-1-E/index.html index 74b4d3b2..6173385d 100644 --- a/2.0/containers/CCHeap/Make/argument-1-E/index.html +++ b/2.0/containers/CCHeap/Make/argument-1-E/index.html @@ -1,2 +1,2 @@ -1-E (containers.CCHeap.Make.1-E)

Parameter CCHeap.Make.1-E

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y

\ No newline at end of file +1-E (containers.CCHeap.Make.1-E)

Parameter CCHeap.Make.1-E

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/2.0/containers/CCHeap/Make/index.html b/2.0/containers/CCHeap/Make/index.html index f81ee3e8..38b7cc68 100644 --- a/2.0/containers/CCHeap/Make/index.html +++ b/2.0/containers/CCHeap/Make/index.html @@ -1,5 +1,11 @@ -Make (containers.CCHeap.Make)

Module CCHeap.Make

Parameters

Signature

type elt = E.t
type t
val empty : t

Empty heap

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps

val insert : elt ‑> t ‑> t

Insert a value in the heap

val add : t ‑> elt ‑> t

Synonym to insert

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. -Linear time at least.

val find_min : t ‑> elt option

Find minimal element

val find_min_exn : t ‑> elt

Same as find_min but can fail

  • Raises Empty: if the heap is empty
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without -this element), or None if the heap is empty

val take_exn : t ‑> t * elt

Same as take, but can fail.

  • Raises Empty: if the heap is empty
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values

val size : t ‑> int

Number of elements (linear complexity)

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several -times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l = add_list empty l

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t
val to_seq : t ‑> elt sequence
val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t
val to_klist : t ‑> elt klist
val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t
val to_gen : t ‑> elt gen
val to_tree : t ‑> elt ktree
val print : ?⁠sep:string ‑> elt printer ‑> t printer
  • Since: 0.16
\ No newline at end of file +Make (containers.CCHeap.Make)

Module CCHeap.Make

Parameters

Signature

type elt = E.t
type t
val empty : t

Empty heap.

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps.

val insert : elt ‑> t ‑> t

Insert a value in the heap.

val add : t ‑> elt ‑> t

Synonym to insert.

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. +Linear time at least.

val find_min : t ‑> elt option

Find minimal element.

val find_min_exn : t ‑> elt

Like find_min but can fail.

  • Raises Empty: if the heap is empty.
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without +this element), or None if the heap is empty.

val take_exn : t ‑> t * elt

Like take, but can fail.

  • Raises Empty: if the heap is empty.
val delete_one : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete one occurrence of a value if it exist in the heap. +delete_one eq x h, use eq to find one x in h and delete it. +If h do not contain x then it return h.

  • Since: 2.0
val delete_all : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete all occurrences of a value in the heap. +delete_all eq x h, use eq to find all x in h and delete them. +If h do not contain x then it return h. +The difference with filter is that delete_all stops as soon as +it enters a subtree whose root is bigger than the element.

  • Since: 2.0
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values.

val size : t ‑> int

Number of elements (linear complexity).

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order.

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several +times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l is add_list empty l.

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t

Build a heap from a given sequence.

val to_seq : t ‑> elt sequence

Return a sequence of the elements of the heap.

val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order.

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t

Build a heap from a given klist.

val to_klist : t ‑> elt klist

Return a klist of the elements of the heap.

val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t

Build a heap from a given gen.

val to_gen : t ‑> elt gen

Return a gen of the elements of the heap.

val to_tree : t ‑> elt ktree

Return a ktree of the elements of the heap.

val pp : ?⁠sep:string ‑> elt printer ‑> t printer
\ No newline at end of file diff --git a/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html b/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html index e8d53b86..b5e693f3 100644 --- a/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html +++ b/2.0/containers/CCHeap/module-type-PARTIAL_ORD/index.html @@ -1,2 +1,2 @@ -PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD)

Module type CCHeap.PARTIAL_ORD

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y

\ No newline at end of file +PARTIAL_ORD (containers.CCHeap.PARTIAL_ORD)

Module type CCHeap.PARTIAL_ORD

type t
val leq : t ‑> t ‑> bool

leq x y shall return true iff x is lower or equal to y.

\ No newline at end of file diff --git a/2.0/containers/CCHeap/module-type-S/index.html b/2.0/containers/CCHeap/module-type-S/index.html index 3fd20559..4e53df7c 100644 --- a/2.0/containers/CCHeap/module-type-S/index.html +++ b/2.0/containers/CCHeap/module-type-S/index.html @@ -1,5 +1,11 @@ -S (containers.CCHeap.S)

Module type CCHeap.S

type elt
type t
val empty : t

Empty heap

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps

val insert : elt ‑> t ‑> t

Insert a value in the heap

val add : t ‑> elt ‑> t

Synonym to insert

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. -Linear time at least.

val find_min : t ‑> elt option

Find minimal element

val find_min_exn : t ‑> elt

Same as find_min but can fail

  • Raises Empty: if the heap is empty
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without -this element), or None if the heap is empty

val take_exn : t ‑> t * elt

Same as take, but can fail.

  • Raises Empty: if the heap is empty
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values

val size : t ‑> int

Number of elements (linear complexity)

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several -times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l = add_list empty l

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t
val to_seq : t ‑> elt sequence
val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t
val to_klist : t ‑> elt klist
val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t
val to_gen : t ‑> elt gen
val to_tree : t ‑> elt ktree
val print : ?⁠sep:string ‑> elt printer ‑> t printer
  • Since: 0.16
\ No newline at end of file +S (containers.CCHeap.S)

Module type CCHeap.S

type elt
type t
val empty : t

Empty heap.

val is_empty : t ‑> bool

Is the heap empty?

exception Empty
val merge : t ‑> t ‑> t

Merge two heaps.

val insert : elt ‑> t ‑> t

Insert a value in the heap.

val add : t ‑> elt ‑> t

Synonym to insert.

val filter : (elt ‑> bool) ‑> t ‑> t

Filter values, only retaining the ones that satisfy the predicate. +Linear time at least.

val find_min : t ‑> elt option

Find minimal element.

val find_min_exn : t ‑> elt

Like find_min but can fail.

  • Raises Empty: if the heap is empty.
val take : t ‑> (t * elt) option

Extract and return the minimum element, and the new heap (without +this element), or None if the heap is empty.

val take_exn : t ‑> t * elt

Like take, but can fail.

  • Raises Empty: if the heap is empty.
val delete_one : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete one occurrence of a value if it exist in the heap. +delete_one eq x h, use eq to find one x in h and delete it. +If h do not contain x then it return h.

  • Since: 2.0
val delete_all : (elt ‑> elt ‑> bool) ‑> elt ‑> t ‑> t

Delete all occurrences of a value in the heap. +delete_all eq x h, use eq to find all x in h and delete them. +If h do not contain x then it return h. +The difference with filter is that delete_all stops as soon as +it enters a subtree whose root is bigger than the element.

  • Since: 2.0
val iter : (elt ‑> unit) ‑> t ‑> unit

Iterate on elements.

val fold : ('a ‑> elt ‑> 'a) ‑> 'a ‑> t ‑> 'a

Fold on all values.

val size : t ‑> int

Number of elements (linear complexity).

val to_list : t ‑> elt list

Return the elements of the heap, in no particular order.

val to_list_sorted : t ‑> elt list

Return the elements in increasing order.

  • Since: 1.1
val add_list : t ‑> elt list ‑> t

Add the elements of the list to the heap. An element occurring several +times will be added that many times to the heap.

  • Since: 0.16
val of_list : elt list ‑> t

of_list l is add_list empty l.

val add_seq : t ‑> elt sequence ‑> t
  • Since: 0.16
val of_seq : elt sequence ‑> t

Build a heap from a given sequence.

val to_seq : t ‑> elt sequence

Return a sequence of the elements of the heap.

val to_seq_sorted : t ‑> elt sequence

Iterate on the elements, in increasing order.

  • Since: 1.1
val add_klist : t ‑> elt klist ‑> t
  • Since: 0.16
val of_klist : elt klist ‑> t

Build a heap from a given klist.

val to_klist : t ‑> elt klist

Return a klist of the elements of the heap.

val add_gen : t ‑> elt gen ‑> t
  • Since: 0.16
val of_gen : elt gen ‑> t

Build a heap from a given gen.

val to_gen : t ‑> elt gen

Return a gen of the elements of the heap.

val to_tree : t ‑> elt ktree

Return a ktree of the elements of the heap.

val pp : ?⁠sep:string ‑> elt printer ‑> t printer
\ No newline at end of file diff --git a/2.0/containers/CCIO/File/index.html b/2.0/containers/CCIO/File/index.html index b25929db..d45f88a5 100644 --- a/2.0/containers/CCIO/File/index.html +++ b/2.0/containers/CCIO/File/index.html @@ -1,14 +1,14 @@ File (containers.CCIO.File)

Module CCIO.File

type t = string

A file should be represented by its absolute path, but currently -this is not enforced.

val to_string : t ‑> string
val make : string ‑> t

Build a file representation from a path (absolute or relative)

val exists : t ‑> bool
val is_directory : t ‑> bool
val remove_exn : t ‑> unit

remove_exn path tries to remove the file at path from the +this is not enforced.

val to_string : t ‑> string
val make : string ‑> t

Build a file representation from a path (absolute or relative).

val exists : t ‑> bool
val is_directory : t ‑> bool
val remove_exn : t ‑> unit

remove_exn path tries to remove the file at path from the file system.

  • Raises Sys_error: if there is no file at path or access rights are wrong.
  • Since: 0.8
val remove : t ‑> unit or_error

Like remove_exn but with an error monad.

  • Since: 0.8
val remove_noerr : t ‑> unit

Like remove_exn but do not raise any exception on failure.

  • Since: 0.8
val read_dir : ?⁠recurse:bool ‑> t ‑> t gen

read_dir d returns a sequence of files and directory contained -in the directory d (or an empty stream if d is not a directory)

  • Raises Sys_error: in case of error (e.g. permission denied)
  • Parameter recurse: if true (default false), sub-directories are also -explored
val read_exn : t ‑> string

Read the content of the given file, or raises some exception

  • Raises Sys_error: in case of error
  • Since: 0.16
val read : t ‑> string or_error

Read the content of the given file

  • Since: 0.16
val append_exn : t ‑> string ‑> unit

Append the given string into the given file, possibly raising

  • Raises Sys_error: in case of error
  • Since: 0.16
val append : t ‑> string ‑> unit or_error

Append the given string into the given file

  • Since: 0.16
val write_exn : t ‑> string ‑> unit

Write the given string into the given file, possibly raising

  • Raises Sys_error: in case of error
  • Since: 0.16
val write : t ‑> string ‑> unit or_error

Write the given string into the given file

  • Since: 0.16
type walk_item = [ `File | `Dir ] * t
val walk : t ‑> walk_item gen

Similar to read_dir (with recurse=true), this function walks +in the directory d (or an empty stream if d is not a directory).

  • Raises Sys_error: in case of error (e.g. permission denied).
  • Parameter recurse: if true (default false), sub-directories are also +explored.
val read_exn : t ‑> string

Read the content of the given file, or raises some exception.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val read : t ‑> string or_error

Read the content of the given file.

  • Since: 0.16
val append_exn : t ‑> string ‑> unit

Append the given string into the given file, possibly raising.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val append : t ‑> string ‑> unit or_error

Append the given string into the given file.

  • Since: 0.16
val write_exn : t ‑> string ‑> unit

Write the given string into the given file, possibly raising.

  • Raises Sys_error: in case of error.
  • Since: 0.16
val write : t ‑> string ‑> unit or_error

Write the given string into the given file.

  • Since: 0.16
type walk_item = [ `File | `Dir ] * t
val walk : t ‑> walk_item gen

Similar to read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including -symlinks, etc.)

  • Raises Sys_error: in case of error (e.g. permission denied) during iteration
val walk_l : t ‑> walk_item list

Same as walk but returns a list (therefore it's eager and might -take some time on large directories)

  • Since: 1.1
val show_walk_item : walk_item ‑> string
val with_temp : ?⁠temp_dir:string ‑> prefix:string ‑> suffix:string ‑> (string ‑> 'a) ‑> 'a

with_temp ~prefix ~suffix f will call f with the name of a new +symlinks, etc.)

  • Raises Sys_error: in case of error (e.g. permission denied) during iteration.
val walk_l : t ‑> walk_item list

Like walk but returns a list (therefore it's eager and might +take some time on large directories).

  • Since: 1.1
val show_walk_item : walk_item ‑> string
val with_temp : ?⁠temp_dir:string ‑> prefix:string ‑> suffix:string ‑> (string ‑> 'a) ‑> 'a

with_temp ~prefix ~suffix f will call f with the name of a new temporary file (located in temp_dir). After f returns, the file is deleted. Best to be used in combination with with_out. -See Filename.temp_file

  • Since: 0.17
\ No newline at end of file +See Filename.temp_file.

  • Since: 0.17
\ No newline at end of file diff --git a/2.0/containers/CCIO/index.html b/2.0/containers/CCIO/index.html index 1796e878..192285b8 100644 --- a/2.0/containers/CCIO/index.html +++ b/2.0/containers/CCIO/index.html @@ -10,13 +10,13 @@ like Lwt or Async, that are far more comprehensive.

Examples:

  • o write_gen oc chunks ) ) - ) ;;
    • Since: 0.6
    • Before 0.12.was in 'containers.io', now moved into 'containers'
    type 'a or_error = ('a, string) Result.result
    type 'a gen = unit ‑> 'a option

    See Gen in the gen library

    Input

    val with_in : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> 'a) ‑> 'a

    Open an input file with the given optional flag list, calls the function + ) ;;

    • Since: 0.6
    • Before 0.12.was in 'containers.io', now moved into 'containers'
    type 'a or_error = ('a, string) Result.result
    type 'a gen = unit ‑> 'a option

    See Gen in the gen library.

    Input

    val with_in : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> 'a) ‑> 'a

    Open an input file with the given optional flag list, calls the function on the input channel. When the function raises or returns, the -channel is closed.

    • Raises Sys_error: in case of error (same as open_in and close_in)
    • Parameter flags: opening flags (default [Open_text]). Open_rdonly is used in any cases
    val read_chunks : ?⁠size:int ‑> Pervasives.in_channel ‑> string gen

    Read the channel's content into chunks of size size

    val read_line : Pervasives.in_channel ‑> string option

    Read a line from the channel. Returns None if the input is terminated. -The "\n" is removed from the line.

    val read_lines : Pervasives.in_channel ‑> string gen

    Read all lines. The generator should be traversed only once.

    val read_lines_l : Pervasives.in_channel ‑> string list

    Read all lines into a list

    val read_all : ?⁠size:int ‑> Pervasives.in_channel ‑> string

    Read the whole channel into a buffer, then converted into a string.

    • Parameter size: the internal buffer size
    • Since: 0.7
    val read_all_bytes : ?⁠size:int ‑> Pervasives.in_channel ‑> Bytes.t

    Read the whole channel into a mutable byte array

    • Parameter size: the internal buffer size
    • Since: 0.12

    Output

    val with_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

    Same as with_in but for an output channel

    • Parameter flags: opening flags (default [Open_creat; Open_trunc; Open_text]).
    • Raises Sys_error: in case of error (same as open_out and close_out) -Open_wronly is used in any cases
    val with_out_a : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

    Similar to with_out but with the [Open_append; Open_creat; Open_wronly] -flags activated, to append to the file.

    • Raises Sys_error: in case of error (same as open_out and close_out)
    val write_line : Pervasives.out_channel ‑> string ‑> unit

    Write the given string on the channel, followed by "\n"

    val write_gen : ?⁠sep:string ‑> Pervasives.out_channel ‑> string gen ‑> unit

    Write the given strings on the output. If provided, add sep between -every two strings (but not at the end)

    val write_lines : Pervasives.out_channel ‑> string gen ‑> unit

    Write every string on the output, followed by "\n".

    val write_lines_l : Pervasives.out_channel ‑> string list ‑> unit

    Both

    val with_in_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'a

    Combines with_in and with_out.

    • Parameter flags: opening flags (default [Open_creat])
    • Raises Sys_error: in case of error
    • Since: 0.12

    Misc for Generators

    val tee : ('a ‑> unit) list ‑> 'a gen ‑> 'a gen

    tee funs gen behaves like gen, but each element is given to +channel is closed.

    • Raises Sys_error: in case of error (same as open_in and close_in).
    • Parameter flags: opening flags (default [Open_text]). Open_rdonly is used in any cases.
    val read_chunks : ?⁠size:int ‑> Pervasives.in_channel ‑> string gen

    Read the channel's content into chunks of size size.

    val read_line : Pervasives.in_channel ‑> string option

    Read a line from the channel. Returns None if the input is terminated. +The "\n" is removed from the line.

    val read_lines : Pervasives.in_channel ‑> string gen

    Read all lines. The generator should be traversed only once.

    val read_lines_l : Pervasives.in_channel ‑> string list

    Read all lines into a list.

    val read_all : ?⁠size:int ‑> Pervasives.in_channel ‑> string

    Read the whole channel into a buffer, then converted into a string.

    • Parameter size: the internal buffer size.
    • Since: 0.7
    val read_all_bytes : ?⁠size:int ‑> Pervasives.in_channel ‑> Bytes.t

    Read the whole channel into a mutable byte array.

    • Parameter size: the internal buffer size.
    • Since: 0.12

    Output

    val with_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

    Like with_in but for an output channel.

    • Parameter flags: opening flags (default [Open_creat; Open_trunc; Open_text]).
    • Raises Sys_error: in case of error (same as open_out and close_out). +Open_wronly is used in any cases.
    val with_out_a : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.out_channel ‑> 'a) ‑> 'a

    Similar to with_out but with the [Open_append; Open_creat; Open_wronly] +flags activated, to append to the file.

    • Raises Sys_error: in case of error (same as open_out and close_out).
    val write_line : Pervasives.out_channel ‑> string ‑> unit

    Write the given string on the channel, followed by "\n".

    val write_gen : ?⁠sep:string ‑> Pervasives.out_channel ‑> string gen ‑> unit

    Write the given strings on the output. If provided, add sep between +every two strings (but not at the end).

    val write_lines : Pervasives.out_channel ‑> string gen ‑> unit

    Write every string on the output, followed by "\n".

    val write_lines_l : Pervasives.out_channel ‑> string list ‑> unit

    Both

    val with_in_out : ?⁠mode:int ‑> ?⁠flags:Pervasives.open_flag list ‑> string ‑> (Pervasives.in_channel ‑> Pervasives.out_channel ‑> 'a) ‑> 'a

    Combines with_in and with_out.

    • Parameter flags: opening flags (default [Open_creat]).
    • Raises Sys_error: in case of error.
    • Since: 0.12

    Misc for Generators

    val tee : ('a ‑> unit) list ‑> 'a gen ‑> 'a gen

    tee funs gen behaves like gen, but each element is given to every function f in funs at the time the element is produced.

    File and file names

    How to list recursively files in a directory:

          # let files = CCIO.File.read_dir ~recurse:true (CCIO.File.make "/tmp");;
           # CCIO.write_lines stdout files;;

    See File.walk if you also need to list directories:

          # let content = CCIO.File.walk (CCIO.File.make "/tmp");;
    diff --git a/2.0/containers/CCInt/Infix/index.html b/2.0/containers/CCInt/Infix/index.html
    index d9016bdb..6de54185 100644
    --- a/2.0/containers/CCInt/Infix/index.html
    +++ b/2.0/containers/CCInt/Infix/index.html
    @@ -1,2 +1,2 @@
     
    -Infix (containers.CCInt.Infix)

    Module CCInt.Infix

    Infix Operators

    • Since: 0.17
    val (=) : t ‑> t ‑> bool
    • Since: 0.17
    val (<>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<) : t ‑> t ‑> bool
    • Since: 0.17
    val (>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<=) : t ‑> t ‑> bool
    • Since: 0.17
    val (>=) : t ‑> t ‑> bool
    • Since: 0.17
    val (--) : t ‑> t ‑> t sequence

    Alias to range

    • Since: 1.2
    val (--^) : t ‑> t ‑> t sequence

    Alias to range'

    • Since: 1.2
    \ No newline at end of file +Infix (containers.CCInt.Infix)

    Module CCInt.Infix

    val (=) : t ‑> t ‑> bool
    • Since: 0.17
    val (<>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<) : t ‑> t ‑> bool
    • Since: 0.17
    val (>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<=) : t ‑> t ‑> bool
    • Since: 0.17
    val (>=) : t ‑> t ‑> bool
    • Since: 0.17
    val (--) : t ‑> t ‑> t sequence

    Alias to range.

    • Since: 1.2
    val (--^) : t ‑> t ‑> t sequence

    Alias to range'.

    • Since: 1.2
    \ No newline at end of file diff --git a/2.0/containers/CCInt/index.html b/2.0/containers/CCInt/index.html index 5ebf04ab..6e50d147 100644 --- a/2.0/containers/CCInt/index.html +++ b/2.0/containers/CCInt/index.html @@ -1,9 +1,10 @@ -CCInt (containers.CCInt)

    Module CCInt

    Basic Int functions

    type t = int
    val compare : t ‑> t ‑> int
    val equal : t ‑> t ‑> bool
    val hash : t ‑> int
    val sign : t ‑> int

    sign i is one of -1, 0, 1

    val neg : t ‑> t

    neg i = - i

    • Since: 0.5
    val pow : t ‑> t ‑> t

    pow a b = a^b for positive integers a and b. +CCInt (containers.CCInt)

    Module CCInt

    Basic Int functions

    type t = int
    val compare : t ‑> t ‑> int

    The comparison function for integers with the same specification as Pervasives.compare.

    val equal : t ‑> t ‑> bool

    Equality function for integers.

    val hash : t ‑> int
    val sign : t ‑> int

    sign i is one of -1, 0, 1.

    val neg : t ‑> t

    Unary negation. neg i = - i.

    • Since: 0.5
    val pow : t ‑> t ‑> t

    pow base exponent returns base raised to the power of exponent. +pow a b = a^b for positive integers a and b. Raises Invalid_argument if a = b = 0 or b < 0.

    • Since: 0.11
    val floor_div : t ‑> t ‑> t

    floor_div a n is integer division rounding towards negative infinity. It satisfies a = m * floor_div a n + rem a n.

    • Since: 1.2
    val rem : t ‑> t ‑> t

    rem a n is the remainder of dividing a by n, with the same -sign as n.

    • Since: 1.2
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    type 'a sequence = ('a ‑> unit) ‑> unit
    val random : int ‑> t random_gen
    val random_small : t random_gen
    val random_range : int ‑> int ‑> t random_gen
    val pp : t printer
    val to_string : t ‑> string
    • Since: 0.13
    val of_string : string ‑> t option
    • Since: 0.13
    val pp_binary : t printer

    prints as "0b00101010".

    • Since: 0.20
    val to_string_binary : t ‑> string
    • Since: 0.20
    val min : t ‑> t ‑> t
    • Since: 0.17
    val max : t ‑> t ‑> t
    • Since: 0.17
    val range_by : step:t ‑> t ‑> t ‑> t sequence

    range_by ~step i j iterates on integers from i to j included, +sign as n.

    • Since: 1.2
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    type 'a sequence = ('a ‑> unit) ‑> unit
    val random : int ‑> t random_gen
    val random_small : t random_gen
    val random_range : int ‑> int ‑> t random_gen
    val pp : t printer
    val to_string : t ‑> string

    Return the string representation of its argument, in signed decimal.

    • Since: 0.13
    val of_string : string ‑> t option
    • Since: 0.13
    val pp_binary : t printer

    Print as "0b00101010".

    • Since: 0.20
    val to_string_binary : t ‑> string
    • Since: 0.20
    val min : t ‑> t ‑> t

    The minimum of two integers.

    • Since: 0.17
    val max : t ‑> t ‑> t

    The maximum of two integers.

    • Since: 0.17
    val range_by : step:t ‑> t ‑> t ‑> t sequence

    range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. -use a negative step for a decreasing list.

    • Raises Invalid_argument: if step=0
    • Since: 1.2
    val range : t ‑> t ‑> t sequence

    range i j iterates on integers from i to j included . It works -both for decreasing and increasing ranges

    • Since: 1.2
    val range' : t ‑> t ‑> t sequence

    Same as range but the second bound is excluded. -For instance range' 0 5 = Sequence.of_list [0;1;2;3;4]

    • Since: 1.2
    module Infix : sig ... end

    Infix Operators

    include module type of Infix

    Infix Operators

    • Since: 0.17
    val (=) : t ‑> t ‑> bool
    • Since: 0.17
    val (<>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<) : t ‑> t ‑> bool
    • Since: 0.17
    val (>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<=) : t ‑> t ‑> bool
    • Since: 0.17
    val (>=) : t ‑> t ‑> bool
    • Since: 0.17
    val (--) : t ‑> t ‑> t sequence

    Alias to range

    • Since: 1.2
    val (--^) : t ‑> t ‑> t sequence

    Alias to range'

    • Since: 1.2
    \ No newline at end of file +Use a negative step for a decreasing list.

    • Raises Invalid_argument: if step=0.
    • Since: 1.2
    val range : t ‑> t ‑> t sequence

    range i j iterates on integers from i to j included . It works +both for decreasing and increasing ranges.

    • Since: 1.2
    val range' : t ‑> t ‑> t sequence

    Like range but the second bound is excluded. +For instance range' 0 5 = Sequence.of_list [0;1;2;3;4].

    • Since: 1.2

    Infix Operators

    • Since: 0.17
    module Infix : sig ... end
    include module type of Infix
    val (=) : t ‑> t ‑> bool
    • Since: 0.17
    val (<>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<) : t ‑> t ‑> bool
    • Since: 0.17
    val (>) : t ‑> t ‑> bool
    • Since: 0.17
    val (<=) : t ‑> t ‑> bool
    • Since: 0.17
    val (>=) : t ‑> t ‑> bool
    • Since: 0.17
    val (--) : t ‑> t ‑> t sequence

    Alias to range.

    • Since: 1.2
    val (--^) : t ‑> t ‑> t sequence

    Alias to range'.

    • Since: 1.2
    \ No newline at end of file diff --git a/2.0/containers/CCInt64/index.html b/2.0/containers/CCInt64/index.html index 8b45357f..45432fc3 100644 --- a/2.0/containers/CCInt64/index.html +++ b/2.0/containers/CCInt64/index.html @@ -1,19 +1,19 @@ -CCInt64 (containers.CCInt64)

    Module CCInt64

    Int64

    Helpers for in64.

    • Since: 0.13
    type t = int64
    val (+) : t ‑> t ‑> t

    Addition.

    val (-) : t ‑> t ‑> t

    Subtraction.

    val (~-) : t ‑> t

    Unary negation.

    val (*) : t ‑> t ‑> t

    Multiplication.

    val (/) : t ‑> t ‑> t

    Integer division. Raise Division_by_zero if the second +CCInt64 (containers.CCInt64)

    Module CCInt64

    Int64

    Helpers for 64-bit integers.

    • Since: 0.13
    type t = int64
    val (+) : t ‑> t ‑> t

    Addition.

    val (-) : t ‑> t ‑> t

    Subtraction.

    val (~-) : t ‑> t

    Unary negation.

    val (*) : t ‑> t ‑> t

    Multiplication.

    val (/) : t ‑> t ‑> t

    Integer division. Raise Division_by_zero if the second argument is zero. This division rounds the real quotient of its arguments towards zero, as specified for Pervasives.(/).

    val (mod) : t ‑> t ‑> t

    Integer remainder. -If y = 0, x mod y raises Division_by_zero.

    val abs : t ‑> t

    Return the absolute value of its argument.

    val max_int : t

    The greatest representable 64-bit integer, 263 - 1.

    val min_int : t

    The smallest representable 64-bit integer, -263.

    val (land) : t ‑> t ‑> t

    Bitwise logical and.

    val (lor) : t ‑> t ‑> t

    Bitwise logical or.

    val (lxor) : t ‑> t ‑> t

    Bitwise logical exclusive or.

    val (lnot) : t ‑> t

    Bitwise logical negation.

    val (lsl) : t ‑> int ‑> t

    x lsl y shifts x to the left by y bits. +If y = 0, x mod y raises Division_by_zero.

    val abs : t ‑> t

    Return the absolute value of its argument.

    val max_int : t

    The greatest representable 64-bit integer, 263 - 1 = 9_223_372_036_854_775_807.

    val min_int : t

    The smallest representable 64-bit integer, -263 = -9_223_372_036_854_775_808.

    val (land) : t ‑> t ‑> t

    Bitwise logical and.

    val (lor) : t ‑> t ‑> t

    Bitwise logical or.

    val (lxor) : t ‑> t ‑> t

    Bitwise logical exclusive or.

    val (lnot) : t ‑> t

    Bitwise logical negation.

    val (lsl) : t ‑> int ‑> t

    x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 64.

    val (lsr) : t ‑> int ‑> t

    x lsr y shifts x to the right by y bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the sign of x. The result is unspecified if y < 0 or y >= 64.

    val (asr) : t ‑> int ‑> t

    x asr y shifts x to the right by y bits. This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. -The result is unspecified if y < 0 or y >= 64.

    val equal : t ‑> t ‑> bool

    The equal function for int64s. -Same as Pervasives.(=) x y).

    val compare : t ‑> t ‑> int

    The comparison function for 64-bit integers, with the same specification as +The result is unspecified if y < 0 or y >= 64.

    val equal : t ‑> t ‑> bool

    The equal function for 64-bit integers. +Like Pervasives.(=) x y).

    val compare : t ‑> t ‑> int

    The comparison function for 64-bit integers, with the same specification as Pervasives.compare. Along with the type t, this function compare allows the module CCInt64 to be passed as argument to the functors -Set.Make and Map.Make.

    val hash : t ‑> int

    Same as Pervasives.abs (to_int x).

    Conversion

    val to_int : t ‑> int

    Convert the given 64-bit integer (type int64) to an +Set.Make and Map.Make.

    val hash : t ‑> int

    Like Pervasives.abs (to_int x).

    Conversion

    val to_int : t ‑> int

    Convert the given 64-bit integer (type int64) to an integer (type int). On 64-bit platforms, the 64-bit integer is taken modulo 263, i.e. the high-order bit is lost during the conversion. On 32-bit platforms, the 64-bit integer diff --git a/2.0/containers/CCList/Assoc/index.html b/2.0/containers/CCList/Assoc/index.html index fed6c509..7c33af60 100644 --- a/2.0/containers/CCList/Assoc/index.html +++ b/2.0/containers/CCList/Assoc/index.html @@ -1,4 +1,4 @@ -Assoc (containers.CCList.Assoc)

    Module CCList.Assoc

    type ('a, 'b) t = ('a * 'b) list
    val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

    Find the element.

    val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

    Same as get, but unsafe.

    • Raises Not_found: if the element is not present.
    val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

    Add the binding into the list (erase it if already present).

    val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

    mem x l returns true iff x is a key in l.

    • Since: 0.16
    val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    update k ~f l updates l on the key k, by calling f (get l k) +Assoc (containers.CCList.Assoc)

    Module CCList.Assoc

    type ('a, 'b) t = ('a * 'b) list
    val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

    Find the element.

    val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

    Like get, but unsafe.

    • Raises Not_found: if the element is not present.
    val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

    Add the binding into the list (erase it if already present).

    val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

    mem x l returns true iff x is a key in l.

    • Since: 0.16
    val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    update k ~f l updates l on the key k, by calling f (get l k) and removing k if it returns None, mapping k to v' if it returns Some v'.

    • Since: 0.16
    val remove : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    remove x l removes the first occurrence of k from l.

    • Since: 0.17
    \ No newline at end of file diff --git a/2.0/containers/CCList/Infix/index.html b/2.0/containers/CCList/Infix/index.html index 89a2900d..4ede567e 100644 --- a/2.0/containers/CCList/Infix/index.html +++ b/2.0/containers/CCList/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCList.Infix)

    Module CCList.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val (@) : 'a t ‑> 'a t ‑> 'a t
    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    val (--) : int ‑> int ‑> int t
    val (--^) : int ‑> int ‑> int t
    • Since: 0.17
    \ No newline at end of file +Infix (containers.CCList.Infix)

    Module CCList.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    val (@) : 'a t ‑> 'a t ‑> 'a t

    As append. Concatenate two lists.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    fun <*> l is product (fun f x -> f x) funs l.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    As map.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    l >>= f is flat_map f l.

    val (--) : int ‑> int ‑> int t

    Infix alias for range. Bounds included.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'. Second bound excluded.

    • Since: 0.17
    \ No newline at end of file diff --git a/2.0/containers/CCList/Traverse/argument-1-M/index.html b/2.0/containers/CCList/Traverse/argument-1-M/index.html index 52c1255a..07caa0b7 100644 --- a/2.0/containers/CCList/Traverse/argument-1-M/index.html +++ b/2.0/containers/CCList/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -1-M (containers.CCList.Traverse.1-M)

    Parameter CCList.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +1-M (containers.CCList.Traverse.1-M)

    Parameter CCList.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCList/Traverse/index.html b/2.0/containers/CCList/Traverse/index.html index db72b442..5b32801a 100644 --- a/2.0/containers/CCList/Traverse/index.html +++ b/2.0/containers/CCList/Traverse/index.html @@ -1,4 +1,4 @@ -Traverse (containers.CCList.Traverse)

    Module CCList.Traverse

    Parameters

    Signature

    val sequence_m : 'a M.t t ‑> 'a t M.t
    val fold_m : ('b ‑> 'a ‑> 'b M.t) ‑> 'b ‑> 'a t ‑> 'b M.t
    val map_m : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
    val map_m_par : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

    Same as map_m but map_m_par f (x::l) evaluates f x and +Traverse (containers.CCList.Traverse)

    Module CCList.Traverse

    Parameters

    Signature

    val sequence_m : 'a M.t t ‑> 'a t M.t
    val fold_m : ('b ‑> 'a ‑> 'b M.t) ‑> 'b ‑> 'a t ‑> 'b M.t
    val map_m : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
    val map_m_par : ('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

    Like map_m but map_m_par f (x::l) evaluates f x and f l "in parallel" before combining their result (for instance in Lwt).

    \ No newline at end of file diff --git a/2.0/containers/CCList/index.html b/2.0/containers/CCList/index.html index 1e06330b..e99edeaa 100644 --- a/2.0/containers/CCList/index.html +++ b/2.0/containers/CCList/index.html @@ -1,7 +1,7 @@ -CCList (containers.CCList)

    Module CCList

    Complements to list

    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    include module type of List
    val length : 'a list ‑> int
    val compare_lengths : 'a list ‑> 'b list ‑> int
    val compare_length_with : 'a list ‑> int ‑> int
    val cons : 'a ‑> 'a list ‑> 'a list
    val hd : 'a list ‑> 'a
    val tl : 'a list ‑> 'a list
    val nth : 'a list ‑> int ‑> 'a
    val nth_opt : 'a list ‑> int ‑> 'a option
    val rev : 'a list ‑> 'a list
    val append : 'a list ‑> 'a list ‑> 'a list
    val rev_append : 'a list ‑> 'a list ‑> 'a list
    val concat : 'a list list ‑> 'a list
    val flatten : 'a list list ‑> 'a list
    val iter : ('a ‑> unit) ‑> 'a list ‑> unit
    val iteri : (int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
    val map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
    val mapi : (int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
    val rev_map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
    val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b list ‑> 'a
    val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a list ‑> 'b ‑> 'b
    val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val rev_map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val fold_left2 : ('a ‑> 'b ‑> 'c ‑> 'a) ‑> 'a ‑> 'b list ‑> 'c list ‑> 'a
    val fold_right2 : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c ‑> 'c
    val for_all : ('a ‑> bool) ‑> 'a list ‑> bool
    val exists : ('a ‑> bool) ‑> 'a list ‑> bool
    val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val mem : 'a ‑> 'a list ‑> bool
    val memq : 'a ‑> 'a list ‑> bool
    val find : ('a ‑> bool) ‑> 'a list ‑> 'a
    val find_opt : ('a ‑> bool) ‑> 'a list ‑> 'a option
    val filter : ('a ‑> bool) ‑> 'a list ‑> 'a list
    val find_all : ('a ‑> bool) ‑> 'a list ‑> 'a list
    val partition : ('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
    val assoc : 'a ‑> ('a * 'b) list ‑> 'b
    val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val assq : 'a ‑> ('a * 'b) list ‑> 'b
    val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val mem_assoc : 'a ‑> ('a * 'b) list ‑> bool
    val mem_assq : 'a ‑> ('a * 'b) list ‑> bool
    val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val split : ('a * 'b) list ‑> 'a list * 'b list
    val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
    val sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val sort_uniq : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val merge : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
    type 'a t = 'a list
    val empty : 'a t
    val is_empty : _ t ‑> bool

    is_empty l returns true iff l = [].

    • Since: 0.11
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Safe version of List.map.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    • Since: 0.5
    val cons : 'a ‑> 'a t ‑> 'a t

    cons x l is x::l.

    • Since: 0.12
    val append : 'a t ‑> 'a t ‑> 'a t

    Safe version of List.append. +CCList (containers.CCList)

    Module CCList

    Complements to list

    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    include module type of List
    val length : 'a list ‑> int
    val compare_lengths : 'a list ‑> 'b list ‑> int
    val compare_length_with : 'a list ‑> int ‑> int
    val cons : 'a ‑> 'a list ‑> 'a list
    val hd : 'a list ‑> 'a
    val tl : 'a list ‑> 'a list
    val nth : 'a list ‑> int ‑> 'a
    val nth_opt : 'a list ‑> int ‑> 'a option
    val rev : 'a list ‑> 'a list
    val append : 'a list ‑> 'a list ‑> 'a list
    val rev_append : 'a list ‑> 'a list ‑> 'a list
    val concat : 'a list list ‑> 'a list
    val flatten : 'a list list ‑> 'a list
    val iter : ('a ‑> unit) ‑> 'a list ‑> unit
    val iteri : (int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
    val map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
    val mapi : (int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
    val rev_map : ('a ‑> 'b) ‑> 'a list ‑> 'b list
    val fold_left : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b list ‑> 'a
    val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a list ‑> 'b ‑> 'b
    val iter2 : ('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val rev_map2 : ('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val fold_left2 : ('a ‑> 'b ‑> 'c ‑> 'a) ‑> 'a ‑> 'b list ‑> 'c list ‑> 'a
    val fold_right2 : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c ‑> 'c
    val for_all : ('a ‑> bool) ‑> 'a list ‑> bool
    val exists : ('a ‑> bool) ‑> 'a list ‑> bool
    val for_all2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val exists2 : ('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val mem : 'a ‑> 'a list ‑> bool
    val memq : 'a ‑> 'a list ‑> bool
    val find : ('a ‑> bool) ‑> 'a list ‑> 'a
    val find_opt : ('a ‑> bool) ‑> 'a list ‑> 'a option
    val filter : ('a ‑> bool) ‑> 'a list ‑> 'a list
    val find_all : ('a ‑> bool) ‑> 'a list ‑> 'a list
    val partition : ('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
    val assoc : 'a ‑> ('a * 'b) list ‑> 'b
    val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val assq : 'a ‑> ('a * 'b) list ‑> 'b
    val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val mem_assoc : 'a ‑> ('a * 'b) list ‑> bool
    val mem_assq : 'a ‑> ('a * 'b) list ‑> bool
    val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val split : ('a * 'b) list ‑> 'a list * 'b list
    val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
    val sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val stable_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val fast_sort : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val sort_uniq : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val merge : ('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
    type 'a t = 'a list
    val empty : 'a t

    empty is .

    val is_empty : _ t ‑> bool

    is_empty l returns true iff l = [].

    • Since: 0.11
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Safe version of List.map.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    • Since: 0.5
    val cons : 'a ‑> 'a t ‑> 'a t

    cons x l is x::l.

    • Since: 0.12
    val append : 'a t ‑> 'a t ‑> 'a t

    Safe version of List.append. Concatenate two lists.

    val cons_maybe : 'a option ‑> 'a t ‑> 'a t

    cons_maybe (Some x) l is x :: l. -cons_maybe None l is l.

    • Since: 0.13
    val (@) : 'a t ‑> 'a t ‑> 'a t

    Same as append. +cons_maybe None l is l.

    • Since: 0.13
    val (@) : 'a t ‑> 'a t ‑> 'a t

    Like append. Concatenate two lists.

    val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

    Safe version of List.filter. filter p l returns all the elements of the list l that satisfy the predicate p. The order of the elements @@ -44,27 +44,29 @@ will overlap; if offset > n, some elements will not that length g < n, last g is called. If last g = Some g', g' is appended; otherwise g is dropped. If last = CCOpt.return, it will simply keep the last group. -By default, last = fun _ -> None, i.e. the last group is dropped if shorter than n.

  • Raises Invalid_argument: if offset <= 0 or n <= 0.
  • Since: 1.0
val pure : 'a ‑> 'a t

pure = return.

val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

funs <*> l = product (fun f x -> f x) funs l.

val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

(<$>) = map.

val return : 'a ‑> 'a t

return x = x.

val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

l >>= f = flat_map f l.

val take : int ‑> 'a t ‑> 'a t

Take the n first elements, drop the rest.

val drop : int ‑> 'a t ‑> 'a t

Drop the n first elements, keep the rest.

val hd_tl : 'a t ‑> 'a * 'a t

hd_tl (x :: l) returns hd, l.

  • Raises Failure: if the list is empty.
  • Since: 0.16
val take_drop : int ‑> 'a t ‑> 'a t * 'a t

take_drop n l returns l1, l2 such that l1 @ l2 = l and -length l1 = min (length l) n.

val take_while : ('a ‑> bool) ‑> 'a t ‑> 'a t
  • Since: 0.13
val drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t
  • Since: 0.13
val take_drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t * 'a t

take_drop_while p l = take_while p l, drop_while p l.

  • Since: 1.2
val last : int ‑> 'a t ‑> 'a t

last n l takes the last n elements of l (or less if -l doesn't have that many elements.

val head_opt : 'a t ‑> 'a option

First element.

  • Since: 0.20
val last_opt : 'a t ‑> 'a option

Last element.

  • Since: 0.20
val find_pred : ('a ‑> bool) ‑> 'a t ‑> 'a option

find_pred p l finds the first element of l that satisfies p, +By default, last = fun _ -> None, i.e. the last group is dropped if shorter than n.

  • Raises Invalid_argument: if offset <= 0 or n <= 0.
  • Since: 1.0
  • val pure : 'a ‑> 'a t

    pure is return.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    funs <*> l is product (fun f x -> f x) funs l.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    (<$>) = map.

    val return : 'a ‑> 'a t

    return x is x.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    l >>= f is flat_map f l.

    val take : int ‑> 'a t ‑> 'a t

    Take the n first elements, drop the rest.

    val drop : int ‑> 'a t ‑> 'a t

    Drop the n first elements, keep the rest.

    val hd_tl : 'a t ‑> 'a * 'a t

    hd_tl (x :: l) returns hd, l.

    • Raises Failure: if the list is empty.
    • Since: 0.16
    val take_drop : int ‑> 'a t ‑> 'a t * 'a t

    take_drop n l returns l1, l2 such that l1 @ l2 = l and +length l1 = min (length l) n.

    val take_while : ('a ‑> bool) ‑> 'a t ‑> 'a t

    take_while f l returns the longest prefix of l for which f is true.

    • Since: 0.13
    val drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t

    drop_while f l drops the longest prefix of l for which f is true.

    • Since: 0.13
    val take_drop_while : ('a ‑> bool) ‑> 'a t ‑> 'a t * 'a t

    take_drop_while p l = take_while p l, drop_while p l.

    • Since: 1.2
    val last : int ‑> 'a t ‑> 'a t

    last n l takes the last n elements of l (or less if +l doesn't have that many elements.

    val head_opt : 'a t ‑> 'a option

    First element.

    • Since: 0.20
    val tail_opt : 'a t ‑> 'a t option

    Return the given list without its first element.

    • Since: 2.0
    val last_opt : 'a t ‑> 'a option

    Last element.

    • Since: 0.20
    val find_pred : ('a ‑> bool) ‑> 'a t ‑> 'a option

    find_pred p l finds the first element of l that satisfies p, or returns None if no element satisfies p.

    • Since: 0.11
    val find_opt : ('a ‑> bool) ‑> 'a t ‑> 'a option

    Safe version of find.

    • Since: 1.5
    val find_pred_exn : ('a ‑> bool) ‑> 'a t ‑> 'a

    Unsafe version of find_pred.

    • Raises Not_found: if no such element is found.
    • Since: 0.11
    val find_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b option

    find_map f l traverses l, applying f to each element. If for some element x, f x = Some y, then Some y is returned. Otherwise the call returns None.

    • Since: 0.11
    val find_mapi : (int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

    Like find_map, but also pass the index to the predicate function.

    • Since: 0.11
    val find_idx : ('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

    find_idx p x returns Some (i,x) where x is the i-th element of l, -and p x holds. Otherwise returns None.

    val remove : eq:('a ‑> 'a ‑> bool) ‑> x:'a ‑> 'a t ‑> 'a t

    remove ~x l removes every instance of x from l. Tailrec.

    • Parameter eq: equality function.
    • Since: 0.11
    val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

    Map and remove elements at the same time.

    val keep_some : 'a option t ‑> 'a t

    filter_some l retains only elements of the form Some x. -Same as filter_map CCFun.id.

    • Since: 1.3
    val keep_ok : ('a_) Result.result t ‑> 'a t

    keep_ok l retains only elements of the form Ok x.

    • Since: 1.3
    val all_some : 'a option t ‑> 'a t option

    all_some l returns Some l' if all elements of l are of the form Some x, +and p x holds. Otherwise returns None.

    val remove : eq:('a ‑> 'a ‑> bool) ‑> x:'a ‑> 'a t ‑> 'a t

    remove ~x l removes every instance of x from l. Tail-recursive.

    • Parameter eq: equality function.
    • Since: 0.11
    val filter_map : ('a ‑> 'b option) ‑> 'a t ‑> 'b t

    filter_map f l is the sublist of l containing only elements for which +f returns Some e. +Map and remove elements at the same time.

    val keep_some : 'a option t ‑> 'a t

    keep_some l retains only elements of the form Some x. +Like filter_map CCFun.id.

    • Since: 1.3
    val keep_ok : ('a_) Result.result t ‑> 'a t

    keep_ok l retains only elements of the form Ok x.

    • Since: 1.3
    val all_some : 'a option t ‑> 'a t option

    all_some l returns Some l' if all elements of l are of the form Some x, or None otherwise.

    • Since: 1.3
    val all_ok : ('a'err) Result.result t ‑> ('a t'err) Result.result

    all_ok l returns Ok l' if all elements of l are of the form Ok x, -or Error e otherwise (with the first error met).

    • Since: 1.3
    val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    Merges elements from both sorted list.

    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

    Sort the list and remove duplicate elements.

    val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and +or Error e otherwise (with the first error met).

    • Since: 1.3
    val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    Merge elements from both sorted list.

    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

    Sort the list and remove duplicate elements.

    val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and removes duplicates.

    • Since: 0.10
    val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> bool

    is_sorted l returns true iff l is sorted (according to given order).

    • Parameter cmp: the comparison function (default Pervasives.compare).
    • Since: 0.17
    val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?⁠uniq:bool ‑> 'a ‑> 'a list ‑> 'a list

    sorted_insert x l inserts x into l such that, if l was sorted, then sorted_insert x l is sorted too.

    • Parameter uniq: if true and x is already in sorted position in l, then x is not duplicated. Default false (x will be inserted in any case).
    • Since: 0.17
    val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list

    uniq_succ l removes duplicate elements that occur one next to the other. Examples: uniq_succ [1;2;1] = [1;2;1]. uniq_succ [1;1;2] = [1;2].

    • Since: 0.10
    val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list list

    group_succ ~eq l groups together consecutive elements that are equal -according to eq.

    • Since: 0.11

    Indices

    val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

    Same as map, but the function is applied to the index of +according to eq.

    • Since: 0.11

    Indices

    val mapi : (int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

    Like map, but the function is applied to the index of the element as first argument (counting from 0), and the element -itself as second argument.

    val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

    Same as iter, but the function is applied to the index of +itself as second argument.

    val iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

    Like iter, but the function is applied to the index of the element as first argument (counting from 0), and the element -itself as second argument.

    val iteri2 : (int ‑> 'a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit
    • Raises Invalid_argument: when lists do not have the same length.
    • Since: 2.0
    val foldi : ('b ‑> int ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

    Fold on list, with index.

    val foldi2 : ('c ‑> int ‑> 'a ‑> 'b ‑> 'c) ‑> 'c ‑> 'a t ‑> 'b t ‑> 'c

    Fold on two lists, with index.

    • Raises Invalid_argument: when lists do not have the same length.
    • Since: 2.0
    val get_at_idx : int ‑> 'a t ‑> 'a option

    Get by index in the list. +itself as second argument.

    val iteri2 : (int ‑> 'a ‑> 'b ‑> unit) ‑> 'a t ‑> 'b t ‑> unit

    Iter on two lists.

    • Raises Invalid_argument: when lists do not have the same length.
    • Since: 2.0
    val foldi : ('b ‑> int ‑> 'a ‑> 'b) ‑> 'b ‑> 'a t ‑> 'b

    Like fold but it also passes in the index of each element to the folded function.

    val foldi2 : ('c ‑> int ‑> 'a ‑> 'b ‑> 'c) ‑> 'c ‑> 'a t ‑> 'b t ‑> 'c

    Fold on two lists, with index.

    • Raises Invalid_argument: when lists do not have the same length.
    • Since: 2.0
    val get_at_idx : int ‑> 'a t ‑> 'a option

    Get by index in the list. If the index is negative, it will get element starting from the end of the list.

    val nth_opt : 'a t ‑> int ‑> 'a option

    Safe version of nth.

    • Raises Invalid_argument: if the int is negative.
    • Since: 1.5
    val get_at_idx_exn : int ‑> 'a t ‑> 'a

    Get the i-th element, or

    • Raises Not_found: if the index is invalid. If the index is negative, it will get element starting from the end @@ -83,8 +85,8 @@ Complexity is quadratic in the length of the list, but the order of elements is preserved. If you wish for a faster de-duplication but do not care about the order, use sort_uniq.

    val union : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

    List union. Complexity is product of length of inputs.

    val inter : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

    List intersection. Complexity is product of length of inputs.

    Other Constructors

    val range_by : step:int ‑> int ‑> int ‑> int t

    range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. -use a negative step for a decreasing list.

    • Raises Invalid_argument: if step=0.
    • Since: 0.18
    val range : int ‑> int ‑> int t

    range i j iterates on integers from i to j included. It works -both for decreasing and increasing ranges.

    val range' : int ‑> int ‑> int t

    Same as range but the second bound is excluded. -For instance range' 0 5 = [0;1;2;3;4].

    val (--) : int ‑> int ‑> int t

    Infix alias for range.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'.

    • Since: 0.17
    val replicate : int ‑> 'a ‑> 'a t

    Replicate the given element n times.

    val repeat : int ‑> 'a t ‑> 'a t

    Concatenate the list with itself n times.

    Association Lists

    module Assoc : sig ... end
    val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

    Same as Assoc.get_exn.

    • Since: 2.0
    val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

    Same as Assoc.get.

    • Since: 1.5
    val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

    Safe version of assq.

    • Since: 1.5
    val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

    Same as Assoc.mem.

    • Since: 2.0
    val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

    Same as Assoc.remove.

    • Since: 2.0

    References on Lists

    • Since: 0.3.3
    module Ref : sig ... end
    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    val random : 'a random_gen ‑> 'a t random_gen
    val random_non_empty : 'a random_gen ‑> 'a t random_gen
    val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
    val random_choose : 'a t ‑> 'a random_gen

    Randomly choose an element in the list.

    • Raises Not_found: if the list is empty.
    val random_sequence : 'a random_gen t ‑> 'a t random_gen
    val to_seq : 'a t ‑> 'a sequence
    val of_seq : 'a sequence ‑> 'a t
    val to_gen : 'a t ‑> 'a gen
    val of_gen : 'a gen ‑> 'a t
    val to_klist : 'a t ‑> 'a klist
    val of_klist : 'a klist ‑> 'a t

    Infix Operators

    +Use a negative step for a decreasing list.

    • Raises Invalid_argument: if step=0.
    • Since: 0.18
    val range : int ‑> int ‑> int t

    range i j iterates on integers from i to j included. It works +both for decreasing and increasing ranges.

    val range' : int ‑> int ‑> int t

    Like range but the second bound is excluded. +For instance range' 0 5 = [0;1;2;3;4].

    val (--) : int ‑> int ‑> int t

    Infix alias for range.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'.

    • Since: 0.17
    val replicate : int ‑> 'a ‑> 'a t

    Replicate the given element n times.

    val repeat : int ‑> 'a t ‑> 'a t

    Concatenate the list with itself n times.

    Association Lists

    module Assoc : sig ... end
    val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

    Like Assoc.get_exn.

    • Since: 2.0
    val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

    Like Assoc.get.

    • Since: 1.5
    val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

    Safe version of assq.

    • Since: 1.5
    val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

    Like Assoc.mem.

    • Since: 2.0
    val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

    Like Assoc.remove.

    • Since: 2.0

    References on Lists

    • Since: 0.3.3
    module Ref : sig ... end
    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    val random : 'a random_gen ‑> 'a t random_gen
    val random_non_empty : 'a random_gen ‑> 'a t random_gen
    val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
    val random_choose : 'a t ‑> 'a random_gen

    Randomly choose an element in the list.

    • Raises Not_found: if the list is empty.
    val random_sequence : 'a random_gen t ‑> 'a t random_gen
    val to_seq : 'a t ‑> 'a sequence

    Return a sequence of the elements of the list.

    val of_seq : 'a sequence ‑> 'a t

    Build a list from a given sequence.

    val to_gen : 'a t ‑> 'a gen

    Return a gen of the elements of the list.

    val of_gen : 'a gen ‑> 'a t

    Build a list from a given gen.

    val to_klist : 'a t ‑> 'a klist

    Return a klist of the elements of the list.

    val of_klist : 'a klist ‑> 'a t

    Build a list from a given klist.

    Infix Operators

    It is convenient to open CCList.Infix to access the infix operators -without cluttering the scope too much.

    • Since: 0.16
    module Infix : sig ... end

    IO

    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer

    Lists of pairs

    \ No newline at end of file +without cluttering the scope too much.

    • Since: 0.16
    module Infix : sig ... end

    IO

    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer

    Print the contents of a list.

    Lists of pairs

    \ No newline at end of file diff --git a/2.0/containers/CCList/module-type-MONAD/index.html b/2.0/containers/CCList/module-type-MONAD/index.html index 4f5d29ec..732eec61 100644 --- a/2.0/containers/CCList/module-type-MONAD/index.html +++ b/2.0/containers/CCList/module-type-MONAD/index.html @@ -1,2 +1,2 @@ -MONAD (containers.CCList.MONAD)

    Module type CCList.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +MONAD (containers.CCList.MONAD)

    Module type CCList.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/Assoc/index.html b/2.0/containers/CCListLabels/Assoc/index.html index 1a823796..03850fd6 100644 --- a/2.0/containers/CCListLabels/Assoc/index.html +++ b/2.0/containers/CCListLabels/Assoc/index.html @@ -1,4 +1,4 @@ -Assoc (containers.CCListLabels.Assoc)

    Module CCListLabels.Assoc

    type ('a, 'b) t = ('a * 'b) list
    val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

    Find the element.

    val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

    Same as get, but unsafe.

    • Raises Not_found: if the element is not present.
    val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

    Add the binding into the list (erase it if already present).

    val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

    mem x l returns true iff x is a key in l.

    • Since: 0.16
    val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    update k ~f l updates l on the key k, by calling f (get l k) +Assoc (containers.CCListLabels.Assoc)

    Module CCListLabels.Assoc

    type ('a, 'b) t = ('a * 'b) list
    val get : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b option

    Find the element.

    val get_exn : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> 'b

    Like get, but unsafe.

    • Raises Not_found: if the element is not present.
    val set : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> 'b ‑> ('a'bt ‑> ('a'bt

    Add the binding into the list (erase it if already present).

    val mem : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

    mem x l returns true iff x is a key in l.

    • Since: 0.16
    val update : eq:('a ‑> 'a ‑> bool) ‑> f:('b option ‑> 'b option) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    update k ~f l updates l on the key k, by calling f (get l k) and removing k if it returns None, mapping k to v' if it returns Some v'.

    • Since: 0.16
    val remove : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a'bt ‑> ('a'bt

    remove x l removes the first occurrence of k from l.

    • Since: 0.17
    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/Infix/index.html b/2.0/containers/CCListLabels/Infix/index.html index 1e7b32d9..db928795 100644 --- a/2.0/containers/CCListLabels/Infix/index.html +++ b/2.0/containers/CCListLabels/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCListLabels.Infix)

    Module CCListLabels.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val (@) : 'a t ‑> 'a t ‑> 'a t
    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    val (--) : int ‑> int ‑> int t
    val (--^) : int ‑> int ‑> int t
    • Since: 0.17
    \ No newline at end of file +Infix (containers.CCListLabels.Infix)

    Module CCListLabels.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    val (@) : 'a t ‑> 'a t ‑> 'a t

    As append. Concatenate two lists.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    fun <*> l is product (fun f x -> f x) funs l.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    As map.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    l >>= f is flat_map f l.

    val (--) : int ‑> int ‑> int t

    Infix alias for range. Bounds included.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'. Second bound excluded.

    • Since: 0.17
    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html b/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html index a48aa782..4d3ab9eb 100644 --- a/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html +++ b/2.0/containers/CCListLabels/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -1-M (containers.CCListLabels.Traverse.1-M)

    Parameter CCListLabels.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +1-M (containers.CCListLabels.Traverse.1-M)

    Parameter CCListLabels.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/Traverse/index.html b/2.0/containers/CCListLabels/Traverse/index.html index 2c250e0c..e8fbf9d2 100644 --- a/2.0/containers/CCListLabels/Traverse/index.html +++ b/2.0/containers/CCListLabels/Traverse/index.html @@ -1,4 +1,4 @@ -Traverse (containers.CCListLabels.Traverse)

    Module CCListLabels.Traverse

    Parameters

    Signature

    val sequence_m : 'a M.t t ‑> 'a t M.t
    val fold_m : f:('b ‑> 'a ‑> 'b M.t) ‑> init:'b ‑> 'a t ‑> 'b M.t
    val map_m : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
    val map_m_par : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

    Same as map_m but map_m_par f (x::l) evaluates f x and +Traverse (containers.CCListLabels.Traverse)

    Module CCListLabels.Traverse

    Parameters

    Signature

    val sequence_m : 'a M.t t ‑> 'a t M.t
    val fold_m : f:('b ‑> 'a ‑> 'b M.t) ‑> init:'b ‑> 'a t ‑> 'b M.t
    val map_m : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t
    val map_m_par : f:('a ‑> 'b M.t) ‑> 'a t ‑> 'b t M.t

    Like map_m but map_m_par f (x::l) evaluates f x and f l "in parallel" before combining their result (for instance in Lwt).

    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/index.html b/2.0/containers/CCListLabels/index.html index 4348f8f0..ad99f74d 100644 --- a/2.0/containers/CCListLabels/index.html +++ b/2.0/containers/CCListLabels/index.html @@ -1,33 +1,40 @@ -CCListLabels (containers.CCListLabels)

    Module CCListLabels

    Complements to list

    include module type of ListLabels
    val length : 'a list ‑> int
    val hd : 'a list ‑> 'a
    val compare_lengths : 'a list ‑> 'b list ‑> int
    val compare_length_with : 'a list ‑> len:int ‑> int
    val cons : 'a ‑> 'a list ‑> 'a list
    val tl : 'a list ‑> 'a list
    val nth : 'a list ‑> int ‑> 'a
    val nth_opt : 'a list ‑> int ‑> 'a option
    val rev : 'a list ‑> 'a list
    val append : 'a list ‑> 'a list ‑> 'a list
    val rev_append : 'a list ‑> 'a list ‑> 'a list
    val concat : 'a list list ‑> 'a list
    val flatten : 'a list list ‑> 'a list
    val iter : f:('a ‑> unit) ‑> 'a list ‑> unit
    val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
    val map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
    val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
    val rev_map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
    val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'a
    val fold_right : f:('a ‑> 'b ‑> 'b) ‑> 'a list ‑> init:'b ‑> 'b
    val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
    val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val rev_map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val fold_left2 : f:('a ‑> 'b ‑> 'c ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'c list ‑> 'a
    val fold_right2 : f:('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> init:'c ‑> 'c
    val for_all : f:('a ‑> bool) ‑> 'a list ‑> bool
    val exists : f:('a ‑> bool) ‑> 'a list ‑> bool
    val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val mem : 'a ‑> set:'a list ‑> bool
    val memq : 'a ‑> set:'a list ‑> bool
    val find : f:('a ‑> bool) ‑> 'a list ‑> 'a
    val find_opt : f:('a ‑> bool) ‑> 'a list ‑> 'a option
    val filter : f:('a ‑> bool) ‑> 'a list ‑> 'a list
    val find_all : f:('a ‑> bool) ‑> 'a list ‑> 'a list
    val partition : f:('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
    val assoc : 'a ‑> ('a * 'b) list ‑> 'b
    val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val assq : 'a ‑> ('a * 'b) list ‑> 'b
    val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val mem_assoc : 'a ‑> map:('a * 'b) list ‑> bool
    val mem_assq : 'a ‑> map:('a * 'b) list ‑> bool
    val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val split : ('a * 'b) list ‑> 'a list * 'b list
    val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
    val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
    type 'a t = 'a list
    val empty : 'a t
    val is_empty : _ t ‑> bool

    is_empty l returns true iff l = [].

    • Since: 0.11
    val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

    Safe version of List.map.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    • Since: 0.5
    val cons : 'a ‑> 'a t ‑> 'a t

    cons x l is x::l.

    • Since: 0.12
    val append : 'a t ‑> 'a t ‑> 'a t

    Safe version of List.append. +CCListLabels (containers.CCListLabels)

    Module CCListLabels

    Complements to list

    include module type of ListLabels
    val length : 'a list ‑> int
    val hd : 'a list ‑> 'a
    val compare_lengths : 'a list ‑> 'b list ‑> int
    val compare_length_with : 'a list ‑> len:int ‑> int
    val cons : 'a ‑> 'a list ‑> 'a list
    val tl : 'a list ‑> 'a list
    val nth : 'a list ‑> int ‑> 'a
    val nth_opt : 'a list ‑> int ‑> 'a option
    val rev : 'a list ‑> 'a list
    val append : 'a list ‑> 'a list ‑> 'a list
    val rev_append : 'a list ‑> 'a list ‑> 'a list
    val concat : 'a list list ‑> 'a list
    val flatten : 'a list list ‑> 'a list
    val iter : f:('a ‑> unit) ‑> 'a list ‑> unit
    val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a list ‑> unit
    val map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
    val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a list ‑> 'b list
    val rev_map : f:('a ‑> 'b) ‑> 'a list ‑> 'b list
    val fold_left : f:('a ‑> 'b ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'a
    val fold_right : f:('a ‑> 'b ‑> 'b) ‑> 'a list ‑> init:'b ‑> 'b
    val iter2 : f:('a ‑> 'b ‑> unit) ‑> 'a list ‑> 'b list ‑> unit
    val map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val rev_map2 : f:('a ‑> 'b ‑> 'c) ‑> 'a list ‑> 'b list ‑> 'c list
    val fold_left2 : f:('a ‑> 'b ‑> 'c ‑> 'a) ‑> init:'a ‑> 'b list ‑> 'c list ‑> 'a
    val fold_right2 : f:('a ‑> 'b ‑> 'c ‑> 'c) ‑> 'a list ‑> 'b list ‑> init:'c ‑> 'c
    val for_all : f:('a ‑> bool) ‑> 'a list ‑> bool
    val exists : f:('a ‑> bool) ‑> 'a list ‑> bool
    val for_all2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val exists2 : f:('a ‑> 'b ‑> bool) ‑> 'a list ‑> 'b list ‑> bool
    val mem : 'a ‑> set:'a list ‑> bool
    val memq : 'a ‑> set:'a list ‑> bool
    val find : f:('a ‑> bool) ‑> 'a list ‑> 'a
    val find_opt : f:('a ‑> bool) ‑> 'a list ‑> 'a option
    val filter : f:('a ‑> bool) ‑> 'a list ‑> 'a list
    val find_all : f:('a ‑> bool) ‑> 'a list ‑> 'a list
    val partition : f:('a ‑> bool) ‑> 'a list ‑> 'a list * 'a list
    val assoc : 'a ‑> ('a * 'b) list ‑> 'b
    val assoc_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val assq : 'a ‑> ('a * 'b) list ‑> 'b
    val assq_opt : 'a ‑> ('a * 'b) list ‑> 'b option
    val mem_assoc : 'a ‑> map:('a * 'b) list ‑> bool
    val mem_assq : 'a ‑> map:('a * 'b) list ‑> bool
    val remove_assoc : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val remove_assq : 'a ‑> ('a * 'b) list ‑> ('a * 'b) list
    val split : ('a * 'b) list ‑> 'a list * 'b list
    val combine : 'a list ‑> 'b list ‑> ('a * 'b) list
    val sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val stable_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val fast_sort : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list
    val merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list
    type 'a t = 'a list
    val empty : 'a t

    empty is .

    val is_empty : _ t ‑> bool

    is_empty l returns true iff l = [].

    • Since: 0.11
    val map : f:('a ‑> 'b) ‑> 'a t ‑> 'b t

    Safe version of List.map.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map with reversed arguments.

    • Since: 0.5
    val cons : 'a ‑> 'a t ‑> 'a t

    cons x l is x::l.

    • Since: 0.12
    val append : 'a t ‑> 'a t ‑> 'a t

    Safe version of List.append. Concatenate two lists.

    val cons_maybe : 'a option ‑> 'a t ‑> 'a t

    cons_maybe (Some x) l is x :: l. -cons_maybe None l is l.

    • Since: 0.13
    val (@) : 'a t ‑> 'a t ‑> 'a t

    Same as append. -Concatenate two lists.

    val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

    Safe version of List.filter.

    val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b

    Safe version of fold_right.

    val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'a

    Fold until a stop condition via ('a, `Stop) is -indicated by the accumulator.

    • Since: 0.8
    val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

    fold_map f acc l is a fold_left-like function, but it also maps the -list to another list.

    • Since: 0.14
    val fold_map2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> init:'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c list

    fold_map2 is to fold_map what List.map2 is to List.map.

    • Raises Invalid_argument: if the lists do not have the same length.
    • Since: 0.16
    val fold_filter_map : f:('acc ‑> 'a ‑> 'acc * 'b option) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

    fold_filter_map f acc l is a fold_left-like function, but also +cons_maybe None l is l.

    • Since: 0.13
    val (@) : 'a t ‑> 'a t ‑> 'a t

    Like append. +Concatenate two lists.

    val filter : f:('a ‑> bool) ‑> 'a t ‑> 'a t

    Safe version of List.filter. +filter p l returns all the elements of the list l +that satisfy the predicate p. The order of the elements +in the input list is preserved.

    val fold_right : ('a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b

    Safe version of fold_right. +fold_right f [a1; ...; an] b is +f a1 (f a2 (... (f an b) ...)). Not tail-recursive.

    val fold_while : f:('a ‑> 'b ‑> 'a * [ `Stop | `Continue ]) ‑> init:'a ‑> 'b t ‑> 'a

    Fold until a stop condition via ('a, `Stop) is +indicated by the accumulator.

    • Since: 0.8
    val fold_map : f:('acc ‑> 'a ‑> 'acc * 'b) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

    fold_map ~f ~init l is a fold_left-like function, but it also maps the +list to another list.

    • Since: 0.14
    val fold_map2 : f:('acc ‑> 'a ‑> 'b ‑> 'acc * 'c) ‑> init:'acc ‑> 'a list ‑> 'b list ‑> 'acc * 'c list

    fold_map2 is to fold_map what List.map2 is to List.map.

    • Raises Invalid_argument: if the lists do not have the same length.
    • Since: 0.16
    val fold_filter_map : f:('acc ‑> 'a ‑> 'acc * 'b option) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

    fold_filter_map ~f ~init l is a fold_left-like function, but also generates a list of output in a way similar to filter_map.

    • Since: 0.17
    val fold_flat_map : f:('acc ‑> 'a ‑> 'acc * 'b list) ‑> init:'acc ‑> 'a list ‑> 'acc * 'b list

    fold_flat_map f acc l is a fold_left-like function, but it also maps the -list to a list of lists that is then flatten'd.

    • Since: 0.14
    val init : int ‑> f:(int ‑> 'a) ‑> 'a t

    init len f is f 0; f 1; ...; f (len-1).

    • Raises Invalid_argument: if len < 0.
    • Since: 0.6
    val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
    val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
    val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b t

    Map and flatten at the same time (safe). Evaluation order is not guaranteed.

    val flatten : 'a t t ‑> 'a t

    Safe flatten. Concatenate a list of lists.

    val product : f:('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

    Cartesian product of the two lists, with the given combinator.

    val fold_product : f:('c ‑> 'a ‑> 'b ‑> 'c) ‑> init:'c ‑> 'a t ‑> 'b t ‑> 'c

    Fold on the cartesian product.

    val diagonal : 'a t ‑> ('a * 'a) t

    All pairs of distinct positions of the list. list_diagonal l will -return the list of List.nth i l, List.nth j l if i < j.

    val partition_map : f:('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c list

    partition_map f l maps f on l and gather results in lists: +list to a list of lists that is then flatten'd.

    • Since: 0.14
    val init : int ‑> f:(int ‑> 'a) ‑> 'a t

    init len ~f is f 0; f 1; ...; f (len-1).

    • Raises Invalid_argument: if len < 0.
    • Since: 0.6
    val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
    val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
    val flat_map : f:('a ‑> 'b t) ‑> 'a t ‑> 'b t

    Map and flatten at the same time (safe). Evaluation order is not guaranteed.

    val flatten : 'a t t ‑> 'a t

    Safe flatten. Concatenate a list of lists.

    val product : f:('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

    Cartesian product of the two lists, with the given combinator.

    val fold_product : f:('c ‑> 'a ‑> 'b ‑> 'c) ‑> init:'c ‑> 'a t ‑> 'b t ‑> 'c

    Fold on the cartesian product.

    val diagonal : 'a t ‑> ('a * 'a) t

    All pairs of distinct positions of the list. list_diagonal l will +return the list of List.nth i l, List.nth j l if i < j.

    val partition_map : f:('a ‑> [< `Left of 'b | `Right of 'c | `Drop ]) ‑> 'a list ‑> 'b list * 'c list

    partition_map ~f l maps f on l and gather results in lists:

    • if f x = `Left y, adds y to the first list.
    • if f x = `Right z, adds z to the second list.
    • if f x = `Drop, ignores x.
    • Since: 0.11
    val sublists_of_len : ?⁠last:('a list ‑> 'a list option) ‑> ?⁠offset:int ‑> len:int ‑> 'a list ‑> 'a list list

    sublists_of_len n l returns sub-lists of l that have length n. By default, these sub-lists are non overlapping: -sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].

    See CCList.sublists_of_len for more details.

    • Since: 1.5
    val pure : 'a ‑> 'a t

    pure = return.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    funs <*> l = product fun f x -> f x) funs l.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    (<$>) = map.

    val return : 'a ‑> 'a t

    return x = x.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    l >>= f = flat_map f l.

    val take : int ‑> 'a t ‑> 'a t

    Take the n first elements, drop the rest.

    val drop : int ‑> 'a t ‑> 'a t

    Drop the n first elements, keep the rest.

    val hd_tl : 'a t ‑> 'a * 'a t

    hd_tl (x :: l) returns hd, l.

    • Raises Failure: if the list is empty.
    • Since: 0.16
    val take_drop : int ‑> 'a t ‑> 'a t * 'a t

    take_drop n l returns l1, l2 such that l1 @ l2 = l and -length l1 = min (length l) n.

    val take_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t
    • Since: 0.13
    val drop_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t
    • Since: 0.13
    val last : int ‑> 'a t ‑> 'a t

    last n l takes the last n elements of l (or less if -l doesn't have that many elements.

    val head_opt : 'a t ‑> 'a option

    First element.

    • Since: 0.20
    val last_opt : 'a t ‑> 'a option

    Last element.

    • Since: 0.20
    val find_pred : f:('a ‑> bool) ‑> 'a t ‑> 'a option

    find_pred p l finds the first element of l that satisfies p, -or returns None if no element satisfies p.

    • Since: 0.11
    val find_pred_exn : f:('a ‑> bool) ‑> 'a t ‑> 'a

    Unsafe version of find_pred.

    • Raises Not_found: if no such element is found.
    • Since: 0.11
    val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b option

    find_map f l traverses l, applying f to each element. If for +sublists_of_len 2 [1;2;3;4;5;6] returns [1;2]; [3;4]; [5;6].

    See CCList.sublists_of_len for more details.

    • Since: 1.5
    val pure : 'a ‑> 'a t

    pure is return.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    funs <*> l is product fun f x -> f x) funs l.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    (<$>) is map.

    val return : 'a ‑> 'a t

    return x is x.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    l >>= f is flat_map f l.

    val take : int ‑> 'a t ‑> 'a t

    Take the n first elements, drop the rest.

    val drop : int ‑> 'a t ‑> 'a t

    Drop the n first elements, keep the rest.

    val hd_tl : 'a t ‑> 'a * 'a t

    hd_tl (x :: l) returns hd, l.

    • Raises Failure: if the list is empty.
    • Since: 0.16
    val take_drop : int ‑> 'a t ‑> 'a t * 'a t

    take_drop n l returns l1, l2 such that l1 @ l2 = l and +length l1 = min (length l) n.

    val take_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t

    take_while ~f l returns the longest prefix of l for which f is true.

    • Since: 0.13
    val drop_while : f:('a ‑> bool) ‑> 'a t ‑> 'a t

    drop_while ~f l drops the longest prefix of l for which f is true.

    • Since: 0.13
    val last : int ‑> 'a t ‑> 'a t

    last n l takes the last n elements of l (or less if +l doesn't have that many elements.

    val head_opt : 'a t ‑> 'a option

    First element.

    • Since: 0.20
    val tail_opt : 'a t ‑> 'a t option

    Return the given list without its first element.

    • Since: 2.0
    val last_opt : 'a t ‑> 'a option

    Last element.

    • Since: 0.20
    val find_pred : f:('a ‑> bool) ‑> 'a t ‑> 'a option

    find_pred p l finds the first element of l that satisfies p, +or returns None if no element satisfies p.

    • Since: 0.11
    val find_pred_exn : f:('a ‑> bool) ‑> 'a t ‑> 'a

    Unsafe version of find_pred.

    • Raises Not_found: if no such element is found.
    • Since: 0.11
    val find_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b option

    find_map ~f l traverses l, applying f to each element. If for some element x, f x = Some y, then Some y is returned. Otherwise the call returns None.

    • Since: 0.11
    val find_mapi : f:(int ‑> 'a ‑> 'b option) ‑> 'a t ‑> 'b option

    Like find_map, but also pass the index to the predicate function.

    • Since: 0.11
    val find_idx : f:('a ‑> bool) ‑> 'a t ‑> (int * 'a) option

    find_idx p x returns Some (i,x) where x is the i-th element of l, -and p x holds. Otherwise returns None.

    val remove : eq:('a ‑> 'a ‑> bool) ‑> key:'a ‑> 'a t ‑> 'a t

    remove ~key l removes every instance of key from l. Tailrec.

    • Parameter eq: equality function.
    • Since: 0.11
    val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

    Map and remove elements at the same time.

    val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    Merges elements from both sorted list.

    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

    Sort the list and remove duplicate elements.

    val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and +and p x holds. Otherwise returns None.

    val remove : eq:('a ‑> 'a ‑> bool) ‑> key:'a ‑> 'a t ‑> 'a t

    remove ~key l removes every instance of key from l. Tail-recursive.

    • Parameter eq: equality function.
    • Since: 0.11
    val filter_map : f:('a ‑> 'b option) ‑> 'a t ‑> 'b t

    filter_map ~f l is the sublist of l containing only elements for which +f returns Some e. +Map and remove elements at the same time.

    val sorted_merge : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    Merges elements from both sorted list.

    val sort_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list

    Sort the list and remove duplicate elements.

    val sorted_merge_uniq : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> 'a list ‑> 'a list

    sorted_merge_uniq l1 l2 merges the sorted lists l1 and l2 and removes duplicates.

    • Since: 0.10
    val is_sorted : cmp:('a ‑> 'a ‑> int) ‑> 'a list ‑> bool

    is_sorted l returns true iff l is sorted (according to given order).

    • Parameter cmp: the comparison function (default Pervasives.compare).
    • Since: 0.17
    val sorted_insert : cmp:('a ‑> 'a ‑> int) ‑> ?⁠uniq:bool ‑> 'a ‑> 'a list ‑> 'a list

    sorted_insert x l inserts x into l such that, if l was sorted, then sorted_insert x l is sorted too.

    • Parameter uniq: if true and x is already in sorted position in l, then x is not duplicated. Default false (x will be inserted in any case).
    • Since: 0.17
    val uniq_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list

    uniq_succ l removes duplicate elements that occur one next to the other. Examples: uniq_succ [1;2;1] = [1;2;1]. uniq_succ [1;1;2] = [1;2].

    • Since: 0.10
    val group_succ : eq:('a ‑> 'a ‑> bool) ‑> 'a list ‑> 'a list list

    group_succ ~eq l groups together consecutive elements that are equal -according to eq.

    • Since: 0.11

    Indices

    val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

    Same as map, but the function is applied to the index of +according to eq.

    • Since: 0.11

    Indices

    val mapi : f:(int ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b t

    Like map, but the function is applied to the index of the element as first argument (counting from 0), and the element -itself as second argument.

    val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

    Same as iter, but the function is applied to the index of +itself as second argument.

    val iteri : f:(int ‑> 'a ‑> unit) ‑> 'a t ‑> unit

    Like iter, but the function is applied to the index of the element as first argument (counting from 0), and the element -itself as second argument.

    val foldi : f:('b ‑> int ‑> 'a ‑> 'b) ‑> init:'b ‑> 'a t ‑> 'b

    Fold on list, with index.

    val get_at_idx : int ‑> 'a t ‑> 'a option

    Get by index in the list. +itself as second argument.

    val foldi : f:('b ‑> int ‑> 'a ‑> 'b) ‑> init:'b ‑> 'a t ‑> 'b

    Like fold but it also passes in the index of each element to the folded function.

    val get_at_idx : int ‑> 'a t ‑> 'a option

    Get by index in the list. If the index is negative, it will get element starting from the end of the list.

    val get_at_idx_exn : int ‑> 'a t ‑> 'a

    Get the i-th element, or

    • Raises Not_found: if the index is invalid. If the index is negative, it will get element starting from the end @@ -47,7 +54,7 @@ of elements is preserved. If you wish for a faster de-duplication but do not care about the order, use sort_uniq.

    val union : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

    List union. Complexity is product of length of inputs.

    val inter : eq:('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> 'a t

    List intersection. Complexity is product of length of inputs.

    Other Constructors

    val range_by : step:int ‑> int ‑> int ‑> int t

    range_by ~step i j iterates on integers from i to j included, where the difference between successive elements is step. use a negative step for a decreasing list.

    • Raises Invalid_argument: if step=0.
    • Since: 0.18
    val range : int ‑> int ‑> int t

    range i j iterates on integers from i to j included. It works -both for decreasing and increasing ranges.

    val range' : int ‑> int ‑> int t

    Same as range but the second bound is excluded. -For instance range' 0 5 = [0;1;2;3;4].

    val (--) : int ‑> int ‑> int t

    Infix alias for range.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'.

    • Since: 0.17
    val replicate : int ‑> 'a ‑> 'a t

    Replicate the given element n times.

    val repeat : int ‑> 'a t ‑> 'a t

    Concatenate the list with itself n times.

    Association Lists

    module Assoc : sig ... end
    val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

    Same as Assoc.get_exn.

    • Since: 2.0
    val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

    Same as Assoc.get.

    • Since: 2.0
    val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

    Safe version of assq.

    • Since: 2.0
    val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

    Same as Assoc.mem.

    • Since: 2.0
    val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

    Same as Assoc.remove.

    • Since: 2.0

    References on Lists

    • Since: 0.3.3
    module Ref : sig ... end
    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    val random : 'a random_gen ‑> 'a t random_gen
    val random_non_empty : 'a random_gen ‑> 'a t random_gen
    val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
    val random_choose : 'a t ‑> 'a random_gen

    Randomly choose an element in the list.

    • Raises Not_found: if the list is empty.
    val random_sequence : 'a random_gen t ‑> 'a t random_gen
    val to_seq : 'a t ‑> 'a sequence
    val of_seq : 'a sequence ‑> 'a t
    val to_gen : 'a t ‑> 'a gen
    val of_gen : 'a gen ‑> 'a t
    val to_klist : 'a t ‑> 'a klist
    val of_klist : 'a klist ‑> 'a t

    Infix Operators

    +both for decreasing and increasing ranges.

    val range' : int ‑> int ‑> int t

    Like range but the second bound is excluded. +For instance range' 0 5 = [0;1;2;3;4].

    val (--) : int ‑> int ‑> int t

    Infix alias for range.

    val (--^) : int ‑> int ‑> int t

    Infix alias for range'.

    • Since: 0.17
    val replicate : int ‑> 'a ‑> 'a t

    Replicate the given element n times.

    val repeat : int ‑> 'a t ‑> 'a t

    Concatenate the list with itself n times.

    Association Lists

    module Assoc : sig ... end
    val assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b

    Like Assoc.get_exn.

    • Since: 2.0
    val assoc_opt : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> 'b option

    Like Assoc.get.

    • Since: 2.0
    val assq_opt : 'a ‑> ('a * 'b) t ‑> 'b option

    Safe version of assq.

    • Since: 2.0
    val mem_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * _) t ‑> bool

    Like Assoc.mem.

    • Since: 2.0
    val remove_assoc : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a * 'b) t ‑> ('a * 'b) t

    Like Assoc.remove.

    • Since: 2.0

    References on Lists

    • Since: 0.3.3
    module Ref : sig ... end
    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    val random : 'a random_gen ‑> 'a t random_gen
    val random_non_empty : 'a random_gen ‑> 'a t random_gen
    val random_len : int ‑> 'a random_gen ‑> 'a t random_gen
    val random_choose : 'a t ‑> 'a random_gen

    Randomly choose an element in the list.

    • Raises Not_found: if the list is empty.
    val random_sequence : 'a random_gen t ‑> 'a t random_gen
    val to_seq : 'a t ‑> 'a sequence

    Return a sequence of the elements of the list.

    val of_seq : 'a sequence ‑> 'a t

    Build a list from a given sequence.

    val to_gen : 'a t ‑> 'a gen

    Return a gen of the elements of the list.

    val of_gen : 'a gen ‑> 'a t

    Build a list from a given gen.

    val to_klist : 'a t ‑> 'a klist

    Return a klist of the elements of the list.

    val of_klist : 'a klist ‑> 'a t

    Build a list from a given klist.

    Infix Operators

    It is convenient to open CCList.Infix to access the infix operators -without cluttering the scope too much.

    • Since: 0.16
    module Infix : sig ... end

    IO

    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer
    \ No newline at end of file +without cluttering the scope too much.

    • Since: 0.16
    module Infix : sig ... end

    IO

    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> 'a t printer

    Print the contents of a list.

    \ No newline at end of file diff --git a/2.0/containers/CCListLabels/module-type-MONAD/index.html b/2.0/containers/CCListLabels/module-type-MONAD/index.html index 06c4ef62..c74a4bba 100644 --- a/2.0/containers/CCListLabels/module-type-MONAD/index.html +++ b/2.0/containers/CCListLabels/module-type-MONAD/index.html @@ -1,2 +1,2 @@ -MONAD (containers.CCListLabels.MONAD)

    Module type CCListLabels.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +MONAD (containers.CCListLabels.MONAD)

    Module type CCListLabels.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCMap/module-type-S/index.html b/2.0/containers/CCMap/module-type-S/index.html index 782d2cc7..258d9afa 100644 --- a/2.0/containers/CCMap/module-type-S/index.html +++ b/2.0/containers/CCMap/module-type-S/index.html @@ -4,7 +4,7 @@ and returns default otherwise (if k otherwise it calls f None. In any case, if the result is Nonek is removed from m, and if the result is Some v' then add k v' m is returned.

    val choose_opt : 'a t ‑> (key * 'a) option

    Safe version of choose.

    • Since: 1.5
    val min_binding_opt : 'a t ‑> (key * 'a) option

    Safe version of min_binding.

    • Since: 1.5
    val max_binding_opt : 'a t ‑> (key * 'a) option

    Safe version of max_binding.

    • Since: 1.5
    val find_opt : key ‑> 'a t ‑> 'a option

    Safe version of find.

    • Since: 1.5
    val find_first : (key ‑> bool) ‑> 'a t ‑> key * 'a

    Find smallest binding satisfying the monotonic predicate. See Map.S.find_first.

    • Since: 1.5
    val find_first_opt : (key ‑> bool) ‑> 'a t ‑> (key * 'a) option

    Safe version of find_first.

    • Since: 1.5
    val merge_safe : f:(key ‑> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] ‑> 'c option) ‑> 'a t ‑> 'b t ‑> 'c t

    merge_safe ~f a b merges the maps a and b together.

    • Since: 0.17
    val union : (key ‑> 'a ‑> 'a ‑> 'a option) ‑> 'a t ‑> 'a t ‑> 'a t

    Union of both maps, using the function to combine bindings -that belong to both inputs.

    • Since: 1.4
    val of_seq : (key * 'a) sequence ‑> 'a t

    Same as of_list.

    val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
    • Since: 0.14
    val to_seq : 'a t ‑> (key * 'a) sequence
    val of_list : (key * 'a) list ‑> 'a t

    Build a map from the given list of bindings k_i -> v_i, +that belong to both inputs.

    • Since: 1.4
    val of_seq : (key * 'a) sequence ‑> 'a t

    Like of_list.

    val add_seq : 'a t ‑> (key * 'a) sequence ‑> 'a t
    • Since: 0.14
    val to_seq : 'a t ‑> (key * 'a) sequence
    val of_list : (key * 'a) list ‑> 'a t

    Build a map from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, only its last binding will be present in the result.

    val add_list : 'a t ‑> (key * 'a) list ‑> 'a t
    • Since: 0.14
    val keys : _ t ‑> key sequence

    Iterate on keys only.

    • Since: 0.15
    val values : 'a t ‑> 'a sequence

    Iterate on values only.

    • Since: 0.15
    val to_list : 'a t ‑> (key * 'a) list
    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠arrow:string ‑> ?⁠sep:string ‑> key printer ‑> 'a printer ‑> 'a t printer
    \ No newline at end of file diff --git a/2.0/containers/CCOpt/Infix/index.html b/2.0/containers/CCOpt/Infix/index.html index da6d4f4f..ef52846b 100644 --- a/2.0/containers/CCOpt/Infix/index.html +++ b/2.0/containers/CCOpt/Infix/index.html @@ -1,2 +1,2 @@ -Infix (containers.CCOpt.Infix)

    Module CCOpt.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t
    val (<+>) : 'a t ‑> 'a t ‑> 'a t
    \ No newline at end of file +Infix (containers.CCOpt.Infix)

    Module CCOpt.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    x >|= f is map f x.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    f <$> (Some x) returns Some (f x) and f <$> None returns None.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Like map.

    val (<+>) : 'a t ‑> 'a t ‑> 'a t

    a <+> b is a if a is Some _, b otherwise.

    \ No newline at end of file diff --git a/2.0/containers/CCOpt/index.html b/2.0/containers/CCOpt/index.html index e55fd1b9..851cd7dc 100644 --- a/2.0/containers/CCOpt/index.html +++ b/2.0/containers/CCOpt/index.html @@ -1,9 +1,10 @@ -CCOpt (containers.CCOpt)

    Module CCOpt

    Options

    type +'a t = 'a option
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Transform the element inside, if any

    val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

    map_or ~default f o is f x if o = Some x, default otherwise

    • Since: 0.16
    val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

    map_lazy default_fn f o if f o if o = Some x, default_fn () otherwise

    • Since: 1.2
    val is_some : _ t ‑> bool
    val is_none : _ t ‑> bool
    • Since: 0.11
    val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
    val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool
    val return : 'a ‑> 'a t

    Monadic return, that is return x = Some x

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind

    val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

    Flip version of >>=

    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t
    val iter : ('a ‑> unit) ‑> 'a t ‑> unit

    Iterate on 0 or 1 element

    val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

    Fold on 0 or 1 element

    val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

    Filter on 0 or 1 element

    • Since: 0.5
    val if_ : ('a ‑> bool) ‑> 'a ‑> 'a option

    if_ f x is Some x if f x, None otherwise

    • Since: 0.17
    val exists : ('a ‑> bool) ‑> 'a t ‑> bool
    • Since: 0.17
    val for_all : ('a ‑> bool) ‑> 'a t ‑> bool
    • Since: 0.17
    val get_or : default:'a ‑> 'a t ‑> 'a

    get_or ~default o extracts the value from o, or -returns default if o = None.

    • Since: 0.18
    val get_exn : 'a t ‑> 'a

    Open the option, possibly failing if it is None

    • Raises Invalid_argument: if the option is None
    val get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'a

    get_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.

    • Since: 0.6.1
    val sequence_l : 'a t list ‑> 'a list t

    sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if +CCOpt (containers.CCOpt)

    Module CCOpt

    Options

    type +'a t = 'a option
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Transform the element inside, if any.

    val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

    map_or ~default f o is f x if o = Some x, default otherwise.

    • Since: 0.16
    val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'b

    map_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.

    • Since: 1.2
    val is_some : _ t ‑> bool

    is_some (Some x) returns true otherwise it returns false.

    val is_none : _ t ‑> bool

    is_none None returns true otherwise it returns false.

    • Since: 0.11
    val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int

    Compare two options, using custom comparators for the value. +None is always assumed to be less than Some _.

    val equal : ('a ‑> 'a ‑> bool) ‑> 'a t ‑> 'a t ‑> bool

    Test for equality between option types using a custom equality predicat.

    val return : 'a ‑> 'a t

    Monadic return, that is return x = Some x.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Infix version of map.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

    Flip version of >>=.

    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t

    map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.

    val iter : ('a ‑> unit) ‑> 'a t ‑> unit

    Iterate on 0 or 1 element.

    val fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'a

    Fold on 0 or 1 element.

    val filter : ('a ‑> bool) ‑> 'a t ‑> 'a t

    Filter on 0 or 1 element.

    • Since: 0.5
    val if_ : ('a ‑> bool) ‑> 'a ‑> 'a option

    if_ f x is Some x if f x, None otherwise.

    • Since: 0.17
    val exists : ('a ‑> bool) ‑> 'a t ‑> bool

    Return true iff there exists an element for which the provided function evaluates to true.

    • Since: 0.17
    val for_all : ('a ‑> bool) ‑> 'a t ‑> bool

    Return true iff the provided function evaluates to true for all elements.

    • Since: 0.17
    val get_or : default:'a ‑> 'a t ‑> 'a

    get_or ~default o extracts the value from o, or +returns default if o = None.

    • Since: 0.18
    val get_exn : 'a t ‑> 'a

    Open the option, possibly failing if it is None.

    • Raises Invalid_argument: if the option is None.
    val get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'a

    get_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.

    • Since: 0.6.1
    val sequence_l : 'a t list ‑> 'a list t

    sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if every xi is Some yi. Otherwise, if the list contains at least one None, the result is None.

    val wrap : ?⁠handler:(exn ‑> bool) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b option

    wrap f x calls f x and returns Some y if f x = y. If f x raises any exception, the result is None. This can be useful to wrap functions such as Map.S.find.

    • Parameter handler: the exception handler, which returns true if the -exception is to be caught.
    val wrap2 : ?⁠handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c option

    wrap2 f x y is similar to wrap1 but for binary functions.

    Applicative

    val pure : 'a ‑> 'a t

    Alias to return

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Alternatives

    val or_ : else_:'a t ‑> 'a t ‑> 'a t

    or_ ~else_ a is a if a is Some _, else_ otherwise

    • Since: 1.2
    val or_lazy : else_:(unit ‑> 'a t) ‑> 'a t ‑> 'a t

    or_lazy else_ a is a if a is Some _, else_ () otherwise

    • Since: 1.2
    val (<+>) : 'a t ‑> 'a t ‑> 'a t

    a <+> b is a if a is Some _, b otherwise

    val choice : 'a t list ‑> 'a t

    choice returns the first non-None element of the list, or None

    Infix Operators

    • Since: 0.16
    module Infix : sig ... end

    Conversion and IO

    val to_list : 'a t ‑> 'a list
    val of_list : 'a list ‑> 'a t

    Head of list, or None

    val to_result : 'e ‑> 'a t ‑> ('a'e) Result.result
    • Since: 1.2
    val to_result_lazy : (unit ‑> 'e) ‑> 'a t ‑> ('a'e) Result.result
    • Since: 1.2
    val of_result : ('a_) Result.result ‑> 'a t
    • Since: 1.2
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    val random : 'a random_gen ‑> 'a t random_gen
    val choice_seq : 'a t sequence ‑> 'a t

    choice_seq s is similar to choice, but works on sequences. +exception is to be caught.

    val wrap2 : ?⁠handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c option

    wrap2 f x y is similar to wrap but for binary functions.

    Applicative

    val pure : 'a ‑> 'a t

    Alias to return.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    f <$> (Some x) returns Some (f x) and f <$> None returns None.

    val (<$>) : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Like map.

    Alternatives

    val or_ : else_:'a t ‑> 'a t ‑> 'a t

    or_ ~else_ a is a if a is Some _, else_ otherwise.

    • Since: 1.2
    val or_lazy : else_:(unit ‑> 'a t) ‑> 'a t ‑> 'a t

    or_lazy ~else_ a is a if a is Some _, else_ () otherwise.

    • Since: 1.2
    val (<+>) : 'a t ‑> 'a t ‑> 'a t

    a <+> b is a if a is Some _, b otherwise.

    val choice : 'a t list ‑> 'a t

    choice returns the first non-None element of the list, or None.

    Infix Operators

    • Since: 0.16
    module Infix : sig ... end

    Conversion and IO

    val to_list : 'a t ‑> 'a list
    val of_list : 'a list ‑> 'a t

    Head of list, or None.

    val to_result : 'e ‑> 'a t ‑> ('a'e) Result.result
    • Since: 1.2
    val to_result_lazy : (unit ‑> 'e) ‑> 'a t ‑> ('a'e) Result.result
    • Since: 1.2
    val of_result : ('a_) Result.result ‑> 'a t
    • Since: 1.2
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a gen = unit ‑> 'a option
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a random_gen = Random.State.t ‑> 'a
    val random : 'a random_gen ‑> 'a t random_gen
    val choice_seq : 'a t sequence ‑> 'a t

    choice_seq s is similar to choice, but works on sequences. It returns the first Some x occurring in s, or None otherwise.

    • Since: 0.13
    val to_gen : 'a t ‑> 'a gen
    val to_seq : 'a t ‑> 'a sequence
    val pp : 'a printer ‑> 'a t printer
    \ No newline at end of file diff --git a/2.0/containers/CCOrd/Infix/index.html b/2.0/containers/CCOrd/Infix/index.html index e9b06f2f..518312f2 100644 --- a/2.0/containers/CCOrd/Infix/index.html +++ b/2.0/containers/CCOrd/Infix/index.html @@ -1,2 +1,4 @@ -Infix (containers.CCOrd.Infix)

    Module CCOrd.Infix

    val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int
    val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t
    \ No newline at end of file +Infix (containers.CCOrd.Infix)

    Module CCOrd.Infix

    val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int

    c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; +otherwise it uses ord to compare the two values x and y, +of type 'a.

    val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

    Infix equivalent of map.

    \ No newline at end of file diff --git a/2.0/containers/CCOrd/index.html b/2.0/containers/CCOrd/index.html index 4fa645dd..bf28fcc5 100644 --- a/2.0/containers/CCOrd/index.html +++ b/2.0/containers/CCOrd/index.html @@ -1,5 +1,5 @@ -CCOrd (containers.CCOrd)

    Module CCOrd

    Comparisons

    type 'a t = 'a ‑> 'a ‑> int

    Comparison (total ordering) between two elements, that returns an int

    val compare : 'a t

    Polymorphic "magic" comparison

    val opp : 'a t ‑> 'a t

    Opposite order

    val equiv : int ‑> int ‑> bool

    Returns true iff the two comparison results are the same

    val int : int t
    val string : string t
    val bool : bool t
    val float : float t

    Lexicographic Combination

    val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int

    c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; +CCOrd (containers.CCOrd)

    Module CCOrd

    Comparisons

    type 'a t = 'a ‑> 'a ‑> int

    Comparison (total ordering) between two elements, that returns an int.

    val compare : 'a t

    Polymorphic "magic" comparison.

    val opp : 'a t ‑> 'a t

    Opposite order.

    val equiv : int ‑> int ‑> bool

    Returns true iff the two comparison results are the same.

    val int : int t
    val string : string t
    val bool : bool t
    val float : float t

    Lexicographic Combination

    val (<?>) : int ‑> ('a t * 'a * 'a) ‑> int

    c1 <?> (ord, x, y) returns the same as c1 if c1 is not 0; otherwise it uses ord to compare the two values x and y, of type 'a.

    Example:

    CCInt.compare 1 3
    @@ -7,9 +7,9 @@ of type 'a.

    Example: <?> (CCBool.compare, true, false)

    Same example, using only CCOrd::

    CCOrd.(int 1 3
             <?> (string, "a", "b")
    -        <?> (bool, true, false))
    val option : 'a t ‑> 'a option t

    Comparison of optional values. None is smaller than any Some _.

    • Since: 0.15
    val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
    val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
    val list : 'a t ‑> 'a list t

    Lexicographic combination on lists

    val array : 'a t ‑> 'a array t
    val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

    map f ord is the comparison function that, given objects x and y, + <?> (bool, true, false))

    val option : 'a t ‑> 'a option t

    Comparison of optional values. None is smaller than any Some _.

    • Since: 0.15
    val pair : 'a t ‑> 'b t ‑> ('a * 'b) t
    val triple : 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t
    val list : 'a t ‑> 'a list t

    Lexicographic combination on lists.

    val array : 'a t ‑> 'a array t
    val map : ('a ‑> 'b) ‑> 'b t ‑> 'a t

    map f ord is the comparison function that, given objects x and y, projects x and y using f (e.g. using a record field) and then compares those projections with ord. Example: map fst CCInt.compare compares values of type (int * 'a) by their -first component.

    val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

    Infix equivalent of map

    module Infix : sig ... end
    \ No newline at end of file +first component.

    val (>|=) : 'b t ‑> ('a ‑> 'b) ‑> 'a t

    Infix equivalent of map.

    module Infix : sig ... end
    \ No newline at end of file diff --git a/2.0/containers/CCPair/index.html b/2.0/containers/CCPair/index.html index 2f8885dd..e236b9aa 100644 --- a/2.0/containers/CCPair/index.html +++ b/2.0/containers/CCPair/index.html @@ -1,4 +1,4 @@ -CCPair (containers.CCPair)

    Module CCPair

    Tuple Functions

    type ('a, 'b) t = 'a * 'b
    val make : 'a ‑> 'b ‑> ('a'bt

    Make a tuple from its components

    • Since: 0.16
    val map1 : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c
    val map2 : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b
    val map : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd
    val map_same : ('a ‑> 'b) ‑> ('a * 'a) ‑> 'b * 'b
    val map_fst : ('a ‑> 'b) ‑> ('a * _) ‑> 'b

    Compose the given function with fst.

    • Since: 0.3.3
    val map_snd : ('a ‑> 'b) ‑> (_ * 'a) ‑> 'b

    Compose the given function with snd.

    • Since: 0.3.3
    val iter : ('a ‑> 'b ‑> unit) ‑> ('a * 'b) ‑> unit
    val swap : ('a * 'b) ‑> 'b * 'a

    Swap the components of the tuple

    val (<<<) : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c

    Map on the left side of the tuple

    val (>>>) : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b

    Map on the right side of the tuple

    val (***) : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd

    Map on both sides of a tuple

    val (&&&) : ('a ‑> 'b) ‑> ('a ‑> 'c) ‑> 'a ‑> 'b * 'c

    f &&& g is fun x -> f x, g x. It splits the computations into -two parts

    val merge : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

    Uncurrying (merges the two components of a tuple)

    val fold : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

    Synonym to merge

    • Since: 0.3.3
    val dup : 'a ‑> 'a * 'a

    dup x = (x,x) (duplicate the value)

    • Since: 0.3.3
    val dup_map : ('a ‑> 'b) ‑> 'a ‑> 'a * 'b

    dup_map f x = (x, f x). Duplicates the value and applies the function -to the second copy.

    • Since: 0.3.3
    val equal : ('a ‑> 'a ‑> bool) ‑> ('b ‑> 'b ‑> bool) ‑> ('a * 'b) ‑> ('a * 'b) ‑> bool
    val compare : ('a ‑> 'a ‑> int) ‑> ('b ‑> 'b ‑> int) ‑> ('a * 'b) ‑> ('a * 'b) ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    val pp : ?⁠sep:string ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer
    \ No newline at end of file +CCPair (containers.CCPair)

    Module CCPair

    Tuple Functions

    type ('a, 'b) t = 'a * 'b
    val make : 'a ‑> 'b ‑> ('a'bt

    Make a tuple from its components.

    • Since: 0.16
    val map1 : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c

    map1 f (x, y) returns (f x, y).

    val map2 : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b

    map2 f (x, y) returns (x, f y).

    val map : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd

    Synonym to ( *** ). Map on both sides of a tuple.

    val map_same : ('a ‑> 'b) ‑> ('a * 'a) ‑> 'b * 'b

    Like map but specialized for pairs with elements of the same type.

    val map_fst : ('a ‑> 'b) ‑> ('a * _) ‑> 'b

    Compose the given function with fst.

    • Since: 0.3.3
    val map_snd : ('a ‑> 'b) ‑> (_ * 'a) ‑> 'b

    Compose the given function with snd.

    • Since: 0.3.3
    val iter : ('a ‑> 'b ‑> unit) ‑> ('a * 'b) ‑> unit
    val swap : ('a * 'b) ‑> 'b * 'a

    Swap the components of the tuple.

    val (<<<) : ('a ‑> 'b) ‑> ('a * 'c) ‑> 'b * 'c

    Map on the left side of the tuple.

    val (>>>) : ('a ‑> 'b) ‑> ('c * 'a) ‑> 'c * 'b

    Map on the right side of the tuple.

    val (***) : ('a ‑> 'c) ‑> ('b ‑> 'd) ‑> ('a * 'b) ‑> 'c * 'd

    Map on both sides of a tuple.

    val (&&&) : ('a ‑> 'b) ‑> ('a ‑> 'c) ‑> 'a ‑> 'b * 'c

    f &&& g is fun x -> f x, g x. It splits the computations into +two parts.

    val merge : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

    Uncurrying (merges the two components of a tuple).

    val fold : ('a ‑> 'b ‑> 'c) ‑> ('a * 'b) ‑> 'c

    Synonym to merge.

    • Since: 0.3.3
    val dup : 'a ‑> 'a * 'a

    dup x = (x,x) (duplicate the value).

    • Since: 0.3.3
    val dup_map : ('a ‑> 'b) ‑> 'a ‑> 'a * 'b

    dup_map f x = (x, f x). Duplicates the value and applies the function +to the second copy.

    • Since: 0.3.3
    val equal : ('a ‑> 'a ‑> bool) ‑> ('b ‑> 'b ‑> bool) ‑> ('a * 'b) ‑> ('a * 'b) ‑> bool
    val compare : ('a ‑> 'a ‑> int) ‑> ('b ‑> 'b ‑> int) ‑> ('a * 'b) ‑> ('a * 'b) ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    val pp : ?⁠sep:string ‑> 'a printer ‑> 'b printer ‑> ('a * 'b) printer

    Print a pair given an optional separator and a method for printing each of its elements.

    \ No newline at end of file diff --git a/2.0/containers/CCParse/Infix/index.html b/2.0/containers/CCParse/Infix/index.html index d14cabdd..2db2c0dc 100644 --- a/2.0/containers/CCParse/Infix/index.html +++ b/2.0/containers/CCParse/Infix/index.html @@ -1,2 +1,13 @@ -Infix (containers.CCParse.Infix)

    Module CCParse.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t
    val (<*) : 'a t ‑> _ t ‑> 'a t
    val (*>) : _ t ‑> 'a t ‑> 'a t
    val (<|>) : 'a t ‑> 'a t ‑> 'a t
    val (<?>) : 'a t ‑> string ‑> 'a t
    \ No newline at end of file +Infix (containers.CCParse.Infix)

    Module CCParse.Infix

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Map.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind. +p >>= f results in a new parser which behaves as p then, +in case of success, applies f to the result.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    Applicative.

    val (<*) : 'a t ‑> _ t ‑> 'a t

    a <* b parses a into x, parses b and ignores its result, +and returns x.

    val (*>) : _ t ‑> 'a t ‑> 'a t

    a *> b parses a, then parses b into x, and returns x. The +results of a is ignored.

    val (<|>) : 'a t ‑> 'a t ‑> 'a t

    a <|> b tries to parse a, and if a fails without +consuming any input, backtracks and tries +to parse b, otherwise it fails as a. +See try_ to ensure a does not consume anything (but it is best +to avoid wrapping large parsers with try_).

    val (<?>) : 'a t ‑> string ‑> 'a t

    a <?> msg behaves like a, but if a fails without +consuming any input, it fails with msg +instead. Useful as the last choice in a series of <|>: +a <|> b <|> c <?> "expected a|b|c".

    \ No newline at end of file diff --git a/2.0/containers/CCParse/U/index.html b/2.0/containers/CCParse/U/index.html index 1edd3837..317eebba 100644 --- a/2.0/containers/CCParse/U/index.html +++ b/2.0/containers/CCParse/U/index.html @@ -1,6 +1,6 @@ U (containers.CCParse.U)

    Module CCParse.U

    val list : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'a list t

    list p parses a list of p, with the OCaml conventions for start token "", stop token "" and separator ";". -Whitespace between items are skipped

    val int : int t
    val word : string t

    non empty string of alpha num, start with alpha

    val pair : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'b t ‑> ('a * 'b) t

    Parse a pair using OCaml whitespace conventions. +Whitespace between items are skipped.

    val int : int t

    Parse an int.

    val word : string t

    Non empty string of alpha num, start with alpha.

    val pair : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'b t ‑> ('a * 'b) t

    Parse a pair using OCaml whitespace conventions. The default is "(a, b)".

    val triple : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a t ‑> 'b t ‑> 'c t ‑> ('a * 'b * 'c) t

    Parse a triple using OCaml whitespace conventions. The default is "(a, b, c)".

    \ No newline at end of file diff --git a/2.0/containers/CCParse/index.html b/2.0/containers/CCParse/index.html index 69ad681b..83bcba9e 100644 --- a/2.0/containers/CCParse/index.html +++ b/2.0/containers/CCParse/index.html @@ -26,24 +26,26 @@ This makes a list of 100_000 integers, prints it and parses it back.

    type 'a or_error = ('a, string) Result.result
    type line_num = int
    type col_num = int
    type parse_branch
    val string_of_branch : parse_branch ‑> string
    exception ParseError of parse_branch * unit ‑> string

    parsing branch * message

    Input

    type position
    type state
    val state_of_string : string ‑> state

    Combinators

    type 'a t = state ‑> ok:('a ‑> unit) ‑> err:(exn ‑> unit) ‑> unit

    Takes the input and two continuations: -

    • ok to call with the result when it's done
    • err to call when the parser met an error
    • Raises ParseError: in case of failure
    val return : 'a ‑> 'a t

    Always succeeds, without consuming its input

    val pure : 'a ‑> 'a t

    Synonym to return

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Map

    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t
    val map3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a t ‑> 'b t ‑> 'c t ‑> 'd t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    Applicative

    val (<*) : 'a t ‑> _ t ‑> 'a t

    a <* b parses a into x, parses b and ignores its result, -and returns x

    val (*>) : _ t ‑> 'a t ‑> 'a t

    a *> b parses a, then parses b into x, and returns x. The -results of a is ignored.

    val fail : string ‑> 'a t

    fail msg fails with the given message. It can trigger a backtrack

    val failf : ('a, unit, string, 'b t) Pervasives.format4 ‑> 'a

    Format.sprintf version of fail

    val parsing : string ‑> 'a t ‑> 'a t

    parsing s p behaves the same as p, with the information that -we are parsing s, if p fails

    val eoi : unit t

    Expect the end of input, fails otherwise

    val nop : unit t

    Succeed with ()

    val char : char ‑> char t

    char c parses the char c and nothing else

    val char_if : (char ‑> bool) ‑> char t

    char_if f parses a character c if f c = true

    val chars_if : (char ‑> bool) ‑> string t

    chars_if f parses a string of chars that satisfy f

    val chars1_if : (char ‑> bool) ‑> string t

    Same as chars_if, but only non-empty strings

    val endline : char t

    Parses '\n'

    val space : char t

    Tab or space

    val white : char t

    Tab or space or newline

    val skip_chars : (char ‑> bool) ‑> unit t

    Skip 0 or more chars satisfying the predicate

    val skip_space : unit t

    Skip ' ' and '\t'

    val skip_white : unit t

    Skip ' ' and '\t' and '\n'

    val is_alpha : char ‑> bool

    Is the char a letter?

    val is_num : char ‑> bool

    Is the char a digit?

    val is_alpha_num : char ‑> bool
    val is_space : char ‑> bool

    True on ' ' and '\t'

    val is_white : char ‑> bool

    True on ' ' and '\t' and '\n'

    val (<|>) : 'a t ‑> 'a t ‑> 'a t

    a <|> b tries to parse a, and if a fails without + assert (l=l');;

    type 'a or_error = ('a, string) Result.result
    type line_num = int
    type col_num = int
    type parse_branch
    val string_of_branch : parse_branch ‑> string
    exception ParseError of parse_branch * unit ‑> string

    parsing branch * message.

    Input

    type position
    type state
    val state_of_string : string ‑> state

    Combinators

    type 'a t = state ‑> ok:('a ‑> unit) ‑> err:(exn ‑> unit) ‑> unit

    Takes the input and two continuations: +

    • ok to call with the result when it's done
    • err to call when the parser met an error
    • Raises ParseError: in case of failure.
    val return : 'a ‑> 'a t

    Always succeeds, without consuming its input.

    val pure : 'a ‑> 'a t

    Synonym to return.

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t

    Map.

    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t
    val map2 : ('a ‑> 'b ‑> 'c) ‑> 'a t ‑> 'b t ‑> 'c t
    val map3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a t ‑> 'b t ‑> 'c t ‑> 'd t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind. +p >>= f results in a new parser which behaves as p then, +in case of success, applies f to the result.

    val (<*>) : ('a ‑> 'b) t ‑> 'a t ‑> 'b t

    Applicative.

    val (<*) : 'a t ‑> _ t ‑> 'a t

    a <* b parses a into x, parses b and ignores its result, +and returns x.

    val (*>) : _ t ‑> 'a t ‑> 'a t

    a *> b parses a, then parses b into x, and returns x. The +results of a is ignored.

    val fail : string ‑> 'a t

    fail msg fails with the given message. It can trigger a backtrack.

    val failf : ('a, unit, string, 'b t) Pervasives.format4 ‑> 'a

    Format.sprintf version of fail.

    val parsing : string ‑> 'a t ‑> 'a t

    parsing s p behaves the same as p, with the information that +we are parsing s, if p fails.

    val eoi : unit t

    Expect the end of input, fails otherwise.

    val nop : unit t

    Succeed with ().

    val char : char ‑> char t

    char c parses the character c and nothing else.

    val char_if : (char ‑> bool) ‑> char t

    char_if f parses a character c if f c = true.

    val chars_if : (char ‑> bool) ‑> string t

    chars_if f parses a string of chars that satisfy f.

    val chars1_if : (char ‑> bool) ‑> string t

    Like chars_if, but only non-empty strings.

    val endline : char t

    Parses '\n'.

    val space : char t

    Tab or space.

    val white : char t

    Tab or space or newline.

    val skip_chars : (char ‑> bool) ‑> unit t

    Skip 0 or more chars satisfying the predicate.

    val skip_space : unit t

    Skip ' ' and '\t'.

    val skip_white : unit t

    Skip ' ' and '\t' and '\n'.

    val is_alpha : char ‑> bool

    Is the char a letter?

    val is_num : char ‑> bool

    Is the char a digit?

    val is_alpha_num : char ‑> bool

    Is the char a letter or a digit?

    val is_space : char ‑> bool

    True on ' ' and '\t'.

    val is_white : char ‑> bool

    True on ' ' and '\t' and '\n'.

    val (<|>) : 'a t ‑> 'a t ‑> 'a t

    a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a. See try_ to ensure a does not consume anything (but it is best -to avoid wrapping large parsers with try_)

    val (<?>) : 'a t ‑> string ‑> 'a t

    a <?> msg behaves like a, but if a fails without +to avoid wrapping large parsers with try_).

    val (<?>) : 'a t ‑> string ‑> 'a t

    a <?> msg behaves like a, but if a fails without consuming any input, it fails with msg instead. Useful as the last choice in a series of <|>: -a <|> b <|> c <?> "expected a|b|c"

    val try_ : 'a t ‑> 'a t

    try_ p tries to parse like p, but backtracks if p fails. -Useful in combination with <|>

    val suspend : (unit ‑> 'a t) ‑> 'a t

    suspend f is the same as f (), but evaluates f () only -when needed

    val string : string ‑> string t

    string s parses exactly the string s, and nothing else

    val many : 'a t ‑> 'a list t

    many p parses a list of p, eagerly (as long as possible)

    val many1 : 'a t ‑> 'a list t

    parses a non empty list

    val skip : _ t ‑> unit t

    skip p parses zero or more times p and ignores its result

    val sep : by:_ t ‑> 'a t ‑> 'a list t

    sep ~by p parses a list of p separated by by

    val sep1 : by:_ t ‑> 'a t ‑> 'a list t

    sep1 ~by p parses a non empty list of p, separated by by

    val fix : ('a t ‑> 'a t) ‑> 'a t

    Fixpoint combinator

    val memo : 'a t ‑> 'a t

    Memoize the parser. memo p will behave like p, but when called +a <|> b <|> c <?> "expected a|b|c".

    val try_ : 'a t ‑> 'a t

    try_ p tries to parse like p, but backtracks if p fails. +Useful in combination with <|>.

    val suspend : (unit ‑> 'a t) ‑> 'a t

    suspend f is the same as f (), but evaluates f () only +when needed.

    val string : string ‑> string t

    string s parses exactly the string s, and nothing else.

    val many : 'a t ‑> 'a list t

    many p parses a list of p, eagerly (as long as possible).

    val many1 : 'a t ‑> 'a list t

    Parse a non-empty list.

    val skip : _ t ‑> unit t

    skip p parses zero or more times p and ignores its result.

    val sep : by:_ t ‑> 'a t ‑> 'a list t

    sep ~by p parses a list of p separated by by.

    val sep1 : by:_ t ‑> 'a t ‑> 'a list t

    sep1 ~by p parses a non empty list of p, separated by by.

    val fix : ('a t ‑> 'a t) ‑> 'a t

    Fixpoint combinator.

    val memo : 'a t ‑> 'a t

    Memoize the parser. memo p will behave like p, but when called in a state (read: position in input) it has already processed, memo p returns a result directly. The implementation uses an underlying hashtable. This can be costly in memory, but improve the run time a lot if there -is a lot of backtracking involving p.

    This function is not thread-safe.

    val fix_memo : ('a t ‑> 'a t) ‑> 'a t

    Same as fix, but the fixpoint is memoized.

    val get_lnum : int t

    Reflects the current line number

    val get_cnum : int t

    Reflects the current column number

    val get_pos : (int * int) t

    Reflects the current (line, column) numbers

    Parse

    Those functions have a label ~p on the parser, since 0.14.

    val parse : 'a t ‑> state ‑> 'a or_error

    parse p st applies p on the input, and returns Ok x if -p succeeds with x, or Error s otherwise

    val parse_exn : 'a t ‑> state ‑> 'a

    Unsafe version of parse

    • Raises ParseError: if it fails
    val parse_string : 'a t ‑> string ‑> 'a or_error

    Specialization of parse for string inputs

    val parse_string_exn : 'a t ‑> string ‑> 'a
    • Raises ParseError: if it fails
    val parse_file : 'a t ‑> string ‑> 'a or_error

    parse_file p file parses file with p by opening the file -and reading it whole.

    val parse_file_exn : 'a t ‑> string ‑> 'a
    • Raises ParseError: if it fails

    Infix

    module Infix : sig ... end

    Utils

    This is useful to parse OCaml-like values in a simple way.

    module U : sig ... end
    \ No newline at end of file +is a lot of backtracking involving p.

    This function is not thread-safe.

    val fix_memo : ('a t ‑> 'a t) ‑> 'a t

    Like fix, but the fixpoint is memoized.

    val get_lnum : int t

    Reflect the current line number.

    val get_cnum : int t

    Reflect the current column number.

    val get_pos : (int * int) t

    Reflect the current (line, column) numbers.

    Parse

    Those functions have a label ~p on the parser, since 0.14.

    val parse : 'a t ‑> state ‑> 'a or_error

    parse p st applies p on the input, and returns Ok x if +p succeeds with x, or Error s otherwise.

    val parse_exn : 'a t ‑> state ‑> 'a

    Unsafe version of parse.

    • Raises ParseError: if it fails.
    val parse_string : 'a t ‑> string ‑> 'a or_error

    Specialization of parse for string inputs.

    val parse_string_exn : 'a t ‑> string ‑> 'a
    • Raises ParseError: if it fails.
    val parse_file : 'a t ‑> string ‑> 'a or_error

    parse_file p file parses file with p by opening the file +and reading it whole.

    val parse_file_exn : 'a t ‑> string ‑> 'a
    • Raises ParseError: if it fails.

    Infix

    module Infix : sig ... end

    Utils

    This is useful to parse OCaml-like values in a simple way.

    module U : sig ... end
    \ No newline at end of file diff --git a/2.0/containers/CCRandom/index.html b/2.0/containers/CCRandom/index.html index a4f36728..f834c75c 100644 --- a/2.0/containers/CCRandom/index.html +++ b/2.0/containers/CCRandom/index.html @@ -1,6 +1,6 @@ CCRandom (containers.CCRandom)

    Module CCRandom

    Random Generators

    include module type of Random
    val init : int ‑> unit
    val full_init : int array ‑> unit
    val self_init : unit ‑> unit
    val bits : unit ‑> int
    val int : int ‑> int
    val int32 : Int32.t ‑> Int32.t
    val nativeint : Nativeint.t ‑> Nativeint.t
    val int64 : Int64.t ‑> Int64.t
    val float : float ‑> float
    val bool : unit ‑> bool
    module State : sig ... end
    val get_state : unit ‑> State.t
    val set_state : State.t ‑> unit
    type state = Random.State.t
    type 'a t = state ‑> 'a

    Random generator for values of type 'a.

    type 'a random_gen = 'a t
    val return : 'a ‑> 'a t

    return x is the generator that always returns x. -Example: let random_int = return 4 (* fair dice roll *).

    val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

    flat_map f g st = f (g st) st.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    map f g st = f (g st).

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val delay : (unit ‑> 'a t) ‑> 'a t

    Delay evaluation. Useful for side-effectful generators that +Example: let random_int = return 4 (* fair dice roll *).

    val flat_map : ('a ‑> 'b t) ‑> 'a t ‑> 'b t

    flat_map f g st is f (g st) st.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    map f g st is f (g st).

    val (>|=) : 'a t ‑> ('a ‑> 'b) ‑> 'b t
    val delay : (unit ‑> 'a t) ‑> 'a t

    Delay evaluation. Useful for side-effectful generators that need some code to run for every call. Example:

          let gensym = let r = ref 0 in fun () -> incr r; !r ;;
    @@ -8,10 +8,10 @@ Example:
           delay (fun () ->
             let name = gensym() in
             small_int >>= fun i -> return (name,i)
    -      )
    • Since: 0.4
    val choose : 'a t list ‑> 'a option t

    Choose a generator within the list.

    val choose_exn : 'a t list ‑> 'a t

    Same as choose but without option.

    • Raises Invalid_argument: if the list is empty.
    val choose_array : 'a t array ‑> 'a option t
    val choose_return : 'a list ‑> 'a t

    Choose among the list.

    • Raises Invalid_argument: if the list is empty
    val replicate : int ‑> 'a t ‑> 'a list t

    replicate n g makes a list of n elements which are all generated + )

    • Since: 0.4
    val choose : 'a t list ‑> 'a option t

    Choose a generator within the list.

    val choose_exn : 'a t list ‑> 'a t

    Like choose but without option.

    • Raises Invalid_argument: if the list is empty.
    val choose_array : 'a t array ‑> 'a option t

    Choose a generator within the array.

    val choose_return : 'a list ‑> 'a t

    Choose among the list.

    • Raises Invalid_argument: if the list is empty.
    val replicate : int ‑> 'a t ‑> 'a list t

    replicate n g makes a list of n elements which are all generated randomly using g.

    val sample_without_replacement : compare:('a ‑> 'a ‑> int) ‑> int ‑> 'a t ‑> 'a list t

    sample_without_replacement n g makes a list of n elements which are all generated randomly using g with the added constraint that none of the generated -random values are equal.

    • Raises Invalid_argument: if n <= 0.
    • Since: 0.15
    val list_seq : 'a t list ‑> 'a list t

    Build random lists from lists of random generators.

    • Since: 0.4
    exception Pick_from_empty
    • Since: 0.16
    val pick_list : 'a list ‑> 'a t

    Pick an element at random from the list.

    • Raises Pick_from_empty: if the list is empty.
    • Since: 0.16
    val pick_array : 'a array ‑> 'a t

    Pick an element at random from the array.

    • Raises Pick_from_empty: if the array is empty.
    • Since: 0.16
    val small_int : int t
    val int : int ‑> int t
    val int_range : int ‑> int ‑> int t

    Inclusive range.

    val small_float : float t

    A reasonably small float.

    • Since: 0.6.1
    val float : float ‑> float t

    Random float within the given range.

    • Since: 0.6.1
    val float_range : float ‑> float ‑> float t

    Inclusive range. float_range a b assumes a < b.

    • Since: 0.6.1
    val split : int ‑> (int * int) option t

    Split a positive value n into n1,n2 where n = n1 + n2.

    • Returns None if the value is too small.
    val split_list : int ‑> len:int ‑> int list option t

    Split a value n into a list of values whose sum is n +random values are equal.

    • Raises Invalid_argument: if n <= 0.
    • Since: 0.15
    val list_seq : 'a t list ‑> 'a list t

    Build random lists from lists of random generators.

    • Since: 0.4
    exception Pick_from_empty
    • Since: 0.16
    val pick_list : 'a list ‑> 'a t

    Pick an element at random from the list.

    • Raises Pick_from_empty: if the list is empty.
    • Since: 0.16
    val pick_array : 'a array ‑> 'a t

    Pick an element at random from the array.

    • Raises Pick_from_empty: if the array is empty.
    • Since: 0.16
    val small_int : int t

    A small int (100).

    val int : int ‑> int t

    Random int within the given range.

    val int_range : int ‑> int ‑> int t

    Inclusive range.

    val small_float : float t

    A reasonably small float (100.0).

    • Since: 0.6.1
    val float : float ‑> float t

    Random float within the given range.

    • Since: 0.6.1
    val float_range : float ‑> float ‑> float t

    Inclusive range. float_range a b assumes a < b.

    • Since: 0.6.1
    val split : int ‑> (int * int) option t

    Split a positive value n into n1,n2 where n = n1 + n2.

    • Returns None if the value is too small.
    val split_list : int ‑> len:int ‑> int list option t

    Split a value n into a list of values whose sum is n and whose length is length. The list is never empty and does not contain 0.

    • Raises Invalid_argument: if len <= 1.
    • Returns None if the value is too small.
    val retry : ?⁠max:int ‑> 'a option t ‑> 'a option t

    retry g calls g until it returns some value, or until the maximum number of retries was reached. If g fails, diff --git a/2.0/containers/CCRef/index.html b/2.0/containers/CCRef/index.html index d0beddee..f1787792 100644 --- a/2.0/containers/CCRef/index.html +++ b/2.0/containers/CCRef/index.html @@ -1,2 +1,2 @@ -CCRef (containers.CCRef)

    Module CCRef

    References

    • Since: 0.9
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a eq = 'a ‑> 'a ‑> bool
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a t = 'a Pervasives.ref
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Transform the value

    val create : 'a ‑> 'a t

    Alias to ref

    val iter : ('a ‑> unit) ‑> 'a t ‑> unit

    Call the function on the content of the reference

    val update : ('a ‑> 'a) ‑> 'a t ‑> unit

    Update the reference's content with the given function

    val incr_then_get : int t ‑> int

    incr_then_get r increments r and returns its new value, think ++ r

    • Since: 0.17
    val get_then_incr : int t ‑> int

    get_then_incr r increments r and returns its old value, think r++

    • Since: 0.17
    val swap : 'a t ‑> 'a t ‑> unit

    Swap values.

    • Since: 1.4
    val compare : 'a ord ‑> 'a t ord
    val equal : 'a eq ‑> 'a t eq
    val to_list : 'a t ‑> 'a list
    val to_seq : 'a t ‑> 'a sequence
    val pp : 'a printer ‑> 'a t printer
    \ No newline at end of file +CCRef (containers.CCRef)

    Module CCRef

    References

    • Since: 0.9
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a eq = 'a ‑> 'a ‑> bool
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a t = 'a Pervasives.ref
    val map : ('a ‑> 'b) ‑> 'a t ‑> 'b t

    Transform the value.

    val create : 'a ‑> 'a t

    Alias to ref.

    val iter : ('a ‑> unit) ‑> 'a t ‑> unit

    Call the function on the content of the reference.

    val update : ('a ‑> 'a) ‑> 'a t ‑> unit

    Update the reference's content with the given function.

    val incr_then_get : int t ‑> int

    incr_then_get r increments r and returns its new value, think ++ r.

    • Since: 0.17
    val get_then_incr : int t ‑> int

    get_then_incr r increments r and returns its old value, think r++.

    • Since: 0.17
    val swap : 'a t ‑> 'a t ‑> unit

    swap t1 t2 puts !t2 in t1 and !t1 in t2.

    • Since: 1.4
    val compare : 'a ord ‑> 'a t ord
    val equal : 'a eq ‑> 'a t eq
    val to_list : 'a t ‑> 'a list
    val to_seq : 'a t ‑> 'a sequence
    val pp : 'a printer ‑> 'a t printer
    \ No newline at end of file diff --git a/2.0/containers/CCResult/Infix/index.html b/2.0/containers/CCResult/Infix/index.html index 23fa8f63..a6636cf7 100644 --- a/2.0/containers/CCResult/Infix/index.html +++ b/2.0/containers/CCResult/Infix/index.html @@ -1,2 +1,5 @@ -Infix (containers.CCResult.Infix)

    Module CCResult.Infix

    val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
    val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt
    val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt
    \ No newline at end of file +Infix (containers.CCResult.Infix)

    Module CCResult.Infix

    val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
    val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt

    Monadic composition. e >>= f proceeds as f x if e is Ok x +or returns e if e is an Error.

    val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt

    a <*> b evaluates a and b, and, in case of success, returns +Ok (a b). Otherwise, it fails, and the error of a is chosen +over the error of b if both fail.

    \ No newline at end of file diff --git a/2.0/containers/CCResult/Traverse/argument-1-M/index.html b/2.0/containers/CCResult/Traverse/argument-1-M/index.html index 9c64ef4b..63ae4079 100644 --- a/2.0/containers/CCResult/Traverse/argument-1-M/index.html +++ b/2.0/containers/CCResult/Traverse/argument-1-M/index.html @@ -1,2 +1,2 @@ -1-M (containers.CCResult.Traverse.1-M)

    Parameter CCResult.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +1-M (containers.CCResult.Traverse.1-M)

    Parameter CCResult.Traverse.1-M

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCResult/index.html b/2.0/containers/CCResult/index.html index b5f7f7b0..157a29f6 100644 --- a/2.0/containers/CCResult/index.html +++ b/2.0/containers/CCResult/index.html @@ -1,21 +1,22 @@ -CCResult (containers.CCResult)

    Module CCResult

    Error Monad

    Uses the new "result" type from OCaml 4.03.

    • Since: 0.16
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a equal = 'a ‑> 'a ‑> bool
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit

    Basics

    • Since: 1.5
    include module type of Result
    type ('a, 'b) result = ('a'b) Pervasives.result =
    | Ok of 'a
    | Error of 'b
    type (+'good, +'bad) t = ('good'bad) Result.result =
    | Ok of 'good
    | Error of 'bad
    val return : 'a ‑> ('a'errt

    Successfully return a value

    val fail : 'err ‑> ('a'errt

    Fail with an error

    val of_exn : exn ‑> ('a, string) t

    of_exn e uses Printexc to print the exception as a string

    val of_exn_trace : exn ‑> ('a, string) t

    of_exn_trace e is similar to of_exn e, but it adds the stacktrace +CCResult (containers.CCResult)

    Module CCResult

    Error Monad

    Uses the new "result" type from OCaml 4.03.

    • Since: 0.16
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a equal = 'a ‑> 'a ‑> bool
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit

    Basics

    • Since: 1.5
    include module type of Result
    type ('a, 'b) result = ('a'b) Pervasives.result =
    | Ok of 'a
    | Error of 'b
    type (+'good, +'bad) t = ('good'bad) Result.result =
    | Ok of 'good
    | Error of 'bad
    val return : 'a ‑> ('a'errt

    Successfully return a value.

    val fail : 'err ‑> ('a'errt

    Fail with an error.

    val of_exn : exn ‑> ('a, string) t

    of_exn e uses Printexc to print the exception as a string.

    val of_exn_trace : exn ‑> ('a, string) t

    of_exn_trace e is similar to of_exn e, but it adds the stacktrace to the error message.

    Remember to call Printexc.record_backtrace true and compile with the debug flag for this to work.

    val fail_printf : ('a, Buffer.t, unit, ('b, string) t) Pervasives.format4 ‑> 'a

    fail_printf format uses format to obtain an error message -and then returns Error msg

    val fail_fprintf : ('a, Format.formatter, unit, ('b, string) t) Pervasives.format4 ‑> 'a

    fail_printf format uses format to obtain an error message -and then returns Error msg

    val add_ctx : string ‑> ('a, string) t ‑> ('a, string) t

    add_ctx msg leaves Ok x untouched, but transforms +and then returns Error msg.

    val fail_fprintf : ('a, Format.formatter, unit, ('b, string) t) Pervasives.format4 ‑> 'a

    fail_fprintf format uses format to obtain an error message +and then returns Error msg.

    val add_ctx : string ‑> ('a, string) t ‑> ('a, string) t

    add_ctx msg leaves Ok x untouched, but transforms Error s into Error s' where s' contains the additional -context given by msg

    • Since: 1.2
    val add_ctxf : ('a, Format.formatter, unit, ('b, string) t ‑> ('b, string) t) Pervasives.format4 ‑> 'a

    add_ctxf format_message is similar to add_ctx but with +context given by msg.

    • Since: 1.2
    val add_ctxf : ('a, Format.formatter, unit, ('b, string) t ‑> ('b, string) t) Pervasives.format4 ‑> 'a

    add_ctxf format_message is similar to add_ctx but with Format for printing the message (eagerly). -Example:

          add_ctxf "message(number %d, foo: %B)" 42 true (Error "error)"
    • Since: 1.2
    val map : ('a ‑> 'b) ‑> ('a'errt ‑> ('b'errt

    Map on success

    val map_err : ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('a'err2t

    Map on the error variant

    val map2 : ('a ‑> 'b) ‑> ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('b'err2t

    Same as map, but also with a function that can transform -the error message in case of failure

    val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    Apply the function only in case of Ok

    exception Get_error
    val get_exn : ('a_t ‑> 'a

    Extract the value x from Ok x, fails otherwise. +Example:

          add_ctxf "message(number %d, foo: %B)" 42 true (Error "error)"
    • Since: 1.2
    val map : ('a ‑> 'b) ‑> ('a'errt ‑> ('b'errt

    Map on success.

    val map_err : ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('a'err2t

    Map on the error variant.

    val map2 : ('a ‑> 'b) ‑> ('err1 ‑> 'err2) ‑> ('a'err1t ‑> ('b'err2t

    Like map, but also with a function that can transform +the error message in case of failure.

    val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    Apply the function only in case of Ok.

    exception Get_error
    val get_exn : ('a_t ‑> 'a

    Extract the value x from Ok x, fails otherwise. You should be careful with this function, and favor other combinators -whenever possible.

    • Raises Get_error: if the value is an error.
    val get_or : ('a_t ‑> default:'a ‑> 'a

    get_or e ~default returns x if e = Ok x, default otherwise

    val map_or : ('a ‑> 'b) ‑> ('a'ct ‑> default:'b ‑> 'b

    map_or f e ~default returns f x if e = Ok x, default otherwise

    val catch : ('a'errt ‑> ok:('a ‑> 'b) ‑> err:('err ‑> 'b) ‑> 'b

    catch e ~ok ~err calls either ok or err depending on -the value of e.

    val flat_map : ('a ‑> ('b'errt) ‑> ('a'errt ‑> ('b'errt
    val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
    val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt
    val equal : err:'err equal ‑> 'a equal ‑> ('a'errt equal
    val compare : err:'err ord ‑> 'a ord ‑> ('a'errt ord
    val fold : ok:('a ‑> 'b) ‑> error:('err ‑> 'b) ‑> ('a'errt ‑> 'b

    fold ~ok ~error e opens e and, if e = Ok x, returns +whenever possible.

    • Raises Get_error: if the value is an error.
    val get_or : ('a_t ‑> default:'a ‑> 'a

    get_or e ~default returns x if e = Ok x, default otherwise.

    val map_or : ('a ‑> 'b) ‑> ('a'ct ‑> default:'b ‑> 'b

    map_or f e ~default returns f x if e = Ok x, default otherwise.

    val catch : ('a'errt ‑> ok:('a ‑> 'b) ‑> err:('err ‑> 'b) ‑> 'b

    catch e ~ok ~err calls either ok or err depending on +the value of e.

    val flat_map : ('a ‑> ('b'errt) ‑> ('a'errt ‑> ('b'errt
    val (>|=) : ('a'errt ‑> ('a ‑> 'b) ‑> ('b'errt
    val (>>=) : ('a'errt ‑> ('a ‑> ('b'errt) ‑> ('b'errt

    Monadic composition. e >>= f proceeds as f x if e is Ok x +or returns e if e is an Error.

    val equal : err:'err equal ‑> 'a equal ‑> ('a'errt equal
    val compare : err:'err ord ‑> 'a ord ‑> ('a'errt ord
    val fold : ok:('a ‑> 'b) ‑> error:('err ‑> 'b) ‑> ('a'errt ‑> 'b

    fold ~ok ~error e opens e and, if e = Ok x, returns ok x, otherwise e = Error s and it returns error s.

    val fold_ok : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> ('b_t ‑> 'a

    fold_ok f acc r will compute f acc x if r=Ok x, -and return acc otherwise, as if the result were a mere option.

    • Since: 1.2
    val is_ok : ('a'errt ‑> bool

    Return true if Ok

    • Since: 1.0
    val is_error : ('a'errt ‑> bool

    Return true if Error

    • Since: 1.0

    Wrappers

    val guard : (unit ‑> 'a) ‑> ('a, exn) t

    guard f runs f () and returns its result wrapped in Ok. If -f () raises some exception e, then it fails with Error e

    val guard_str : (unit ‑> 'a) ‑> ('a, string) t

    Same as guard but uses of_exn to print the exception.

    val guard_str_trace : (unit ‑> 'a) ‑> ('a, string) t

    Same as guard_str but uses of_exn_trace instead of of_exn so -that the stack trace is printed.

    val wrap1 : ('a ‑> 'b) ‑> 'a ‑> ('b, exn) t

    Same as guard but gives the function one argument.

    val wrap2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> ('c, exn) t

    Same as guard but gives the function two arguments.

    val wrap3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a ‑> 'b ‑> 'c ‑> ('d, exn) t

    Same as guard but gives the function three arguments.

    Applicative

    val pure : 'a ‑> ('a'errt

    Synonym of return

    val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt

    a <*> b evaluates a and b, and, in case of success, returns +and return acc otherwise, as if the result were a mere option.

    • Since: 1.2
    val is_ok : ('a'errt ‑> bool

    Return true if Ok.

    • Since: 1.0
    val is_error : ('a'errt ‑> bool

    Return true if Error.

    • Since: 1.0

    Wrappers

    val guard : (unit ‑> 'a) ‑> ('a, exn) t

    guard f runs f () and returns its result wrapped in Ok. If +f () raises some exception e, then it fails with Error e.

    val guard_str : (unit ‑> 'a) ‑> ('a, string) t

    Like guard but uses of_exn to print the exception.

    val guard_str_trace : (unit ‑> 'a) ‑> ('a, string) t

    Like guard_str but uses of_exn_trace instead of of_exn so +that the stack trace is printed.

    val wrap1 : ('a ‑> 'b) ‑> 'a ‑> ('b, exn) t

    Like guard but gives the function one argument.

    val wrap2 : ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> ('c, exn) t

    Like guard but gives the function two arguments.

    val wrap3 : ('a ‑> 'b ‑> 'c ‑> 'd) ‑> 'a ‑> 'b ‑> 'c ‑> ('d, exn) t

    Like guard but gives the function three arguments.

    Applicative

    val pure : 'a ‑> ('a'errt

    Synonym of return.

    val (<*>) : ('a ‑> 'b'errt ‑> ('a'errt ‑> ('b'errt

    a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

    val join : (('a'errt'errt ‑> ('a'errt

    join t, in case of success, returns Ok o from Ok (Ok o). Otherwise, it fails with Error e where e is the unwrapped error of t.

    val both : ('a'errt ‑> ('b'errt ‑> ('a * 'b'errt

    both a b, in case of success, returns Ok (o, o') with the ok values @@ -23,4 +24,4 @@ of a and b. Otherwise, it fa error of b if both fail.

    Infix

    module Infix : sig ... end

    Collections

    val map_l : ('a ‑> ('b'errt) ‑> 'a list ‑> ('b list, 'errt
    val fold_l : ('b ‑> 'a ‑> ('b'errt) ‑> 'b ‑> 'a list ‑> ('b'errt
    val fold_seq : ('b ‑> 'a ‑> ('b'errt) ‑> 'b ‑> 'a sequence ‑> ('b'errt

    Misc

    val choose : ('a'errt list ‑> ('a'err list) t

    choose l selects a member of l that is a Ok _ value, or returns Error l otherwise, where l is the list of errors.

    val retry : int ‑> (unit ‑> ('a'errt) ‑> ('a'err list) t

    retry n f calls f at most n times, returning the first result of f () that doesn't fail. If f fails n times, retry n f fails -with the list of successive errors.

    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    val to_opt : ('a_t ‑> 'a option
    val of_opt : 'a option ‑> ('a, string) t
    val to_seq : ('a_t ‑> 'a sequence
    type ('a, 'b) error = [
    | `Ok of 'a
    | `Error of 'b
    ]
    val of_err : ('a'berror ‑> ('a'bt
    • Since: 0.17
    val to_err : ('a'bt ‑> ('a'berror
    • Since: 0.17

    IO

    val pp : 'a printer ‑> ('a, string) t printer
    val pp' : 'a printer ‑> 'e printer ‑> ('a'et printer

    Printer that is generic on the error type

    \ No newline at end of file +with the list of successive errors.

    module type MONAD : sig ... end

    Monadic Operations

    module Traverse : functor (M : MONAD) -> sig ... end

    Conversions

    val to_opt : ('a_t ‑> 'a option

    Convert a result to an option.

    val of_opt : 'a option ‑> ('a, string) t

    Convert an option to a result.

    val to_seq : ('a_t ‑> 'a sequence
    type ('a, 'b) error = [
    | `Ok of 'a
    | `Error of 'b
    ]
    val of_err : ('a'berror ‑> ('a'bt
    • Since: 0.17
    val to_err : ('a'bt ‑> ('a'berror
    • Since: 0.17

    IO

    val pp : 'a printer ‑> ('a, string) t printer
    val pp' : 'a printer ‑> 'e printer ‑> ('a'et printer

    Printer that is generic on the error type.

    \ No newline at end of file diff --git a/2.0/containers/CCResult/module-type-MONAD/index.html b/2.0/containers/CCResult/module-type-MONAD/index.html index 76619ffd..95d076f3 100644 --- a/2.0/containers/CCResult/module-type-MONAD/index.html +++ b/2.0/containers/CCResult/module-type-MONAD/index.html @@ -1,2 +1,2 @@ -MONAD (containers.CCResult.MONAD)

    Module type CCResult.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t
    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t
    \ No newline at end of file +MONAD (containers.CCResult.MONAD)

    Module type CCResult.MONAD

    Monadic Operations

    type 'a t
    val return : 'a ‑> 'a t

    Monadic return.

    val (>>=) : 'a t ‑> ('a ‑> 'b t) ‑> 'b t

    Monadic bind.

    \ No newline at end of file diff --git a/2.0/containers/CCSet/module-type-S/index.html b/2.0/containers/CCSet/module-type-S/index.html index a8bf1e1d..05f676c5 100644 --- a/2.0/containers/CCSet/module-type-S/index.html +++ b/2.0/containers/CCSet/module-type-S/index.html @@ -1,3 +1,3 @@ -S (containers.CCSet.S)

    Module type CCSet.S

    include Set.S
    type elt
    type t
    val empty : t
    val is_empty : t ‑> bool
    val mem : elt ‑> t ‑> bool
    val add : elt ‑> t ‑> t
    val singleton : elt ‑> t
    val remove : elt ‑> t ‑> t
    val union : t ‑> t ‑> t
    val inter : t ‑> t ‑> t
    val diff : t ‑> t ‑> t
    val compare : t ‑> t ‑> int
    val equal : t ‑> t ‑> bool
    val subset : t ‑> t ‑> bool
    val iter : (elt ‑> unit) ‑> t ‑> unit
    val map : (elt ‑> elt) ‑> t ‑> t
    val fold : (elt ‑> 'a ‑> 'a) ‑> t ‑> 'a ‑> 'a
    val for_all : (elt ‑> bool) ‑> t ‑> bool
    val exists : (elt ‑> bool) ‑> t ‑> bool
    val filter : (elt ‑> bool) ‑> t ‑> t
    val partition : (elt ‑> bool) ‑> t ‑> t * t
    val cardinal : t ‑> int
    val elements : t ‑> elt list
    val min_elt : t ‑> elt
    val min_elt_opt : t ‑> elt option
    val max_elt : t ‑> elt
    val max_elt_opt : t ‑> elt option
    val choose : t ‑> elt
    val choose_opt : t ‑> elt option
    val split : elt ‑> t ‑> t * bool * t
    val find : elt ‑> t ‑> elt
    val find_opt : elt ‑> t ‑> elt option
    val find_first : (elt ‑> bool) ‑> t ‑> elt
    val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option
    val find_last : (elt ‑> bool) ‑> t ‑> elt
    val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option
    val of_list : elt list ‑> t
    val min_elt_opt : t ‑> elt option

    Safe version of min_elt.

    • Since: 1.5
    val max_elt_opt : t ‑> elt option

    Safe version of max_elt.

    • Since: 1.5
    val choose_opt : t ‑> elt option

    Safe version of choose.

    • Since: 1.5
    val find_opt : elt ‑> t ‑> elt option

    Safe version of find.

    • Since: 1.5
    val find_first : (elt ‑> bool) ‑> t ‑> elt

    Find minimum element satisfying predicate.

    • Since: 1.5
    val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option

    Safe version of find_first.

    • Since: 1.5
    val find_last : (elt ‑> bool) ‑> t ‑> elt

    Find maximum element satisfying predicate.

    • Since: 1.5
    val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option

    Safe version of find_last.

    • Since: 1.5
    val of_seq : elt sequence ‑> t
    val add_seq : t ‑> elt sequence ‑> t
    • Since: 0.14
    val to_seq : t ‑> elt sequence
    val of_list : elt list ‑> t

    Build a set from the given list of elements, -added in order using add.

    val add_list : t ‑> elt list ‑> t
    • Since: 0.14
    val to_list : t ‑> elt list
    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> elt printer ‑> t printer
    \ No newline at end of file +S (containers.CCSet.S)

    Module type CCSet.S

    include Set.S
    type elt
    type t
    val empty : t
    val is_empty : t ‑> bool
    val mem : elt ‑> t ‑> bool
    val add : elt ‑> t ‑> t
    val singleton : elt ‑> t
    val remove : elt ‑> t ‑> t
    val union : t ‑> t ‑> t
    val inter : t ‑> t ‑> t
    val diff : t ‑> t ‑> t
    val compare : t ‑> t ‑> int
    val equal : t ‑> t ‑> bool
    val subset : t ‑> t ‑> bool
    val iter : (elt ‑> unit) ‑> t ‑> unit
    val map : (elt ‑> elt) ‑> t ‑> t
    val fold : (elt ‑> 'a ‑> 'a) ‑> t ‑> 'a ‑> 'a
    val for_all : (elt ‑> bool) ‑> t ‑> bool
    val exists : (elt ‑> bool) ‑> t ‑> bool
    val filter : (elt ‑> bool) ‑> t ‑> t
    val partition : (elt ‑> bool) ‑> t ‑> t * t
    val cardinal : t ‑> int
    val elements : t ‑> elt list
    val min_elt : t ‑> elt
    val min_elt_opt : t ‑> elt option
    val max_elt : t ‑> elt
    val max_elt_opt : t ‑> elt option
    val choose : t ‑> elt
    val choose_opt : t ‑> elt option
    val split : elt ‑> t ‑> t * bool * t
    val find : elt ‑> t ‑> elt
    val find_opt : elt ‑> t ‑> elt option
    val find_first : (elt ‑> bool) ‑> t ‑> elt
    val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option
    val find_last : (elt ‑> bool) ‑> t ‑> elt
    val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option
    val of_list : elt list ‑> t
    val min_elt_opt : t ‑> elt option

    Safe version of min_elt.

    • Since: 1.5
    val max_elt_opt : t ‑> elt option

    Safe version of max_elt.

    • Since: 1.5
    val choose_opt : t ‑> elt option

    Safe version of choose.

    • Since: 1.5
    val find_opt : elt ‑> t ‑> elt option

    Safe version of find.

    • Since: 1.5
    val find_first : (elt ‑> bool) ‑> t ‑> elt

    Find minimum element satisfying predicate.

    • Since: 1.5
    val find_first_opt : (elt ‑> bool) ‑> t ‑> elt option

    Safe version of find_first.

    • Since: 1.5
    val find_last : (elt ‑> bool) ‑> t ‑> elt

    Find maximum element satisfying predicate.

    • Since: 1.5
    val find_last_opt : (elt ‑> bool) ‑> t ‑> elt option

    Safe version of find_last.

    • Since: 1.5
    val of_seq : elt sequence ‑> t

    Build a set from the given sequence of elements.

    val add_seq : t ‑> elt sequence ‑> t
    • Since: 0.14
    val to_seq : t ‑> elt sequence

    to_seq t converts the set t to a sequence of the elements.

    val of_list : elt list ‑> t

    Build a set from the given list of elements, +added in order using add.

    val add_list : t ‑> elt list ‑> t
    • Since: 0.14
    val to_list : t ‑> elt list

    to_list t converts the set t to a list of the elements.

    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> elt printer ‑> t printer

    Print the set

    \ No newline at end of file diff --git a/2.0/containers/CCString/Sub/index.html b/2.0/containers/CCString/Sub/index.html index 7803eca4..4ff08d6a 100644 --- a/2.0/containers/CCString/Sub/index.html +++ b/2.0/containers/CCString/Sub/index.html @@ -1,4 +1,4 @@ -Sub (containers.CCString.Sub)

    Module CCString.Sub

    type t = string * int * int

    A string, an offset, and the length of the slice.

    val make : string ‑> int ‑> len:int ‑> t
    val full : string ‑> t

    Full string.

    val copy : t ‑> string

    Make a copy of the substring.

    val underlying : t ‑> string
    val sub : t ‑> int ‑> int ‑> t

    Sub-slice.

    val get : t ‑> int ‑> char

    get s i gets the i-th element, or fails.

    • Raises Invalid_argument: if the index is not within 0 ... length - 1.
    • Since: 1.2
    include S with type t := t
    type t
    val length : t ‑> int
    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. -Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen
    val to_seq : t ‑> char sequence
    val to_klist : t ‑> char klist
    val to_list : t ‑> char list
    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. +Sub (containers.CCString.Sub)

    Module CCString.Sub

    type t = string * int * int

    A string, an offset, and the length of the slice.

    val make : string ‑> int ‑> len:int ‑> t
    val full : string ‑> t

    Full string.

    val copy : t ‑> string

    Make a copy of the substring.

    val underlying : t ‑> string
    val sub : t ‑> int ‑> int ‑> t

    Sub-slice.

    val get : t ‑> int ‑> char

    get s i gets the i-th element, or fails.

    • Raises Invalid_argument: if the index is not within 0 ... length - 1.
    • Since: 1.2
    include S with type t := t
    type t
    val length : t ‑> int

    Return the length (number of characters) of the given string.

    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. +Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen

    Return the gen of characters contained in the string

    val to_seq : t ‑> char sequence

    Return the sequence of characters contained in the string

    val to_klist : t ‑> char klist

    Return the klist of characters contained in the string

    val to_list : t ‑> char list

    Return the list of characters contained in the string.

    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. Renamed from print.

    • Since: 2.0
    \ No newline at end of file diff --git a/2.0/containers/CCString/index.html b/2.0/containers/CCString/index.html index c31129be..a9e0a808 100644 --- a/2.0/containers/CCString/index.html +++ b/2.0/containers/CCString/index.html @@ -1,8 +1,8 @@ CCString (containers.CCString)

    Module CCString

    Basic String Utils

    Consider using Containers_string.KMP for pattern search, or Regex -libraries.

    type 'a gen = unit ‑> 'a option
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]

    Common Signature

    module type S : sig ... end

    Strings

    include module type of String
    external length : string ‑> int = "%string_length"
    external get : string ‑> int ‑> char = "%string_safe_get"
    external set : bytes ‑> int ‑> char ‑> unit = "%string_safe_set"
    • Deprecated Use Bytes.set instead.
    external create : int ‑> bytes = "caml_create_string"
    • Deprecated Use Bytes.create instead.
    val make : int ‑> char ‑> string
    val init : int ‑> (int ‑> char) ‑> string
    val copy : string ‑> string
    val sub : string ‑> int ‑> int ‑> string
    val fill : bytes ‑> int ‑> int ‑> char ‑> unit
    • Deprecated Use Bytes.fill instead.
    val blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit
    val concat : string ‑> string list ‑> string
    val iter : (char ‑> unit) ‑> string ‑> unit
    val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit
    val map : (char ‑> char) ‑> string ‑> string
    val mapi : (int ‑> char ‑> char) ‑> string ‑> string
    val trim : string ‑> string
    val escaped : string ‑> string
    val index : string ‑> char ‑> int
    val index_opt : string ‑> char ‑> int option
    val rindex : string ‑> char ‑> int
    val rindex_opt : string ‑> char ‑> int option
    val index_from : string ‑> int ‑> char ‑> int
    val index_from_opt : string ‑> int ‑> char ‑> int option
    val rindex_from : string ‑> int ‑> char ‑> int
    val rindex_from_opt : string ‑> int ‑> char ‑> int option
    val contains : string ‑> char ‑> bool
    val contains_from : string ‑> int ‑> char ‑> bool
    val rcontains_from : string ‑> int ‑> char ‑> bool
    val uppercase : string ‑> string
    • Deprecated Use String.uppercase_ascii instead.
    val lowercase : string ‑> string
    • Deprecated Use String.lowercase_ascii instead.
    val capitalize : string ‑> string
    • Deprecated Use String.capitalize_ascii instead.
    val uncapitalize : string ‑> string
    • Deprecated Use String.uncapitalize_ascii instead.
    val uppercase_ascii : string ‑> string
    val lowercase_ascii : string ‑> string
    val capitalize_ascii : string ‑> string
    val uncapitalize_ascii : string ‑> string
    type t = string
    val compare : t ‑> t ‑> int
    val equal : t ‑> t ‑> bool
    val split_on_char : char ‑> string ‑> string list
    external unsafe_get : string ‑> int ‑> char = "%string_unsafe_get"
    external unsafe_set : bytes ‑> int ‑> char ‑> unit = "%string_unsafe_set"
    external unsafe_blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit = "caml_blit_string"
    external unsafe_fill : bytes ‑> int ‑> int ‑> char ‑> unit = "caml_fill_string"
    val equal : string ‑> string ‑> bool
    val compare : string ‑> string ‑> int
    val is_empty : string ‑> bool
    • Since: 1.5
    val hash : string ‑> int
    val init : int ‑> (int ‑> char) ‑> string

    Analog to Array.init.

    • Since: 0.3.3
    val rev : string ‑> string

    rev s returns the reverse of s.

    • Since: 0.17
    val pad : ?⁠side:[ `Left | `Right ] ‑> ?⁠c:char ‑> int ‑> string ‑> string

    pad n str ensures that str is at least n bytes long, -and pads it on the side with c if it's not the case.

    • Parameter side: determines where padding occurs (default: `Left).
    • Parameter c: the char used to pad (default: ' ').
    • Since: 0.17
    val of_char : char ‑> string

    of_char 'a' = "a".

    • Since: 0.19
    val of_gen : char gen ‑> string
    val of_seq : char sequence ‑> string
    val of_klist : char klist ‑> string
    val of_list : char list ‑> string
    val of_array : char array ‑> string
    val to_array : string ‑> char array
    val find : ?⁠start:int ‑> sub:string ‑> string ‑> int

    Find sub in string, returns its first index or -1.

    val find_all : ?⁠start:int ‑> sub:string ‑> string ‑> int gen

    find_all ~sub s finds all occurrences of sub in s, even overlapping -instances.

    • Parameter start: starting position in s.
    • Since: 0.17
    val find_all_l : ?⁠start:int ‑> sub:string ‑> string ‑> int list

    find_all ~sub s finds all occurrences of sub in s and returns +libraries.

    type 'a gen = unit ‑> 'a option
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]

    Common Signature

    module type S : sig ... end

    Strings

    include module type of String
    external length : string ‑> int = "%string_length"
    external get : string ‑> int ‑> char = "%string_safe_get"
    external set : bytes ‑> int ‑> char ‑> unit = "%string_safe_set"
    • Deprecated Use Bytes.set instead.
    external create : int ‑> bytes = "caml_create_string"
    • Deprecated Use Bytes.create instead.
    val make : int ‑> char ‑> string
    val init : int ‑> (int ‑> char) ‑> string
    val copy : string ‑> string
    val sub : string ‑> int ‑> int ‑> string
    val fill : bytes ‑> int ‑> int ‑> char ‑> unit
    • Deprecated Use Bytes.fill instead.
    val blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit
    val concat : string ‑> string list ‑> string
    val iter : (char ‑> unit) ‑> string ‑> unit
    val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit
    val map : (char ‑> char) ‑> string ‑> string
    val mapi : (int ‑> char ‑> char) ‑> string ‑> string
    val trim : string ‑> string
    val escaped : string ‑> string
    val index : string ‑> char ‑> int
    val index_opt : string ‑> char ‑> int option
    val rindex : string ‑> char ‑> int
    val rindex_opt : string ‑> char ‑> int option
    val index_from : string ‑> int ‑> char ‑> int
    val index_from_opt : string ‑> int ‑> char ‑> int option
    val rindex_from : string ‑> int ‑> char ‑> int
    val rindex_from_opt : string ‑> int ‑> char ‑> int option
    val contains : string ‑> char ‑> bool
    val contains_from : string ‑> int ‑> char ‑> bool
    val rcontains_from : string ‑> int ‑> char ‑> bool
    val uppercase : string ‑> string
    • Deprecated Use String.uppercase_ascii instead.
    val lowercase : string ‑> string
    • Deprecated Use String.lowercase_ascii instead.
    val capitalize : string ‑> string
    • Deprecated Use String.capitalize_ascii instead.
    val uncapitalize : string ‑> string
    • Deprecated Use String.uncapitalize_ascii instead.
    val uppercase_ascii : string ‑> string
    val lowercase_ascii : string ‑> string
    val capitalize_ascii : string ‑> string
    val uncapitalize_ascii : string ‑> string
    type t = string
    val compare : t ‑> t ‑> int
    val equal : t ‑> t ‑> bool
    val split_on_char : char ‑> string ‑> string list
    external unsafe_get : string ‑> int ‑> char = "%string_unsafe_get"
    external unsafe_set : bytes ‑> int ‑> char ‑> unit = "%string_unsafe_set"
    external unsafe_blit : string ‑> int ‑> bytes ‑> int ‑> int ‑> unit = "caml_blit_string"
    external unsafe_fill : bytes ‑> int ‑> int ‑> char ‑> unit = "caml_fill_string"
    val equal : string ‑> string ‑> bool

    Equality function on strings.

    val compare : string ‑> string ‑> int
    val is_empty : string ‑> bool

    is_empty s returns true iff s is empty (i.e. its length is 0).

    • Since: 1.5
    val hash : string ‑> int
    val init : int ‑> (int ‑> char) ‑> string

    Analog to Array.init.

    • Since: 0.3.3
    val rev : string ‑> string

    rev s returns the reverse of s.

    • Since: 0.17
    val pad : ?⁠side:[ `Left | `Right ] ‑> ?⁠c:char ‑> int ‑> string ‑> string

    pad n str ensures that str is at least n bytes long, +and pads it on the side with c if it's not the case.

    • Parameter side: determines where padding occurs (default: `Left).
    • Parameter c: the char used to pad (default: ' ').
    • Since: 0.17
    val of_char : char ‑> string

    of_char 'a' is "a".

    • Since: 0.19
    val of_gen : char gen ‑> string

    Convert a gen of characters to a string.

    val of_seq : char sequence ‑> string

    Convert a sequence of characters to a string.

    val of_klist : char klist ‑> string

    Convert a klist of characters to a string.

    val of_list : char list ‑> string

    Convert a list of characters to a string.

    val of_array : char array ‑> string

    Convert an array of characters to a string.

    val to_array : string ‑> char array

    Return the array of characters contained in the string.

    val find : ?⁠start:int ‑> sub:string ‑> string ‑> int

    Find sub in string, returns its first index or -1.

    val find_all : ?⁠start:int ‑> sub:string ‑> string ‑> int gen

    find_all ~sub s finds all occurrences of sub in s, even overlapping +instances.

    • Parameter start: starting position in s.
    • Since: 0.17
    val find_all_l : ?⁠start:int ‑> sub:string ‑> string ‑> int list

    find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.

    • Parameter start: starting position in s.
    • Since: 0.17
    val mem : ?⁠start:int ‑> sub:string ‑> string ‑> bool

    mem ~sub s is true iff sub is a substring of s.

    • Since: 0.12
    val rfind : sub:string ‑> string ‑> int

    Find sub in string from the right, returns its first index or -1. Should only be used with very small sub.

    • Since: 0.12
    val replace : ?⁠which:[ `Left | `Right | `All ] ‑> sub:string ‑> by:string ‑> string ‑> string

    replace ~sub ~by s replaces some occurrences of sub by by in s.

    • Parameter which: decides whether the occurrences to replace are:

      • `Left first occurrence from the left (beginning)
      • `Right first occurrence from the right (end)
      • `All all occurrences (default)
    • Raises Invalid_argument: if sub = "".
    • Since: 0.14
    val is_sub : sub:string ‑> int ‑> string ‑> int ‑> len:int ‑> bool

    is_sub ~sub i s j ~len returns true iff the substring of @@ -10,8 +10,10 @@ Should only be used with very small sub.

      s starting at position j.

    val repeat : string ‑> int ‑> string

    The same string, repeated n times.

    val prefix : pre:string ‑> string ‑> bool

    prefix ~pre s returns true iff pre is a prefix of s.

    val suffix : suf:string ‑> string ‑> bool

    suffix ~suf s returns true iff suf is a suffix of s.

    • Since: 0.7
    val chop_prefix : pre:string ‑> string ‑> string option

    chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.

    • Since: 0.17
    val chop_suffix : suf:string ‑> string ‑> string option

    chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.

    • Since: 0.17
    val take : int ‑> string ‑> string

    take n s keeps only the n first chars of s.

    • Since: 0.17
    val drop : int ‑> string ‑> string

    drop n s removes the n first chars of s.

    • Since: 0.17
    val take_drop : int ‑> string ‑> string * string

    take_drop n s = take n s, drop n s.

    • Since: 0.17
    val lines : string ‑> string list

    lines s returns a list of the lines of s (splits along '\n').

    • Since: 0.10
    val lines_gen : string ‑> string gen

    lines_gen s returns a generator of the lines of s (splits along '\n').

    • Since: 0.10
    val concat_gen : sep:string ‑> string gen ‑> string

    concat_gen ~sep g concatenates all strings of g, separated with sep.

    • Since: 0.10
    val unlines : string list ‑> string

    unlines l concatenates all strings of l, separated with '\n'.

    • Since: 0.10
    val unlines_gen : string gen ‑> string

    unlines_gen g concatenates all strings of g, separated with '\n'.

    • Since: 0.10
    val set : string ‑> int ‑> char ‑> string

    set s i c creates a new string which is a copy of s, except -for index i, which becomes c.

    • Raises Invalid_argument: if i is an invalid index.
    • Since: 0.12
    val iter : (char ‑> unit) ‑> string ‑> unit

    Alias to String.iter.

    • Since: 0.12
    val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit

    Iter on chars with their index.

    • Since: 0.12
    val map : (char ‑> char) ‑> string ‑> string

    Map chars.

    • Since: 0.12
    val mapi : (int ‑> char ‑> char) ‑> string ‑> string

    Map chars with their index.

    • Since: 0.12
    val filter_map : (char ‑> char option) ‑> string ‑> string
    • Since: 0.17
    val filter : (char ‑> bool) ‑> string ‑> string
    • Since: 0.17
    val flat_map : ?⁠sep:string ‑> (char ‑> string) ‑> string ‑> string

    Map each chars to a string, then concatenates them all.

    • Parameter sep: optional separator between each generated string.
    • Since: 0.12
    val for_all : (char ‑> bool) ‑> string ‑> bool

    True for all chars?

    • Since: 0.12
    val exists : (char ‑> bool) ‑> string ‑> bool

    True for some char?

    • Since: 0.12
    include S with type S.t := string
    type t
    val length : t ‑> int
    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. -Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen
    val to_seq : t ‑> char sequence
    val to_klist : t ‑> char klist
    val to_list : t ‑> char list
    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. +for index i, which becomes c.

    • Raises Invalid_argument: if i is an invalid index.
    • Since: 0.12
    val iter : (char ‑> unit) ‑> string ‑> unit

    Alias to String.iter.

    • Since: 0.12
    val iteri : (int ‑> char ‑> unit) ‑> string ‑> unit

    Iter on chars with their index.

    • Since: 0.12
    val map : (char ‑> char) ‑> string ‑> string

    Map chars.

    • Since: 0.12
    val mapi : (int ‑> char ‑> char) ‑> string ‑> string

    Map chars with their index.

    • Since: 0.12
    val filter_map : (char ‑> char option) ‑> string ‑> string

    filter_map f s calls (f a0) (f a1) ... (f an) where a0 ... an are the characters of s. +It returns the string of characters ci such as f ai = Some ci (when f returns None, +the corresponding element of s is discarded).

    • Since: 0.17
    val filter : (char ‑> bool) ‑> string ‑> string

    filter f s discards characters not satisfying f.

    • Since: 0.17
    val flat_map : ?⁠sep:string ‑> (char ‑> string) ‑> string ‑> string

    Map each chars to a string, then concatenates them all.

    • Parameter sep: optional separator between each generated string.
    • Since: 0.12
    val for_all : (char ‑> bool) ‑> string ‑> bool

    True for all chars?

    • Since: 0.12
    val exists : (char ‑> bool) ‑> string ‑> bool

    True for some char?

    • Since: 0.12
    include S with type S.t := string
    type t
    val length : t ‑> int

    Return the length (number of characters) of the given string.

    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. +Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen

    Return the gen of characters contained in the string

    val to_seq : t ‑> char sequence

    Return the sequence of characters contained in the string

    val to_klist : t ‑> char klist

    Return the klist of characters contained in the string

    val to_list : t ‑> char list

    Return the list of characters contained in the string.

    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. Renamed from print.

    • Since: 2.0
    val ltrim : t ‑> t

    Trim space on the left (see String.trim for more details).

    • Since: 1.2
    val rtrim : t ‑> t

    Trim space on the right (see String.trim for more details).

    • Since: 1.2

    Operations on 2 strings

    val map2 : (char ‑> char ‑> char) ‑> string ‑> string ‑> string

    Map pairs of chars.

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12
    val iter2 : (char ‑> char ‑> unit) ‑> string ‑> string ‑> unit

    Iterate on pairs of chars.

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12
    val iteri2 : (int ‑> char ‑> char ‑> unit) ‑> string ‑> string ‑> unit

    Iterate on pairs of chars with their index.

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12
    val fold2 : ('a ‑> char ‑> char ‑> 'a) ‑> 'a ‑> string ‑> string ‑> 'a

    Fold on pairs of chars.

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12
    val for_all2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> bool

    All pairs of chars respect the predicate?

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12
    val exists2 : (char ‑> char ‑> bool) ‑> string ‑> string ‑> bool

    Exists a pair of chars?

    • Raises Invalid_argument: if the strings have not the same length.
    • Since: 0.12

    Ascii functions

    Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.

    val capitalize_ascii : string ‑> string

    See String.

    • Since: 0.18
    val uncapitalize_ascii : string ‑> string

    See String.

    • Since: 0.18
    val uppercase_ascii : string ‑> string

    See String.

    • Since: 0.18
    val lowercase_ascii : string ‑> string

    See String.

    • Since: 0.18
    val equal_caseless : string ‑> string ‑> bool

    Comparison without respect to ascii lowercase.

    • Since: 1.2

    Finding

    A relatively efficient algorithm for finding sub-strings.

    • Since: 1.0
    module Find : sig ... end

    Splitting

    module Split : sig ... end
    val split_on_char : char ‑> string ‑> string list

    Split the string along the given char.

    • Since: 1.2
    val split : by:string ‑> string ‑> string list

    Alias to Split.list_cpy.

    • Since: 1.2

    Utils

    val compare_versions : string ‑> string ‑> int

    compare_versions a b compares version stringsa and b, considering that numbers are above text.

    • Since: 0.13
    val compare_natural : string ‑> string ‑> int

    Natural Sort Order, comparing chunks of digits as natural numbers. diff --git a/2.0/containers/CCString/module-type-S/index.html b/2.0/containers/CCString/module-type-S/index.html index 699f9a15..72b58e55 100644 --- a/2.0/containers/CCString/module-type-S/index.html +++ b/2.0/containers/CCString/module-type-S/index.html @@ -1,4 +1,4 @@ -S (containers.CCString.S)

    Module type CCString.S

    type t
    val length : t ‑> int
    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. -Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen
    val to_seq : t ‑> char sequence
    val to_klist : t ‑> char klist
    val to_list : t ‑> char list
    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. +S (containers.CCString.S)

    Module type CCString.S

    type t
    val length : t ‑> int

    Return the length (number of characters) of the given string.

    val blit : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unit

    Similar to String.blit. +Compatible with the -safe-string option.

    • Raises Invalid_argument: if indices are not valid.
    val fold : ('a ‑> char ‑> 'a) ‑> 'a ‑> t ‑> 'a

    Fold on chars by increasing index.

    • Since: 0.7

    Conversions

    val to_gen : t ‑> char gen

    Return the gen of characters contained in the string

    val to_seq : t ‑> char sequence

    Return the sequence of characters contained in the string

    val to_klist : t ‑> char klist

    Return the klist of characters contained in the string

    val to_list : t ‑> char list

    Return the list of characters contained in the string.

    val pp_buf : Buffer.t ‑> t ‑> unit

    Renamed from pp.

    • Since: 2.0
    val pp : Format.formatter ‑> t ‑> unit

    Print the string within quotes. Renamed from print.

    • Since: 2.0
    \ No newline at end of file diff --git a/2.0/containers/CCVector/index.html b/2.0/containers/CCVector/index.html index c1753082..9ce4cf5a 100644 --- a/2.0/containers/CCVector/index.html +++ b/2.0/containers/CCVector/index.html @@ -1,23 +1,23 @@ -CCVector (containers.CCVector)

    Module CCVector

    Growable, mutable vector

    type ro = [
    | `RO
    ]
    type rw = [
    | `RW
    ]

    Mutability is rw (read-write) or ro (read-only)

    type ('a, 'mut) t

    The type of a vector of elements of type 'a, with -a mutability flat 'mut

    type 'a vector = ('arwt

    Type synonym: a 'a vector is mutable.

    type 'a ro_vector = ('arot

    Alias for immutable vectors.

    • Since: 0.15
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a gen = unit ‑> 'a option
    type 'a equal = 'a ‑> 'a ‑> bool
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    val freeze : ('a_t ‑> ('arot

    Make an immutable vector (no copy! Don't use the old version)

    val freeze_copy : ('a_t ‑> ('arot

    Copy the vector into an immutable version

    val create : unit ‑> ('arwt

    Create a new, empty vector

    val create_with : ?⁠capacity:int ‑> 'a ‑> ('arwt

    Create a new vector, using the given value as a filler.

    • Parameter capacity: the size of the underlying array -caution: the value will likely not be GC'd before the vector is.
    val return : 'a ‑> ('a'mutt

    Singleton vector

    • Since: 0.14
    val make : int ‑> 'a ‑> ('a'mutt

    make n x makes a vector of size n, filled with x

    val init : int ‑> (int ‑> 'a) ‑> ('a'mutt

    Init the vector with the given function and size

    val clear : ('arwt ‑> unit

    Clear the content of the vector

    val ensure_with : init:'a ‑> ('arwt ‑> int ‑> unit

    Hint to the vector that it should have at least the given capacity.

    • Parameter init: if capacity v = 0, used as a filler -element for the underlying array (see create_with)
    • Since: 0.14
    val ensure : ('arwt ‑> int ‑> unit

    Hint to the vector that it should have at least the given capacity. +CCVector (containers.CCVector)

    Module CCVector

    Growable, mutable vector

    type ro = [
    | `RO
    ]
    type rw = [
    | `RW
    ]

    Mutability is rw (read-write) or ro (read-only).

    type ('a, 'mut) t

    The type of a vector of elements of type 'a, with +a mutability flat 'mut.

    type 'a vector = ('arwt

    Type synonym: a 'a vector is mutable.

    type 'a ro_vector = ('arot

    Alias for immutable vectors.

    • Since: 0.15
    type 'a sequence = ('a ‑> unit) ‑> unit
    type 'a klist = unit ‑> [ `Nil | `Cons of 'a * 'a klist ]
    type 'a gen = unit ‑> 'a option
    type 'a equal = 'a ‑> 'a ‑> bool
    type 'a ord = 'a ‑> 'a ‑> int
    type 'a printer = Format.formatter ‑> 'a ‑> unit
    val freeze : ('a_t ‑> ('arot

    Make an immutable vector (no copy! Don't use the old version).

    val freeze_copy : ('a_t ‑> ('arot

    Copy the vector into an immutable version.

    val create : unit ‑> ('arwt

    Create a new, empty vector.

    val create_with : ?⁠capacity:int ‑> 'a ‑> ('arwt

    Create a new vector, using the given value as a filler.

    • Parameter capacity: the size of the underlying array. +caution: the value will likely not be GC'd before the vector is.
    val return : 'a ‑> ('a'mutt

    Singleton vector.

    • Since: 0.14
    val make : int ‑> 'a ‑> ('a'mutt

    make n x makes a vector of size n, filled with x.

    val init : int ‑> (int ‑> 'a) ‑> ('a'mutt

    Init the vector with the given function and size.

    val clear : ('arwt ‑> unit

    Clear the content of the vector.

    val ensure_with : init:'a ‑> ('arwt ‑> int ‑> unit

    Hint to the vector that it should have at least the given capacity.

    • Parameter init: if capacity v = 0, used as a filler +element for the underlying array (see create_with).
    • Since: 0.14
    val ensure : ('arwt ‑> int ‑> unit

    Hint to the vector that it should have at least the given capacity. Just a hint, will not be enforced if the vector is empty and init -is not provided.

    val is_empty : ('a_t ‑> bool

    Is the vector empty?

    val push : ('arwt ‑> 'a ‑> unit

    Add an element at the end of the vector

    val append : ('arwt ‑> ('a_t ‑> unit

    append a b adds all elements of b to a

    val append_array : ('arwt ‑> 'a array ‑> unit

    Same as append, with an array

    val append_seq : ('arwt ‑> 'a sequence ‑> unit

    Append content of sequence

    val append_list : ('arwt ‑> 'a list ‑> unit

    Append content of list

    • Since: 0.14
    val append_gen : ('arwt ‑> 'a gen ‑> unit

    Append content of generator

    • Since: 0.20
    val equal : 'a equal ‑> ('a_t equal
    val compare : 'a ord ‑> ('a_t ord

    Total ordering on vectors. Lexicographic comparison.

    exception Empty

    Raised on empty stack

    val pop : ('arwt ‑> 'a option

    Remove last element, or None

    val pop_exn : ('arwt ‑> 'a

    Remove last element, or raise a Failure if empty

    • Raises Empty: on an empty vector
    val top : ('a_t ‑> 'a option

    Top element, if present

    • Since: 0.6
    val top_exn : ('a_t ‑> 'a

    Top element, if present

    • Raises Empty: on an empty vector
    • Since: 0.6
    val copy : ('a_t ‑> ('a'mutt

    Shallow copy (may give an immutable or mutable vector)

    val shrink : ('arwt ‑> int ‑> unit

    Shrink to the given size (remove elements above this size). +is not provided.

    val is_empty : ('a_t ‑> bool

    Is the vector empty?

    val push : ('arwt ‑> 'a ‑> unit

    Add an element at the end of the vector.

    val append : ('arwt ‑> ('a_t ‑> unit

    append a b adds all elements of b to a.

    val append_array : ('arwt ‑> 'a array ‑> unit

    Like append, with an array.

    val append_seq : ('arwt ‑> 'a sequence ‑> unit

    Append content of sequence.

    val append_list : ('arwt ‑> 'a list ‑> unit

    Append content of list.

    • Since: 0.14
    val append_gen : ('arwt ‑> 'a gen ‑> unit

    Append content of generator.

    • Since: 0.20
    val equal : 'a equal ‑> ('a_t equal
    val compare : 'a ord ‑> ('a_t ord

    Total ordering on vectors. Lexicographic comparison.

    exception Empty

    Raised on empty stack.

    val pop : ('arwt ‑> 'a option

    Remove last element, or None.

    val pop_exn : ('arwt ‑> 'a

    Remove last element, or raise a Failure if empty.

    • Raises Empty: on an empty vector.
    val top : ('a_t ‑> 'a option

    Top element, if present.

    • Since: 0.6
    val top_exn : ('a_t ‑> 'a

    Top element, if present.

    • Raises Empty: on an empty vector.
    • Since: 0.6
    val copy : ('a_t ‑> ('a'mutt

    Shallow copy (may give an immutable or mutable vector).

    val shrink : ('arwt ‑> int ‑> unit

    Shrink to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size.

    val member : eq:('a ‑> 'a ‑> bool) ‑> 'a ‑> ('a_t ‑> bool

    Is the element a member of the vector?

    val sort : ('a ‑> 'a ‑> int) ‑> ('a_t ‑> ('a'mutt

    Sort the vector, returning a copy of it that is sorted w.r.t the given ordering. The vector itself is unchanged.

    val sort' : ('a ‑> 'a ‑> int) ‑> ('arwt ‑> unit

    Sort the vector in place (modifying it).

    val uniq_sort : ('a ‑> 'a ‑> int) ‑> ('arwt ‑> unit

    Sort the array and remove duplicates, in place (e.g. modifying -the vector itself)

    val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    Iterate on the vector's content

    val iteri : (int ‑> 'a ‑> unit) ‑> ('a_t ‑> unit

    Iterate on the vector, with indexes

    val map : ('a ‑> 'b) ‑> ('a_t ‑> ('b'mutt

    Map elements of the vector, yielding a new vector

    val filter : ('a ‑> bool) ‑> ('a_t ‑> ('a'mutt

    Filter elements from the vector. filter p v leaves v unchanged but -returns a new vector that only contains elements of v satisfying p.

    val filter' : ('a ‑> bool) ‑> ('arwt ‑> unit

    Filter elements in place.

    val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> ('a_t ‑> 'b

    Fold on elements of the vector

    val exists : ('a ‑> bool) ‑> ('a_t ‑> bool

    Existential test (is there an element that satisfies the predicate?)

    val for_all : ('a ‑> bool) ‑> ('a_t ‑> bool

    Universal test (do all the elements satisfy the predicate?)

    val find : ('a ‑> bool) ‑> ('a_t ‑> 'a option

    Find an element that satisfies the predicate

    val find_exn : ('a ‑> bool) ‑> ('a_t ‑> 'a

    Find an element that satisfies the predicate, or

    • Raises Not_found: if no element does
    val find_map : ('a ‑> 'b option) ‑> ('a_t ‑> 'b option

    find_map f v returns the first Some y = f x for x in v, -or None if f x = None for each x in v

    • Since: 0.14
    val filter_map : ('a ‑> 'b option) ‑> ('a_t ‑> ('b'mutt

    Map elements with a function, possibly filtering some of them out

    val flat_map : ('a ‑> ('b_t) ‑> ('a_t ‑> ('b'mutt

    Map each element to a sub-vector

    val flat_map_seq : ('a ‑> 'b sequence) ‑> ('a_t ‑> ('b'mutt

    Like flat_map, but using sequence for +the vector itself).

    val iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    Iterate on the vector's content.

    val iteri : (int ‑> 'a ‑> unit) ‑> ('a_t ‑> unit

    Iterate on the vector, with indexes.

    val map : ('a ‑> 'b) ‑> ('a_t ‑> ('b'mutt

    Map elements of the vector, yielding a new vector.

    val filter : ('a ‑> bool) ‑> ('a_t ‑> ('a'mutt

    Filter elements from the vector. filter p v leaves v unchanged but +returns a new vector that only contains elements of v satisfying p.

    val filter' : ('a ‑> bool) ‑> ('arwt ‑> unit

    Filter elements in place.

    val fold : ('b ‑> 'a ‑> 'b) ‑> 'b ‑> ('a_t ‑> 'b

    Fold on elements of the vector

    val exists : ('a ‑> bool) ‑> ('a_t ‑> bool

    Existential test (is there an element that satisfies the predicate?).

    val for_all : ('a ‑> bool) ‑> ('a_t ‑> bool

    Universal test (do all the elements satisfy the predicate?).

    val find : ('a ‑> bool) ‑> ('a_t ‑> 'a option

    Find an element that satisfies the predicate.

    val find_exn : ('a ‑> bool) ‑> ('a_t ‑> 'a

    Find an element that satisfies the predicate, or

    • Raises Not_found: if no element does.
    val find_map : ('a ‑> 'b option) ‑> ('a_t ‑> 'b option

    find_map f v returns the first Some y = f x for x in v, +or None if f x = None for each x in v.

    • Since: 0.14
    val filter_map : ('a ‑> 'b option) ‑> ('a_t ‑> ('b'mutt

    Map elements with a function, possibly filtering some of them out.

    val flat_map : ('a ‑> ('b_t) ‑> ('a_t ‑> ('b'mutt

    Map each element to a sub-vector.

    val flat_map_seq : ('a ‑> 'b sequence) ‑> ('a_t ‑> ('b'mutt

    Like flat_map, but using sequence for intermediate collections.

    • Since: 0.14
    val flat_map_list : ('a ‑> 'b list) ‑> ('a_t ‑> ('b'mutt

    Like flat_map, but using list for -intermediate collections.

    • Since: 0.14
    val (>>=) : ('a_t ‑> ('a ‑> ('b_t) ‑> ('b'mutt

    Infix version of flat_map

    val (>|=) : ('a_t ‑> ('a ‑> 'b) ‑> ('b'mutt

    Infix version of map

    val get : ('a_t ‑> int ‑> 'a

    Access element by its index, or

    • Raises Invalid_argument: if bad index
    val set : ('arwt ‑> int ‑> 'a ‑> unit

    Modify element at given index, or

    • Raises Invalid_argument: if bad index
    val remove : ('arwt ‑> int ‑> unit

    Remove the n-th element of the vector. Does NOT preserve the order -of the elements (might swap with the last element)

    val rev : ('a_t ‑> ('a'mutt

    Reverse the vector

    val rev_in_place : ('arwt ‑> unit

    Reverse the vector in place

    • Since: 0.14
    val rev_iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    rev_iter f a is the same as iter f (rev a), only more efficient.

    • Since: 0.14
    val size : ('a_t ‑> int

    Number of elements in vector

    val length : (__t ‑> int

    Synonym for size

    val capacity : (__t ‑> int

    Number of elements the vector can contain without being resized

    val unsafe_get_array : ('arwt ‑> 'a array

    Access the underlying shared array (do not modify!). +intermediate collections.

    • Since: 0.14
    val (>>=) : ('a_t ‑> ('a ‑> ('b_t) ‑> ('b'mutt

    Infix version of flat_map.

    val (>|=) : ('a_t ‑> ('a ‑> 'b) ‑> ('b'mutt

    Infix version of map.

    val get : ('a_t ‑> int ‑> 'a

    Access element by its index, or

    • Raises Invalid_argument: if bad index.
    val set : ('arwt ‑> int ‑> 'a ‑> unit

    Modify element at given index, or

    • Raises Invalid_argument: if bad index.
    val remove : ('arwt ‑> int ‑> unit

    Remove the n-th element of the vector. Does NOT preserve the order +of the elements (might swap with the last element).

    val rev : ('a_t ‑> ('a'mutt

    Reverse the vector.

    val rev_in_place : ('arwt ‑> unit

    Reverse the vector in place.

    • Since: 0.14
    val rev_iter : ('a ‑> unit) ‑> ('a_t ‑> unit

    rev_iter f a is the same as iter f (rev a), only more efficient.

    • Since: 0.14
    val size : ('a_t ‑> int

    Number of elements in the vector.

    val length : (__t ‑> int

    Synonym for size.

    val capacity : (__t ‑> int

    Number of elements the vector can contain without being resized.

    val unsafe_get_array : ('arwt ‑> 'a array

    Access the underlying shared array (do not modify!). unsafe_get_array v is longer than size v, but elements at higher index than size v are undefined (do not access!).

    val (--) : int ‑> int ‑> (int, 'mutt

    Range of integers, either ascending or descending (both included, therefore the result is never empty). -Example: 1 -- 10 returns the vector [1;2;3;4;5;6;7;8;9;10]

    val (--^) : int ‑> int ‑> (int, 'mutt

    Range of integers, either ascending or descending, but excluding right., -Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9]

    • Since: 0.17
    val of_array : 'a array ‑> ('a'mutt
    val of_list : 'a list ‑> ('a'mutt
    val to_array : ('a_t ‑> 'a array
    val to_list : ('a_t ‑> 'a list
    val of_seq : ?⁠init:('arwt ‑> 'a sequence ‑> ('arwt
    val to_seq : ('a_t ‑> 'a sequence
    val to_seq_rev : ('a_t ‑> 'a sequence

    to_seq_rev v returns the sequence of elements of v in reverse order, +Example: 1 -- 10 returns the vector [1;2;3;4;5;6;7;8;9;10].

    val (--^) : int ‑> int ‑> (int, 'mutt

    Range of integers, either ascending or descending, but excluding right. +Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9].

    • Since: 0.17
    val of_array : 'a array ‑> ('a'mutt

    of_array a returns a vector corresponding to the array a.

    val of_list : 'a list ‑> ('a'mutt
    val to_array : ('a_t ‑> 'a array

    to_array v returns an array corresponding to the vector v.

    val to_list : ('a_t ‑> 'a list

    Return a list with the elements contained in the vector.

    val of_seq : ?⁠init:('arwt ‑> 'a sequence ‑> ('arwt
    val to_seq : ('a_t ‑> 'a sequence

    Return a sequence with the elements contained in the vector.

    val to_seq_rev : ('a_t ‑> 'a sequence

    to_seq_rev v returns the sequence of elements of v in reverse order, that is, the last elements of v are iterated on first.

    • Since: 0.14
    val slice : ('arwt ‑> 'a array * int * int

    Vector as an array slice. By doing it we expose the internal array, so -be careful!

    val slice_seq : ('a_t ‑> int ‑> int ‑> 'a sequence

    slice_seq v start len is the sequence of elements from v.(start) +be careful!.

    val slice_seq : ('a_t ‑> int ‑> int ‑> 'a sequence

    slice_seq v start len is the sequence of elements from v.(start) to v.(start+len-1).

    val of_klist : ?⁠init:('arwt ‑> 'a klist ‑> ('arwt
    val to_klist : ('a_t ‑> 'a klist
    val of_gen : ?⁠init:('arwt ‑> 'a gen ‑> ('arwt
    val to_gen : ('a_t ‑> 'a gen
    val pp : ?⁠start:string ‑> ?⁠stop:string ‑> ?⁠sep:string ‑> 'a printer ‑> ('a_t printer
    \ No newline at end of file diff --git a/2.0/containers/Containers/Hashtbl/index.html b/2.0/containers/Containers/Hashtbl/index.html index c282298f..3a9eaab3 100644 --- a/2.0/containers/Containers/Hashtbl/index.html +++ b/2.0/containers/Containers/Hashtbl/index.html @@ -1,20 +1,20 @@ -Hashtbl (containers.Containers.Hashtbl)

    Module Containers.Hashtbl

    • Since: 0.14
    include module type of Hashtbl with type Hashtbl.statistics = Hashtbl.statistics and module Hashtbl.Make = Hashtbl.Make and type ('a, 'b) Hashtbl.t = ('a'b) Hashtbl.t
    type ('a, 'b) t = ('a'b) Hashtbl.t
    val create : ?⁠random:bool ‑> int ‑> ('a'bt
    val clear : ('a'bt ‑> unit
    val reset : ('a'bt ‑> unit
    val copy : ('a'bt ‑> ('a'bt
    val add : ('a'bt ‑> 'a ‑> 'b ‑> unit
    val find : ('a'bt ‑> 'a ‑> 'b
    val find_opt : ('a'bt ‑> 'a ‑> 'b option
    val find_all : ('a'bt ‑> 'a ‑> 'b list
    val mem : ('a'bt ‑> 'a ‑> bool
    val remove : ('a'bt ‑> 'a ‑> unit
    val replace : ('a'bt ‑> 'a ‑> 'b ‑> unit
    val iter : ('a ‑> 'b ‑> unit) ‑> ('a'bt ‑> unit
    val filter_map_inplace : ('a ‑> 'b ‑> 'b option) ‑> ('a'bt ‑> unit
    val fold : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> ('a'bt ‑> 'c ‑> 'c
    val length : ('a'bt ‑> int
    val randomize : unit ‑> unit
    val is_randomized : unit ‑> bool
    type statistics = Hashtbl.statistics = {
    num_bindings : int;
    num_buckets : int;
    max_bucket_length : int;
    bucket_histogram : int array;
    }
    val stats : ('a'bt ‑> statistics
    module type HashedType : sig ... end
    module type S : sig ... end
    module Make : functor (H : Hashtbl.HashedType) -> sig ... end
    module type SeededHashedType : sig ... end
    module type SeededS : sig ... end
    module MakeSeeded : functor (H : SeededHashedType) -> sig ... end
    val hash : 'a ‑> int
    val seeded_hash : int ‑> 'a ‑> int
    val hash_param : int ‑> int ‑> 'a ‑> int
    val seeded_hash_param : int ‑> int ‑> int ‑> 'a ‑> int
    include CCHashtbl.Poly
    val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

    Safe version of Hashtbl.find

    val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

    get_or tbl k ~default returns the value associated to k if present, -and returns default otherwise (if k doesn't belong in tbl)

    • Since: 0.16
    val keys : ('a'b) Hashtbl.t ‑> 'a CCHashtbl.sequence

    Iterate on keys (similar order as Hashtbl.iter)

    val values : ('a'b) Hashtbl.t ‑> 'b CCHashtbl.sequence

    Iterate on values in the table

    val keys_list : ('a'b) Hashtbl.t ‑> 'a list

    keys_list t is the list of keys in t.

    • Since: 0.8
    val values_list : ('a'b) Hashtbl.t ‑> 'b list

    values_list t is the list of values in t.

    • Since: 0.8
    val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

    Map on a hashtable's items, collect into a list

    val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

    incr ?by tbl x increments or initializes the counter associated with x. +Hashtbl (containers.Containers.Hashtbl)

    Module Containers.Hashtbl

    • Since: 0.14
    include module type of Hashtbl with type Hashtbl.statistics = Hashtbl.statistics and module Hashtbl.Make = Hashtbl.Make and type ('a, 'b) Hashtbl.t = ('a'b) Hashtbl.t
    type ('a, 'b) t = ('a'b) Hashtbl.t
    val create : ?⁠random:bool ‑> int ‑> ('a'bt
    val clear : ('a'bt ‑> unit
    val reset : ('a'bt ‑> unit
    val copy : ('a'bt ‑> ('a'bt
    val add : ('a'bt ‑> 'a ‑> 'b ‑> unit
    val find : ('a'bt ‑> 'a ‑> 'b
    val find_opt : ('a'bt ‑> 'a ‑> 'b option
    val find_all : ('a'bt ‑> 'a ‑> 'b list
    val mem : ('a'bt ‑> 'a ‑> bool
    val remove : ('a'bt ‑> 'a ‑> unit
    val replace : ('a'bt ‑> 'a ‑> 'b ‑> unit
    val iter : ('a ‑> 'b ‑> unit) ‑> ('a'bt ‑> unit
    val filter_map_inplace : ('a ‑> 'b ‑> 'b option) ‑> ('a'bt ‑> unit
    val fold : ('a ‑> 'b ‑> 'c ‑> 'c) ‑> ('a'bt ‑> 'c ‑> 'c
    val length : ('a'bt ‑> int
    val randomize : unit ‑> unit
    val is_randomized : unit ‑> bool
    type statistics = Hashtbl.statistics = {
    num_bindings : int;
    num_buckets : int;
    max_bucket_length : int;
    bucket_histogram : int array;
    }
    val stats : ('a'bt ‑> statistics
    module type HashedType : sig ... end
    module type S : sig ... end
    module Make : functor (H : Hashtbl.HashedType) -> sig ... end
    module type SeededHashedType : sig ... end
    module type SeededS : sig ... end
    module MakeSeeded : functor (H : SeededHashedType) -> sig ... end
    val hash : 'a ‑> int
    val seeded_hash : int ‑> 'a ‑> int
    val hash_param : int ‑> int ‑> 'a ‑> int
    val seeded_hash_param : int ‑> int ‑> int ‑> 'a ‑> int
    include CCHashtbl.Poly
    val get : ('a'b) Hashtbl.t ‑> 'a ‑> 'b option

    Safe version of Hashtbl.find.

    val get_or : ('a'b) Hashtbl.t ‑> 'a ‑> default:'b ‑> 'b

    get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

    • Since: 0.16
    val keys : ('a'b) Hashtbl.t ‑> 'a CCHashtbl.sequence

    Iterate on keys (similar order as Hashtbl.iter).

    val values : ('a'b) Hashtbl.t ‑> 'b CCHashtbl.sequence

    Iterate on values in the table.

    val keys_list : ('a'b) Hashtbl.t ‑> 'a list

    keys_list t is the list of keys in t.

    • Since: 0.8
    val values_list : ('a'b) Hashtbl.t ‑> 'b list

    values_list t is the list of values in t.

    • Since: 0.8
    val map_list : ('a ‑> 'b ‑> 'c) ‑> ('a'b) Hashtbl.t ‑> 'c list

    Map on a hashtable's items, collect into a list.

    val incr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

    incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; -otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

    • Parameter by: if specified, the int value is incremented by by rather than 1
    • Since: 0.16
    val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

    Same as incr but substract 1 (or the value of by). +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

    • Parameter by: if specified, the int value is incremented by by rather than 1.
    • Since: 0.16
    val decr : ?⁠by:int ‑> ('a, int) Hashtbl.t ‑> 'a ‑> unit

    Like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. -This does nothing if the key is not already present in the table.

    • Since: 0.16
    val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence

    Iterate on bindings in the table

    val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

    add_list tbl x y adds y to the list x is bound to. If x is -not bound, it becomes bound to [y].

    • Since: 0.16
    val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence ‑> unit

    Add the corresponding pairs to the table, using Hashtbl.add.

    • Since: 0.16
    val of_seq : ('a * 'b) CCHashtbl.sequence ‑> ('a'b) Hashtbl.t

    From the given bindings, added in order

    val add_seq_count : ('a, int) Hashtbl.t ‑> 'a CCHashtbl.sequence ‑> unit

    add_seq_count tbl seq increments the count of each element of seq +This does nothing if the key is not already present in the table.

    • Since: 0.16
    val to_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence

    Iterate on bindings in the table.

    val add_list : ('a'b list) Hashtbl.t ‑> 'a ‑> 'b ‑> unit

    add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

    • Since: 0.16
    val add_seq : ('a'b) Hashtbl.t ‑> ('a * 'b) CCHashtbl.sequence ‑> unit

    Add the corresponding pairs to the table, using Hashtbl.add.

    • Since: 0.16
    val of_seq : ('a * 'b) CCHashtbl.sequence ‑> ('a'b) Hashtbl.t

    From the given bindings, added in order.

    val add_seq_count : ('a, int) Hashtbl.t ‑> 'a CCHashtbl.sequence ‑> unit

    add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each -element of seq occurs.

    • Since: 0.16
    val of_seq_count : 'a CCHashtbl.sequence ‑> ('a, int) Hashtbl.t

    Similar to add_seq_count, but allocates a new table and returns it

    • Since: 0.16
    val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

    List of bindings (order unspecified)

    val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

    Build a table from the given list of bindings k_i -> v_i, +element of seq occurs.

    • Since: 0.16
    val of_seq_count : 'a CCHashtbl.sequence ‑> ('a, int) Hashtbl.t

    Similar to add_seq_count, but allocates a new table and returns it.

    • Since: 0.16
    val to_list : ('a'b) Hashtbl.t ‑> ('a * 'b) list

    List of bindings (order unspecified).

    val of_list : ('a * 'b) list ‑> ('a'b) Hashtbl.t

    Build a table from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

    val update : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b option ‑> 'b option) ‑> k:'a ‑> unit

    update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted -using Hashtbl.replace

    • Since: 0.14
    val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

    get_or_add tbl ~k ~f finds and returns the binding of k +using Hashtbl.replace.

    • Since: 0.14
    val get_or_add : ('a'b) Hashtbl.t ‑> f:('a ‑> 'b) ‑> k:'a ‑> 'b

    get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

    • Since: 1.0
    val pp : 'a CCHashtbl.printer ‑> 'b CCHashtbl.printer ‑> ('a'b) Hashtbl.t CCHashtbl.printer
    module type S' = CCHashtbl.S
    module Make' = CCHashtbl.Make
    \ No newline at end of file diff --git a/2.0/containers/Containers/Hashtbl/module-type-S'/index.html b/2.0/containers/Containers/Hashtbl/module-type-S'/index.html index 9ea39c31..8aa1da85 100644 --- a/2.0/containers/Containers/Hashtbl/module-type-S'/index.html +++ b/2.0/containers/Containers/Hashtbl/module-type-S'/index.html @@ -1,20 +1,20 @@ -S' (containers.Containers.Hashtbl.S')

    Module type Containers.Hashtbl.S'

    include Hashtbl.S
    type key
    type 'a t
    val create : int ‑> 'a t
    val clear : 'a t ‑> unit
    val reset : 'a t ‑> unit
    val copy : 'a t ‑> 'a t
    val add : 'a t ‑> key ‑> 'a ‑> unit
    val remove : 'a t ‑> key ‑> unit
    val find : 'a t ‑> key ‑> 'a
    val find_opt : 'a t ‑> key ‑> 'a option
    val find_all : 'a t ‑> key ‑> 'a list
    val replace : 'a t ‑> key ‑> 'a ‑> unit
    val mem : 'a t ‑> key ‑> bool
    val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
    val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
    val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
    val length : 'a t ‑> int
    val stats : 'a t ‑> Hashtbl.statistics
    val get : 'a t ‑> key ‑> 'a option

    Safe version of Hashtbl.find

    val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

    get_or tbl k ~default returns the value associated to k if present, -and returns default otherwise (if k doesn't belong in tbl)

    • Since: 0.16
    val add_list : 'a list t ‑> key ‑> 'a ‑> unit

    add_list tbl x y adds y to the list x is bound to. If x is -not bound, it becomes bound to [y].

    • Since: 0.16
    val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

    incr ?by tbl x increments or initializes the counter associated with x. +S' (containers.Containers.Hashtbl.S')

    Module type Containers.Hashtbl.S'

    include Hashtbl.S
    type key
    type 'a t
    val create : int ‑> 'a t
    val clear : 'a t ‑> unit
    val reset : 'a t ‑> unit
    val copy : 'a t ‑> 'a t
    val add : 'a t ‑> key ‑> 'a ‑> unit
    val remove : 'a t ‑> key ‑> unit
    val find : 'a t ‑> key ‑> 'a
    val find_opt : 'a t ‑> key ‑> 'a option
    val find_all : 'a t ‑> key ‑> 'a list
    val replace : 'a t ‑> key ‑> 'a ‑> unit
    val mem : 'a t ‑> key ‑> bool
    val iter : (key ‑> 'a ‑> unit) ‑> 'a t ‑> unit
    val filter_map_inplace : (key ‑> 'a ‑> 'a option) ‑> 'a t ‑> unit
    val fold : (key ‑> 'a ‑> 'b ‑> 'b) ‑> 'a t ‑> 'b ‑> 'b
    val length : 'a t ‑> int
    val stats : 'a t ‑> Hashtbl.statistics
    val get : 'a t ‑> key ‑> 'a option

    Safe version of Hashtbl.find.

    val get_or : 'a t ‑> key ‑> default:'a ‑> 'a

    get_or tbl k ~default returns the value associated to k if present, +and returns default otherwise (if k doesn't belong in tbl).

    • Since: 0.16
    val add_list : 'a list t ‑> key ‑> 'a ‑> unit

    add_list tbl x y adds y to the list x is bound to. If x is +not bound, it becomes bound to y.

    • Since: 0.16
    val incr : ?⁠by:int ‑> int t ‑> key ‑> unit

    incr ?by tbl x increments or initializes the counter associated with x. If get tbl x = None, then after update, get tbl x = Some 1; -otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

    • Parameter by: if specified, the int value is incremented by by rather than 1
    • Since: 0.16
    val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

    Same as incr but substract 1 (or the value of by). +otherwise, if get tbl x = Some n, now get tbl x = Some (n+1).

    • Parameter by: if specified, the int value is incremented by by rather than 1.
    • Since: 0.16
    val decr : ?⁠by:int ‑> int t ‑> key ‑> unit

    Like incr but subtract 1 (or the value of by). If the value reaches 0, the key is removed from the table. -This does nothing if the key is not already present in the table.

    • Since: 0.16
    val keys : 'a t ‑> key CCHashtbl.sequence

    Iterate on keys (similar order as Hashtbl.iter)

    val values : 'a t ‑> 'a CCHashtbl.sequence

    Iterate on values in the table

    val keys_list : _ t ‑> key list

    keys t is the list of keys in t.

    • Since: 0.8
    val values_list : 'a t ‑> 'a list

    values t is the list of values in t.

    • Since: 0.8
    val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

    Map on a hashtable's items, collect into a list

    val to_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence

    Iterate on values in the table

    val of_seq : (key * 'a) CCHashtbl.sequence ‑> 'a t

    From the given bindings, added in order

    val add_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence ‑> unit

    Add the corresponding pairs to the table, using Hashtbl.add.

    • Since: 0.16
    val add_seq_count : int t ‑> key CCHashtbl.sequence ‑> unit

    add_seq_count tbl seq increments the count of each element of seq +This does nothing if the key is not already present in the table.

    • Since: 0.16
    val keys : 'a t ‑> key CCHashtbl.sequence

    Iterate on keys (similar order as Hashtbl.iter).

    val values : 'a t ‑> 'a CCHashtbl.sequence

    Iterate on values in the table.

    val keys_list : _ t ‑> key list

    keys_list t is the list of keys in t.

    • Since: 0.8
    val values_list : 'a t ‑> 'a list

    values_list t is the list of values in t.

    • Since: 0.8
    val map_list : (key ‑> 'a ‑> 'b) ‑> 'a t ‑> 'b list

    Map on a hashtable's items, collect into a list.

    val to_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence

    Iterate on values in the table.

    val of_seq : (key * 'a) CCHashtbl.sequence ‑> 'a t

    From the given bindings, added in order.

    val add_seq : 'a t ‑> (key * 'a) CCHashtbl.sequence ‑> unit

    Add the corresponding pairs to the table, using Hashtbl.add.

    • Since: 0.16
    val add_seq_count : int t ‑> key CCHashtbl.sequence ‑> unit

    add_seq_count tbl seq increments the count of each element of seq by calling incr. This is useful for counting how many times each -element of seq occurs.

    • Since: 0.16
    val of_seq_count : key CCHashtbl.sequence ‑> int t

    Similar to add_seq_count, but allocates a new table and returns it

    • Since: 0.16
    val to_list : 'a t ‑> (key * 'a) list

    List of bindings (order unspecified)

    val of_list : (key * 'a) list ‑> 'a t

    Build a table from the given list of bindings k_i -> v_i, +element of seq occurs.

    • Since: 0.16
    val of_seq_count : key CCHashtbl.sequence ‑> int t

    Similar to add_seq_count, but allocates a new table and returns it.

    • Since: 0.16
    val to_list : 'a t ‑> (key * 'a) list

    List of bindings (order unspecified).

    val of_list : (key * 'a) list ‑> 'a t

    Build a table from the given list of bindings k_i -> v_i, added in order using add. If a key occurs several times, it will be added several times, and the visible binding will be the last one.

    val update : 'a t ‑> f:(key ‑> 'a option ‑> 'a option) ‑> k:key ‑> unit

    update tbl ~f ~k updates key k by calling f k (Some v) if k was mapped to v, or f k None otherwise; if the call returns None then k is removed/stays removed, if the call returns Some v' then the binding k -> v' is inserted -using Hashtbl.replace

    • Since: 0.14
    val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

    get_or_add tbl ~k ~f finds and returns the binding of k +using Hashtbl.replace.

    • Since: 0.14
    val get_or_add : 'a t ‑> f:(key ‑> 'a) ‑> k:key ‑> 'a

    get_or_add tbl ~k ~f finds and returns the binding of k in tbl, if it exists. If it does not exist, then f k is called to obtain a new binding v; k -> v is added to tbl and v is returned.

    • Since: 1.0
    \ No newline at end of file diff --git a/2.0/index.html b/2.0/index.html index 8f11d831..a8eb8664 100644 --- a/2.0/index.html +++ b/2.0/index.html @@ -10,14 +10,14 @@

    OCaml package documentation

      -
    1. containers 2.0+alpha1
    2. -
    3. containers.data 2.0+alpha1
    4. -
    5. containers.iter 2.0+alpha1
    6. -
    7. containers.monomorphic 2.0+alpha1
    8. -
    9. containers.sexp 2.0+alpha1
    10. -
    11. containers.thread 2.0+alpha1
    12. -
    13. containers.top 2.0+alpha1
    14. -
    15. containers.unix 2.0+alpha1
    16. +
    17. containers 2.0
    18. +
    19. containers.data 2.0
    20. +
    21. containers.iter 2.0
    22. +
    23. containers.monomorphic 2.0
    24. +
    25. containers.sexp 2.0
    26. +
    27. containers.thread 2.0
    28. +
    29. containers.top 2.0
    30. +
    31. containers.unix 2.0