From ad40d3d74f4c8fea34ef9cbb4b9d78bbe226664c Mon Sep 17 00:00:00 2001 From: c-cube Date: Sat, 25 Sep 2021 19:49:48 +0000 Subject: [PATCH] deploy: 6eb885695759b974b65259d0b427ac0a118edc87 --- dev/containers/CCList/index.html | 2 +- dev/containers/CCListLabels/index.html | 2 +- dev/containers/CCOpt/Infix/index.html | 2 -- dev/containers/CCOpt/index.html | 2 +- dev/containers/CCOption/.dune-keep | 0 dev/containers/CCOption/Infix/index.html | 2 ++ dev/containers/CCOption/index.html | 2 ++ dev/containers/CCResult/index.html | 2 +- dev/containers/Containers/index.html | 2 +- dev/containers/ContainersLabels/index.html | 2 +- dev/containers/index.html | 2 +- 11 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 dev/containers/CCOpt/Infix/index.html create mode 100644 dev/containers/CCOption/.dune-keep create mode 100644 dev/containers/CCOption/Infix/index.html create mode 100644 dev/containers/CCOption/index.html diff --git a/dev/containers/CCList/index.html b/dev/containers/CCList/index.html index f3f6f1a0..50ea0338 100644 --- a/dev/containers/CCList/index.html +++ b/dev/containers/CCList/index.html @@ -3,7 +3,7 @@ [[1;3;4];[1;3;5];[1;3;6];[2;3;4];[2;3;5];[2;3;6]];; # cartesian_product [[1;2];[];[4;5;6]] = [];; # cartesian_product [[1;2];[3];[4];[5];[6]] |> sort = -[[1;3;4;5;6];[2;3;4;5;6]];;

invariant: cartesian_product l = map_product id l.

since
1.2, but only
since
2.2 with labels
val map_product_l : ('a -> 'b list) -> 'a list -> 'b list list

map_product_l f l maps each element of l to a list of objects of type 'b using f. We obtain [l1; l2; …; ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.

since
1.2, but only
since
2.2 with labels
val diagonal : 'a t -> ('a * 'a) t

diagonal l returns all pairs of distinct positions of the list l, that is the list of List.nth i l, List.nth j l if i < j.

val partition_map_either : ('a -> ('b'c) CCEither.t) -> 'a list -> 'b list * 'c list

partition_map_either 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.
since
3.3
val partition_filter_map : ('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list

partition_filter_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
3.3
val partition_map : ('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list
deprecated

use partition_filter_map instead

since
0.11
val group_by : ?⁠hash:('a -> int) -> ?⁠eq:('a -> 'a -> bool) -> 'a t -> 'a list t

group_by ?hash ?eq l groups equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

since
2.3
val join_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val join_all_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a list -> 'b list -> 'c option) -> 'a t -> 'b t -> 'c t

join_all_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?⁠eq:('a -> 'a -> bool) -> ?⁠hash:('a -> int) -> ('b -> 'a) -> 'a t -> 'b t -> ('a * 'b list) t

group_join_by ?eq ?hash key la lb associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val sublists_of_len : ?⁠last:('a list -> 'a list option) -> ?⁠offset:int -> int -> 'a list -> 'a list list

sublists_of_len ?last ?offset 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].

Examples:

  • sublists_of_len 2 [1;2;3;4;5;6] = [[1;2]; [3;4]; [5;6]].
  • sublists_of_len 2 ~offset:3 [1;2;3;4;5;6] = [1;2];[4;5].
  • sublists_of_len 3 ~last:CCOpt.return [1;2;3;4] = [1;2;3];[4].
  • sublists_of_len 2 [1;2;3;4;5] = [[1;2]; [3;4]].
parameter offset

the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.

parameter last

if provided and the last group of elements g is such 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. See CCList.sublists_of_len for more details.

since
1.0, but only
since
1.5 with labels
val chunks : int -> 'a list -> 'a list list

chunks n l returns consecutives chunks of size at most n from l. Each item of l will occur in exactly one chunk. Only the last chunk might be of length smaller than n. Invariant: (chunks n l |> List.flatten) = l.

since
3.2
val intersperse : 'a -> 'a list -> 'a list

intersperse x l inserts the element x between adjacent elements of the list l.

since
2.1, but only
since
2.2 with labels
val interleave : 'a list -> 'a list -> 'a list

interleave [x1…xn] [y1…ym] is [x1;y1;x2;y2;…] and finishes with the suffix of the longest list.

since
2.1, but only
since
2.2 with labels
val pure : 'a -> 'a t

pure x is return x.

val mguard : bool -> unit t

mguard c is pure () if c is true, [] otherwise. This is useful to define a list by comprehension, e.g.:

# let square_even xs =
+[[1;3;4;5;6];[2;3;4;5;6]];;

invariant: cartesian_product l = map_product id l.

since
1.2, but only
since
2.2 with labels
val map_product_l : ('a -> 'b list) -> 'a list -> 'b list list

map_product_l f l maps each element of l to a list of objects of type 'b using f. We obtain [l1; l2; …; ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.

since
1.2, but only
since
2.2 with labels
val diagonal : 'a t -> ('a * 'a) t

diagonal l returns all pairs of distinct positions of the list l, that is the list of List.nth i l, List.nth j l if i < j.

val partition_map_either : ('a -> ('b'c) CCEither.t) -> 'a list -> 'b list * 'c list

partition_map_either 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.
since
3.3
val partition_filter_map : ('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list

partition_filter_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
3.3
val partition_map : ('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list
deprecated

use partition_filter_map instead

since
0.11
val group_by : ?⁠hash:('a -> int) -> ?⁠eq:('a -> 'a -> bool) -> 'a t -> 'a list t

group_by ?hash ?eq l groups equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

since
2.3
val join_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val join_all_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a list -> 'b list -> 'c option) -> 'a t -> 'b t -> 'c t

join_all_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?⁠eq:('a -> 'a -> bool) -> ?⁠hash:('a -> int) -> ('b -> 'a) -> 'a t -> 'b t -> ('a * 'b list) t

group_join_by ?eq ?hash key la lb associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x=hash y must hold.

since
2.3
val sublists_of_len : ?⁠last:('a list -> 'a list option) -> ?⁠offset:int -> int -> 'a list -> 'a list list

sublists_of_len ?last ?offset 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].

Examples:

  • sublists_of_len 2 [1;2;3;4;5;6] = [[1;2]; [3;4]; [5;6]].
  • sublists_of_len 2 ~offset:3 [1;2;3;4;5;6] = [1;2];[4;5].
  • sublists_of_len 3 ~last:CCOption.return [1;2;3;4] = [1;2;3];[4].
  • sublists_of_len 2 [1;2;3;4;5] = [[1;2]; [3;4]].
parameter offset

the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.

parameter last

if provided and the last group of elements g is such that length g < n, last g is called. If last g = Some g', g' is appended; otherwise g is dropped. If last = CCOption.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. See CCList.sublists_of_len for more details.

since
1.0, but only
since
1.5 with labels
val chunks : int -> 'a list -> 'a list list

chunks n l returns consecutives chunks of size at most n from l. Each item of l will occur in exactly one chunk. Only the last chunk might be of length smaller than n. Invariant: (chunks n l |> List.flatten) = l.

since
3.2
val intersperse : 'a -> 'a list -> 'a list

intersperse x l inserts the element x between adjacent elements of the list l.

since
2.1, but only
since
2.2 with labels
val interleave : 'a list -> 'a list -> 'a list

interleave [x1…xn] [y1…ym] is [x1;y1;x2;y2;…] and finishes with the suffix of the longest list.

since
2.1, but only
since
2.2 with labels
val pure : 'a -> 'a t

pure x is return x.

val mguard : bool -> unit t

mguard c is pure () if c is true, [] otherwise. This is useful to define a list by comprehension, e.g.:

# let square_even xs =
       let* x = xs in
       let* () = mguard (x mod 2 = 0) in
       return @@ x * x;;
diff --git a/dev/containers/CCListLabels/index.html b/dev/containers/CCListLabels/index.html
index 155fbca8..e7727757 100644
--- a/dev/containers/CCListLabels/index.html
+++ b/dev/containers/CCListLabels/index.html
@@ -3,7 +3,7 @@
 [[1;3;4];[1;3;5];[1;3;6];[2;3;4];[2;3;5];[2;3;6]];;
 # cartesian_product [[1;2];[];[4;5;6]] = [];;
 # cartesian_product [[1;2];[3];[4];[5];[6]] |> sort =
-[[1;3;4;5;6];[2;3;4;5;6]];;

invariant: cartesian_product l = map_product id l.

since
1.2, but only
since
2.2 with labels
val map_product_l : f:('a -> 'b list) -> 'a list -> 'b list list

map_product_l ~f l maps each element of l to a list of objects of type 'b using f. We obtain [l1; l2; …; ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.

since
1.2, but only
since
2.2 with labels
val diagonal : 'a t -> ('a * 'a) t

diagonal l returns all pairs of distinct positions of the list l, that is the list of List.nth i l, List.nth j l if i < j.

val partition_map_either : f:('a -> ('b'c) CCEither.t) -> 'a list -> 'b list * 'c list

partition_map_either ~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.
since
3.3
val partition_filter_map : f:('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list

partition_filter_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 partition_map : f:('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list
deprecated

use partition_filter_map instead

val group_by : ?⁠hash:('a -> int) -> ?⁠eq:('a -> 'a -> bool) -> 'a t -> 'a list t

group_by ?hash ?eq l groups equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

since
2.3
val join_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val join_all_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a list -> 'b list -> 'c option) -> 'a t -> 'b t -> 'c t

join_all_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?⁠eq:('a -> 'a -> bool) -> ?⁠hash:('a -> int) -> ('b -> 'a) -> 'a t -> 'b t -> ('a * 'b list) t

group_join_by ?eq ?hash key la lb associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val sublists_of_len : ?⁠last:('a list -> 'a list option) -> ?⁠offset:int -> len:int -> 'a list -> 'a list list

sublists_of_len ?last ?offset 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].

Examples:

  • sublists_of_len 2 [1;2;3;4;5;6] = [[1;2]; [3;4]; [5;6]].
  • sublists_of_len 2 ~offset:3 [1;2;3;4;5;6] = [1;2];[4;5].
  • sublists_of_len 3 ~last:CCOpt.return [1;2;3;4] = [1;2;3];[4].
  • sublists_of_len 2 [1;2;3;4;5] = [[1;2]; [3;4]].
parameter offset

the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.

parameter last

if provided and the last group of elements g is such 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. See CCList.sublists_of_len for more details.

since
1.0, but only
since
1.5 with labels
val chunks : int -> 'a list -> 'a list list

chunks n l returns consecutives chunks of size at most n from l. Each item of l will occur in exactly one chunk. Only the last chunk might be of length smaller than n. Invariant: (chunks n l |> List.flatten) = l.

since
3.2
val intersperse : x:'a -> 'a list -> 'a list

intersperse ~x l inserts the element x between adjacent elements of the list l.

since
2.1, but only
since
2.2 with labels
val interleave : 'a list -> 'a list -> 'a list

interleave [x1…xn] [y1…ym] is [x1,y1,x2,y2,…] and finishes with the suffix of the longest list.

since
2.1, but only
since
2.2 with labels
val pure : 'a -> 'a t

pure x is return x.

val mguard : bool -> unit t

mguard c is pure () if c is true, [] otherwise. This is useful to define a list by comprehension, e.g.:

# let square_even xs =
+[[1;3;4;5;6];[2;3;4;5;6]];;

invariant: cartesian_product l = map_product id l.

since
1.2, but only
since
2.2 with labels
val map_product_l : f:('a -> 'b list) -> 'a list -> 'b list list

map_product_l ~f l maps each element of l to a list of objects of type 'b using f. We obtain [l1; l2; …; ln] where length l=n and li : 'b list. Then, it returns all the ways of picking exactly one element per li.

since
1.2, but only
since
2.2 with labels
val diagonal : 'a t -> ('a * 'a) t

diagonal l returns all pairs of distinct positions of the list l, that is the list of List.nth i l, List.nth j l if i < j.

val partition_map_either : f:('a -> ('b'c) CCEither.t) -> 'a list -> 'b list * 'c list

partition_map_either ~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.
since
3.3
val partition_filter_map : f:('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list

partition_filter_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 partition_map : f:('a -> [< `Left of 'b | `Right of 'c | `Drop ]) -> 'a list -> 'b list * 'c list
deprecated

use partition_filter_map instead

val group_by : ?⁠hash:('a -> int) -> ?⁠eq:('a -> 'a -> bool) -> 'a t -> 'a list t

group_by ?hash ?eq l groups equal elements, regardless of their order of appearance. precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val join : join_row:('a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join ~join_row a b combines every element of a with every element of b using join_row. If join_row returns None, then the two elements do not combine. Assume that b allows for multiple iterations.

since
2.3
val join_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t

join_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and combine values (x,y) from (a,b) with the same key using merge. If merge returns None, the combination of values is discarded. precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val join_all_by : ?⁠eq:('key -> 'key -> bool) -> ?⁠hash:('key -> int) -> ('a -> 'key) -> ('b -> 'key) -> merge:('key -> 'a list -> 'b list -> 'c option) -> 'a t -> 'b t -> 'c t

join_all_by ?eq ?hash key1 key2 ~merge la lb is a binary operation that takes two sequences a and b, projects their elements resp. with key1 and key2, and, for each key k occurring in at least one of them:

  • compute the list l1 of elements of a that map to k
  • compute the list l2 of elements of b that map to k
  • call merge k l1 l2. If merge returns None, the combination of values is discarded, otherwise it returns Some c and c is inserted in the result.
since
2.3
val group_join_by : ?⁠eq:('a -> 'a -> bool) -> ?⁠hash:('a -> int) -> ('b -> 'a) -> 'a t -> 'b t -> ('a * 'b list) t

group_join_by ?eq ?hash key la lb associates to every element x of the first sequence, all the elements y of the second sequence such that eq x (key y). Elements of the first sequences without corresponding values in the second one are mapped to [] precondition: for any x and y, if eq x y then hash x = hash y must hold.

since
2.3
val sublists_of_len : ?⁠last:('a list -> 'a list option) -> ?⁠offset:int -> len:int -> 'a list -> 'a list list

sublists_of_len ?last ?offset 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].

Examples:

  • sublists_of_len 2 [1;2;3;4;5;6] = [[1;2]; [3;4]; [5;6]].
  • sublists_of_len 2 ~offset:3 [1;2;3;4;5;6] = [1;2];[4;5].
  • sublists_of_len 3 ~last:CCOption.return [1;2;3;4] = [1;2;3];[4].
  • sublists_of_len 2 [1;2;3;4;5] = [[1;2]; [3;4]].
parameter offset

the number of elements skipped between two consecutive sub-lists. By default it is n. If offset < n, the sub-lists will overlap; if offset > n, some elements will not appear at all.

parameter last

if provided and the last group of elements g is such that length g < n, last g is called. If last g = Some g', g' is appended; otherwise g is dropped. If last = CCOption.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. See CCList.sublists_of_len for more details.

since
1.0, but only
since
1.5 with labels
val chunks : int -> 'a list -> 'a list list

chunks n l returns consecutives chunks of size at most n from l. Each item of l will occur in exactly one chunk. Only the last chunk might be of length smaller than n. Invariant: (chunks n l |> List.flatten) = l.

since
3.2
val intersperse : x:'a -> 'a list -> 'a list

intersperse ~x l inserts the element x between adjacent elements of the list l.

since
2.1, but only
since
2.2 with labels
val interleave : 'a list -> 'a list -> 'a list

interleave [x1…xn] [y1…ym] is [x1,y1,x2,y2,…] and finishes with the suffix of the longest list.

since
2.1, but only
since
2.2 with labels
val pure : 'a -> 'a t

pure x is return x.

val mguard : bool -> unit t

mguard c is pure () if c is true, [] otherwise. This is useful to define a list by comprehension, e.g.:

# let square_even xs =
       let* x = xs in
       let* () = mguard (x mod 2 = 0) in
       return @@ x * x;;
diff --git a/dev/containers/CCOpt/Infix/index.html b/dev/containers/CCOpt/Infix/index.html
deleted file mode 100644
index 7df5e042..00000000
--- a/dev/containers/CCOpt/Infix/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Infix (containers.CCOpt.Infix)

Module CCOpt.Infix

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

o >|= f is map f o.

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

o >>= f is the monadic bind.

val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ('a -> 'b) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S with type 'a t_let := 'a option
type 'a t_let
val let+ : 'a t_let -> ('a -> 'b) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ('a -> 'b t_let) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let
\ No newline at end of file diff --git a/dev/containers/CCOpt/index.html b/dev/containers/CCOpt/index.html index 92371ffd..e11eacb4 100644 --- a/dev/containers/CCOpt/index.html +++ b/dev/containers/CCOpt/index.html @@ -1,2 +1,2 @@ -CCOpt (containers.CCOpt)

Module CCOpt

Options

type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, 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 comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

since
3.5
val none : 'a t

Alias to None.

since
3.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

o >|= f is the infix version of map.

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

flat_map f o is equivalent to map followed by flatten. Flip version of >>=.

val bind : 'a t -> ('a -> 'b t) -> 'b t

bind o f is f v if o is Some v, None otherwise. Monadic bind.

since
3.0
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

o >>= f is the infix version of bind.

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

iter f o applies f to o. Iterate on 0 or 1 element.

val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. 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

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

since
0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f 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 is None.

since
0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

since
2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

raises Invalid_argument

if the option is None.

deprecated

use get_exn_or instead

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

raises Invalid_argument

if the option is None.

since
3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is 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 ?handler 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 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an 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

f <$> o is like map f o.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

since
1.2
val or_lazy : else_:(unit -> 'a t) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

since
1.2
val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

since
2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

since
2.2

Infix Operators

since
0.16
module Infix : sig ... end

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S with type 'a t_let := 'a option
type 'a t_let
val let+ : 'a t_let -> ('a -> 'b) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ('a -> 'b t_let) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ('a'e) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

since
1.2
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a'e) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

since
1.2
val of_result : ('a_) Stdlib.result -> 'a t

of_result result returns an option from a result.

since
1.2
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

since
3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

since
3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

since
3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

since
2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

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

Module CCOpt

include module type of CCOption
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, 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 comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

since
3.5
val none : 'a t

Alias to None.

since
3.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

o >|= f is the infix version of map.

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

flat_map f o is equivalent to map followed by flatten. Flip version of >>=.

val bind : 'a t -> ('a -> 'b t) -> 'b t

bind o f is f v if o is Some v, None otherwise. Monadic bind.

since
3.0
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

o >>= f is the infix version of bind.

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

iter f o applies f to o. Iterate on 0 or 1 element.

val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. 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

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

since
0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f 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 is None.

since
0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

since
2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

raises Invalid_argument

if the option is None.

deprecated

use get_exn_or instead

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

raises Invalid_argument

if the option is None.

since
3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is 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 ?handler 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 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an 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

f <$> o is like map f o.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

since
1.2
val or_lazy : else_:(unit -> 'a t) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

since
1.2
val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

since
2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

since
2.2

Infix Operators

since
0.16
module Infix = CCOption.Infix

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S with type 'a t_let := 'a option
type 'a t_let
val let+ : 'a t_let -> ('a -> 'b) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ('a -> 'b t_let) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ('a'e) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

since
1.2
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a'e) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

since
1.2
val of_result : ('a_) Stdlib.result -> 'a t

of_result result returns an option from a result.

since
1.2
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

since
3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

since
3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

since
3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

since
2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file diff --git a/dev/containers/CCOption/.dune-keep b/dev/containers/CCOption/.dune-keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/containers/CCOption/Infix/index.html b/dev/containers/CCOption/Infix/index.html new file mode 100644 index 00000000..a430e287 --- /dev/null +++ b/dev/containers/CCOption/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (containers.CCOption.Infix)

Module CCOption.Infix

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

o >|= f is map f o.

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

o >>= f is the monadic bind.

val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

f <*> o returns Some (f x) if o is Some x and None if o is None.

val (<$>) : ('a -> 'b) -> 'a t -> 'b t

f <$> o is like map f o.

val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S with type 'a t_let := 'a option
type 'a t_let
val let+ : 'a t_let -> ('a -> 'b) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ('a -> 'b t_let) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let
\ No newline at end of file diff --git a/dev/containers/CCOption/index.html b/dev/containers/CCOption/index.html new file mode 100644 index 00000000..c152c406 --- /dev/null +++ b/dev/containers/CCOption/index.html @@ -0,0 +1,2 @@ + +CCOption (containers.CCOption)

Module CCOption

Options

This module replaces `CCOpt`.

since
NEXT_RELEASE
type +'a t = 'a option
val map : ('a -> 'b) -> 'a t -> 'b t

map f o applies the function f to the element inside o, 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 comp o1 o2 compares two options o1 and o2, using custom comparators comp for the value. None is always assumed to be less than Some _.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.

val return : 'a -> 'a t

return x is a monadic return, that is return x = Some x.

val some : 'a -> 'a t

Alias to return.

since
3.5
val none : 'a t

Alias to None.

since
3.5
val (>|=) : 'a t -> ('a -> 'b) -> 'b t

o >|= f is the infix version of map.

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

flat_map f o is equivalent to map followed by flatten. Flip version of >>=.

val bind : 'a t -> ('a -> 'b t) -> 'b t

bind o f is f v if o is Some v, None otherwise. Monadic bind.

since
3.0
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

o >>= f is the infix version of bind.

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

iter f o applies f to o. Iterate on 0 or 1 element.

val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a

fold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.

val filter : ('a -> bool) -> 'a t -> 'a t

filter f o returns Some x if o is Some x and f x is true, or None if f x is false or if o is None. 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

exists f o returns true iff there exists an element for which the provided function f evaluates to true.

since
0.17
val for_all : ('a -> bool) -> 'a t -> bool

for_all f o returns true iff the provided function f 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 is None.

since
0.18
val value : 'a t -> default:'a -> 'a

value o ~default is similar to the Stdlib's Option.value and to get_or.

since
2.8
val get_exn : 'a t -> 'a

get_exn o returns x if o is Some x or fails if o is None.

raises Invalid_argument

if the option is None.

deprecated

use get_exn_or instead

val get_exn_or : string -> 'a t -> 'a

get_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.

raises Invalid_argument

if the option is None.

since
3.4
val get_lazy : (unit -> 'a) -> 'a t -> 'a

get_lazy default_fn o unwraps o, but if o is 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 ?handler 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 ?handler f x y is similar to wrap but for binary functions.

Applicative

val pure : 'a -> 'a t

pure x is an 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

f <$> o is like map f o.

Alternatives

val or_ : else_:'a t -> 'a t -> 'a t

or_ ~else_ o is o if o is Some _, else_ if o is None.

since
1.2
val or_lazy : else_:(unit -> 'a t) -> 'a t -> 'a t

or_lazy ~else_ o is o if o is Some _, else_ () if o is None.

since
1.2
val (<+>) : 'a t -> 'a t -> 'a t

o1 <+> o2 is o1 if o1 is Some _, o2 if o1 is None.

val choice : 'a t list -> 'a t

choice lo returns the first non-None element of the list lo, or None.

val flatten : 'a t t -> 'a t

flatten oo transforms Some x into x.

since
2.2
val return_if : bool -> 'a -> 'a t

return_if b x applies Some or None depending on the boolean b. More precisely, return_if false x is None, and return_if true x is Some x.

since
2.2

Infix Operators

since
0.16
module Infix : sig ... end

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S with type 'a t_let := 'a option
type 'a t_let
val let+ : 'a t_let -> ('a -> 'b) -> 'b t_let
val and+ : 'a t_let -> 'b t_let -> ('a * 'b) t_let
val let* : 'a t_let -> ('a -> 'b t_let) -> 'b t_let
val and* : 'a t_let -> 'b t_let -> ('a * 'b) t_let

Conversion and IO

val to_list : 'a t -> 'a list

to_list o returns [x] if o is Some x or the empty list [] if o is None.

val of_list : 'a list -> 'a t

of_list l returns Some x (x being the head of the list l), or None if l is the empty list.

val to_result : 'e -> 'a t -> ('a'e) Stdlib.result

to_result e o returns Ok x if o is Some x, or Error e if o is None.

since
1.2
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a'e) Stdlib.result

to_result_lazy f o returns Ok x if o is Some x or Error f if o is None.

since
1.2
val of_result : ('a_) Stdlib.result -> 'a t

of_result result returns an option from a result.

since
1.2
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a random_gen = Stdlib.Random.State.t -> 'a
val random : 'a random_gen -> 'a t random_gen
val choice_iter : 'a t iter -> 'a t

choice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.

since
3.0
val choice_seq : 'a t Stdlib.Seq.t -> 'a t

choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.

since
3.0
val to_gen : 'a t -> 'a gen

to_gen o is o as a gen. Some x is the singleton gen containing x and None is the empty gen.

val to_seq : 'a t -> 'a Stdlib.Seq.t

to_seq o is o as a sequence Seq.t. Some x is the singleton sequence containing x and None is the empty sequence. Same as Stdlib.Option.to_seq Renamed from to_std_seq since 3.0.

since
3.0
val to_iter : 'a t -> 'a iter

to_iter o returns an internal iterator, like in the library Iter.

since
2.8
val pp : 'a printer -> 'a t printer

pp ppf o pretty-prints option o using ppf.

\ No newline at end of file diff --git a/dev/containers/CCResult/index.html b/dev/containers/CCResult/index.html index c532a149..937e237a 100644 --- a/dev/containers/CCResult/index.html +++ b/dev/containers/CCResult/index.html @@ -1,2 +1,2 @@ -CCResult (containers.CCResult)

Module CCResult

Error Monad

Uses the new "result" type from OCaml 4.03.

since
0.16
type 'a iter = ('a -> unit) -> unit

Fast internal iterator.

since
2.8
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type nonrec (+'good, +'bad) result = ('good'bad) Stdlib.result =
| Ok of 'good
| Error of 'bad
type (+'good, +'bad) t = ('good'bad) result =
| Ok of 'good
| Error of 'bad
val return : 'a -> ('a'err) t

Successfully return a value.

val fail : 'err -> ('a'err) t

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, Stdlib.Buffer.t, unit, ('b, string) t) Stdlib.format4 -> 'a

fail_printf format uses format to obtain an error message and then returns Error msg.

val fail_fprintf : ('a, Stdlib.Format.formatter, unit, ('b, string) t) Stdlib.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, Stdlib.Format.formatter, unit, ('b, string) t -> ('b, string) t) Stdlib.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'err) t -> ('b'err) t

Map on success.

val map_err : ('err1 -> 'err2) -> ('a'err1) t -> ('a'err2) t

Map on the error variant.

val map2 : ('a -> 'b) -> ('err1 -> 'err2) -> ('a'err1) t -> ('b'err2) t

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.

val iter_err : ('err -> unit) -> (_'err) t -> unit

Apply the function in case of Error.

since
2.4
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 get_lazy : ('e -> 'a) -> ('a'e) t -> 'a

get_lazy f e returns x if e = Ok x, f msg if e = Error msg. This is similar to CCOpt.get_lazy.

since
3.0
val get_or_failwith : ('a, string) t -> 'a

get_or_failwith e returns x if e = Ok x, fails otherwise.

raises Failure

with msg if e = Error msg.

since
2.4
val get_lazy : ('b -> 'a) -> ('a'b) t -> 'a

get_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.

since
3.0
val map_or : ('a -> 'b) -> ('a'c) t -> default:'b -> 'b

map_or f e ~default returns f x if e = Ok x, default otherwise.

val catch : ('a'err) t -> 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'err) t) -> ('a'err) t -> ('b'err) t
val equal : err:'err equal -> 'a equal -> ('a'err) t equal
val compare : err:'err ord -> 'a ord -> ('a'err) t ord
val fold : ok:('a -> 'b) -> error:('err -> 'b) -> ('a'err) t -> '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'err) t -> bool

Return true if Ok.

since
1.0
val is_error : ('a'err) t -> 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'err) t

Synonym of return.

val join : (('a'err) t'err) t -> ('a'err) t

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'err) t -> ('b'err) t -> ('a * 'b'err) t

both a b, in case of success, returns Ok (o, o') with the ok values of a and b. Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Infix

module Infix : sig ... end
include module type of Infix
val (<$>) : ('a -> 'b) -> ('a'err) t -> ('b'err) t

Infix version of map.

since
3.0
val (>|=) : ('a'err) t -> ('a -> 'b) -> ('b'err) t

Infix version of map with reversed arguments.

val (>>=) : ('a'err) t -> ('a -> ('b'err) t) -> ('b'err) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ('a -> 'b'err) t -> ('a'err) t -> ('b'err) t

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.

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a'e) result
type ('a, 'e) t_let2
val let+ : ('a'e) t_let2 -> ('a -> 'b) -> ('b'e) t_let2
val and+ : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2
val let* : ('a'e) t_let2 -> ('a -> ('b'e) t_let2) -> ('b'e) t_let2
val and* : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a'e) result
type ('a, 'e) t_let2
val let+ : ('a'e) t_let2 -> ('a -> 'b) -> ('b'e) t_let2
val and+ : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2
val let* : ('a'e) t_let2 -> ('a -> ('b'e) t_let2) -> ('b'e) t_let2
val and* : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2

Collections

val flatten_l : ('a'err) t list -> ('a list'err) t

Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.

since
2.7
val map_l : ('a -> ('b'err) t) -> 'a list -> ('b list'err) t

map_l f [a1; …; an] applies the function f to a1, …, an ,and, in case of success for every element, returns the list of Ok-value. Otherwise, it fails and returns the first error encountered. Tail-recursive.

val fold_l : ('b -> 'a -> ('b'err) t) -> 'b -> 'a list -> ('b'err) t
val fold_iter : ('b -> 'a -> ('b'err) t) -> 'b -> 'a iter -> ('b'err) t
since
3.0

Misc

val choose : ('a'err) t 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'err) t) -> ('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
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_iter : ('a_) t -> 'a iter
since
2.8
val to_seq : ('a_) t -> 'a Stdlib.Seq.t

Renamed from to_std_seq since 3.0.

since
3.0
type ('a, 'b) error = [
| `Ok of 'a
| `Error of 'b
]
val of_err : ('a'b) error -> ('a'b) t
since
0.17
val to_err : ('a'b) t -> ('a'b) error
since
0.17

IO

val pp : 'a printer -> ('a, string) t printer
val pp' : 'a printer -> 'e printer -> ('a'e) t printer

Printer that is generic on the error type.

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

Module CCResult

Error Monad

Uses the new "result" type from OCaml 4.03.

since
0.16
type 'a iter = ('a -> unit) -> unit

Fast internal iterator.

since
2.8
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a printer = Stdlib.Format.formatter -> 'a -> unit

Basics

type nonrec (+'good, +'bad) result = ('good'bad) Stdlib.result =
| Ok of 'good
| Error of 'bad
type (+'good, +'bad) t = ('good'bad) result =
| Ok of 'good
| Error of 'bad
val return : 'a -> ('a'err) t

Successfully return a value.

val fail : 'err -> ('a'err) t

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, Stdlib.Buffer.t, unit, ('b, string) t) Stdlib.format4 -> 'a

fail_printf format uses format to obtain an error message and then returns Error msg.

val fail_fprintf : ('a, Stdlib.Format.formatter, unit, ('b, string) t) Stdlib.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, Stdlib.Format.formatter, unit, ('b, string) t -> ('b, string) t) Stdlib.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'err) t -> ('b'err) t

Map on success.

val map_err : ('err1 -> 'err2) -> ('a'err1) t -> ('a'err2) t

Map on the error variant.

val map2 : ('a -> 'b) -> ('err1 -> 'err2) -> ('a'err1) t -> ('b'err2) t

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.

val iter_err : ('err -> unit) -> (_'err) t -> unit

Apply the function in case of Error.

since
2.4
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 get_lazy : ('e -> 'a) -> ('a'e) t -> 'a

get_lazy f e returns x if e = Ok x, f msg if e = Error msg. This is similar to CCOption.get_lazy.

since
3.0
val get_or_failwith : ('a, string) t -> 'a

get_or_failwith e returns x if e = Ok x, fails otherwise.

raises Failure

with msg if e = Error msg.

since
2.4
val get_lazy : ('b -> 'a) -> ('a'b) t -> 'a

get_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.

since
3.0
val map_or : ('a -> 'b) -> ('a'c) t -> default:'b -> 'b

map_or f e ~default returns f x if e = Ok x, default otherwise.

val catch : ('a'err) t -> 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'err) t) -> ('a'err) t -> ('b'err) t
val equal : err:'err equal -> 'a equal -> ('a'err) t equal
val compare : err:'err ord -> 'a ord -> ('a'err) t ord
val fold : ok:('a -> 'b) -> error:('err -> 'b) -> ('a'err) t -> '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'err) t -> bool

Return true if Ok.

since
1.0
val is_error : ('a'err) t -> 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'err) t

Synonym of return.

val join : (('a'err) t'err) t -> ('a'err) t

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'err) t -> ('b'err) t -> ('a * 'b'err) t

both a b, in case of success, returns Ok (o, o') with the ok values of a and b. Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Infix

module Infix : sig ... end
include module type of Infix
val (<$>) : ('a -> 'b) -> ('a'err) t -> ('b'err) t

Infix version of map.

since
3.0
val (>|=) : ('a'err) t -> ('a -> 'b) -> ('b'err) t

Infix version of map with reversed arguments.

val (>>=) : ('a'err) t -> ('a -> ('b'err) t) -> ('b'err) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ('a -> 'b'err) t -> ('a'err) t -> ('b'err) t

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.

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a'e) result
type ('a, 'e) t_let2
val let+ : ('a'e) t_let2 -> ('a -> 'b) -> ('b'e) t_let2
val and+ : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2
val let* : ('a'e) t_let2 -> ('a -> ('b'e) t_let2) -> ('b'e) t_let2
val and* : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2

Let operators on OCaml >= 4.08.0, nothing otherwise

since
2.8
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a'e) result
type ('a, 'e) t_let2
val let+ : ('a'e) t_let2 -> ('a -> 'b) -> ('b'e) t_let2
val and+ : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2
val let* : ('a'e) t_let2 -> ('a -> ('b'e) t_let2) -> ('b'e) t_let2
val and* : ('a'e) t_let2 -> ('b'e) t_let2 -> ('a * 'b'e) t_let2

Collections

val flatten_l : ('a'err) t list -> ('a list'err) t

Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.

since
2.7
val map_l : ('a -> ('b'err) t) -> 'a list -> ('b list'err) t

map_l f [a1; …; an] applies the function f to a1, …, an ,and, in case of success for every element, returns the list of Ok-value. Otherwise, it fails and returns the first error encountered. Tail-recursive.

val fold_l : ('b -> 'a -> ('b'err) t) -> 'b -> 'a list -> ('b'err) t
val fold_iter : ('b -> 'a -> ('b'err) t) -> 'b -> 'a iter -> ('b'err) t
since
3.0

Misc

val choose : ('a'err) t 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'err) t) -> ('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
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_iter : ('a_) t -> 'a iter
since
2.8
val to_seq : ('a_) t -> 'a Stdlib.Seq.t

Renamed from to_std_seq since 3.0.

since
3.0
type ('a, 'b) error = [
| `Ok of 'a
| `Error of 'b
]
val of_err : ('a'b) error -> ('a'b) t
since
0.17
val to_err : ('a'b) t -> ('a'b) error
since
0.17

IO

val pp : 'a printer -> ('a, string) t printer
val pp' : 'a printer -> 'e printer -> ('a'e) t printer

Printer that is generic on the error type.

\ No newline at end of file diff --git a/dev/containers/Containers/index.html b/dev/containers/Containers/index.html index 503fd40c..a1f2559b 100644 --- a/dev/containers/Containers/index.html +++ b/dev/containers/Containers/index.html @@ -1,2 +1,2 @@ -Containers (containers.Containers)

Module Containers

Drop-In replacement to Stdlib

module Array = CCArray
module Bool = CCBool
module Char = CCChar
module Equal = CCEqual
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCList
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOpt
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCString
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Canonical_sexp = CCCanonical_sexp
module Stdlib = CCShims_.Stdlib
include Monomorphic

Shadow unsafe functions and operators from Stdlib

val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
since
2.1
val (<>.) : float -> float -> bool
since
2.1
val (<.) : float -> float -> bool
since
2.1
val (>.) : float -> float -> bool
since
2.1
val (<=.) : float -> float -> bool
since
2.1
val (>=.) : float -> float -> bool
since
2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
since
2.1
\ No newline at end of file +Containers (containers.Containers)

Module Containers

Drop-In replacement to Stdlib

module Array = CCArray
module Bool = CCBool
module Char = CCChar
module Equal = CCEqual
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCList
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCString
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Canonical_sexp = CCCanonical_sexp
module Stdlib = CCShims_.Stdlib
include Monomorphic

Shadow unsafe functions and operators from Stdlib

val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
since
2.1
val (<>.) : float -> float -> bool
since
2.1
val (<.) : float -> float -> bool
since
2.1
val (>.) : float -> float -> bool
since
2.1
val (<=.) : float -> float -> bool
since
2.1
val (>=.) : float -> float -> bool
since
2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
since
2.1
\ No newline at end of file diff --git a/dev/containers/ContainersLabels/index.html b/dev/containers/ContainersLabels/index.html index 775af3bf..46119397 100644 --- a/dev/containers/ContainersLabels/index.html +++ b/dev/containers/ContainersLabels/index.html @@ -1,2 +1,2 @@ -ContainersLabels (containers.ContainersLabels)

Module ContainersLabels

Drop-In replacement to Stdlib

module Array = CCArrayLabels
module Bool = CCBool
module Char = CCChar
module Equal = CCEqualLabels
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCListLabels
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOpt
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCStringLabels
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Stdlib = CCShims_.Stdlib
include Monomorphic

Shadow unsafe functions and operators from Stdlib

val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
since
2.1
val (<>.) : float -> float -> bool
since
2.1
val (<.) : float -> float -> bool
since
2.1
val (>.) : float -> float -> bool
since
2.1
val (<=.) : float -> float -> bool
since
2.1
val (>=.) : float -> float -> bool
since
2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
since
2.1
\ No newline at end of file +ContainersLabels (containers.ContainersLabels)

Module ContainersLabels

Drop-In replacement to Stdlib

module Array = CCArrayLabels
module Bool = CCBool
module Char = CCChar
module Equal = CCEqualLabels
module Either = CCEither
module Float = CCFloat
module Format = CCFormat
module Fun = CCFun
module Hash = CCHash
module Hashtbl : sig ... end
module Heap = CCHeap
module Int = CCInt
module Int32 = CCInt32
module Int64 = CCInt64
module IO = CCIO
module List = CCListLabels
module Map = CCMap
module Nativeint = CCNativeint
module Option = CCOption
module Ord = CCOrd
module Pair = CCPair
module Parse = CCParse
module Random = CCRandom
module Ref = CCRef
module Result = CCResult
module Seq = CCSeq
module Set = CCSet
module String = CCStringLabels
module Vector = CCVector
module Monomorphic = CCMonomorphic
module Utf8_string = CCUtf8_string
module Sexp = CCSexp
module Sexp_intf = CCSexp_intf
module Stdlib = CCShims_.Stdlib
include Monomorphic

Shadow unsafe functions and operators from Stdlib

val (=) : int -> int -> bool
val (<>) : int -> int -> bool
val (<) : int -> int -> bool
val (>) : int -> int -> bool
val (<=) : int -> int -> bool
val (>=) : int -> int -> bool
val compare : int -> int -> int
val min : int -> int -> int
val max : int -> int -> int

Infix operators for Floats

val (=.) : float -> float -> bool
since
2.1
val (<>.) : float -> float -> bool
since
2.1
val (<.) : float -> float -> bool
since
2.1
val (>.) : float -> float -> bool
since
2.1
val (<=.) : float -> float -> bool
since
2.1
val (>=.) : float -> float -> bool
since
2.1

Shadow Dangerous Operators

val (==) : [ `Consider_using_CCEqual_physical ]
val (!=) : [ `Consider_using_CCEqual_physical ]
since
2.1
\ No newline at end of file diff --git a/dev/containers/index.html b/dev/containers/index.html index d8abe9f4..88b8c7a8 100644 --- a/dev/containers/index.html +++ b/dev/containers/index.html @@ -1,2 +1,2 @@ -index (containers.index) \ No newline at end of file +index (containers.index) \ No newline at end of file