diff --git a/dev/containers-data/CCBV/index.html b/dev/containers-data/CCBV/index.html index 463a6090..6e9f375d 100644 --- a/dev/containers-data/CCBV/index.html +++ b/dev/containers-data/CCBV/index.html @@ -1,2 +1,2 @@ -
CCBVBREAKING CHANGES since 1.2: size is now stored along with the bitvector. Some functions have a new signature.
The size of the bitvector used to be rounded up to the multiple of 30 or 62. In other words some functions such as iter would iterate on more bits than what was originally asked for. This is not the case anymore.
val empty : unit -> tEmpty bitvector.
val create : size:int -> bool -> tCreate a bitvector of given size, with given default value.
val cardinal : t -> intNumber of bits set to one, seen as a set of bits.
val length : t -> intSize of underlying bitvector. This is not related to the underlying implementation. Changed at 1.2
val capacity : t -> intThe number of bits this bitvector can store without resizing.
val resize : t -> int -> unitResize the BV so that it has the specified length. This can grow or shrink the underlying bitvector.
val is_empty : t -> boolAre there any true bits?
val set : t -> int -> unitSet i-th bit, extending the bitvector if needed.
val get : t -> int -> boolIs the i-th bit true? Return false if the index is too high.
val reset : t -> int -> unitSet i-th bit to 0, extending the bitvector if needed.
val flip : t -> int -> unitFlip i-th bit, extending the bitvector if needed.
val clear : t -> unitSet every bit to 0.
val iter : t -> (int -> bool -> unit) -> unitIterate on all bits.
val iter_true : t -> (int -> unit) -> unitIterate on bits set to 1.
val to_list : t -> int listList of indexes that are true.
val to_sorted_list : t -> int listSame as to_list, but also guarantees the list is sorted in increasing order.
val of_list : int list -> tFrom a list of true bits.
The bits are interpreted as indices into the returned bitvector, so the final bitvector bv will have length bv equal to 1 more than max of list indices.
val first : t -> int optionFirst set bit, or return None. Changed type at 1.2
val first_exn : t -> intFirst set bit, or
val filter : t -> (int -> bool) -> unitfilter bv p only keeps the true bits of bv whose index satisfies p index.
val negate_self : t -> unitnegate_self t flips all of the bits in t.
union_into ~into bv sets into to the union of itself and bv. Also updates the length of into to be at least length bv.
inter_into ~into bv sets into to the intersection of itself and bv. Also updates the length of into to be at most length bv.
diff_into ~into t modifies into with only the bits set but not in t.
val select : t -> 'a array -> 'a listselect arr bv selects the elements of arr whose index corresponds to a true bit in bv. If bv is too short, elements of arr with too high an index cannot be selected and are therefore not selected.
val selecti : t -> 'a array -> ('a * int) listSame as select, but selected elements are paired with their indexes.
Bitwise comparison, including the size (equal a b implies length a=length b).
val pp : Stdlib.Format.formatter -> t -> unitPrint the bitvector as a string of bits.
CCBVImperative Bitvectors
BREAKING CHANGES since 1.2: size is now stored along with the bitvector. Some functions have a new signature.
The size of the bitvector used to be rounded up to the multiple of 30 or 62. In other words some functions such as iter would iterate on more bits than what was originally asked for. This is not the case anymore.
val empty : unit -> tEmpty bitvector.
val create : size:int -> bool -> tCreate a bitvector of given size, with given default value.
val cardinal : t -> intNumber of bits set to one, seen as a set of bits.
val length : t -> intSize of underlying bitvector. This is not related to the underlying implementation. Changed at 1.2
val capacity : t -> intThe number of bits this bitvector can store without resizing.
val resize : t -> int -> unitResize the BV so that it has the specified length. This can grow or shrink the underlying bitvector.
val is_empty : t -> boolAre there any true bits?
val set : t -> int -> unitSet i-th bit, extending the bitvector if needed.
val get : t -> int -> boolIs the i-th bit true? Return false if the index is too high.
val reset : t -> int -> unitSet i-th bit to 0, extending the bitvector if needed.
val flip : t -> int -> unitFlip i-th bit, extending the bitvector if needed.
val clear : t -> unitSet every bit to 0.
val iter : t -> (int -> bool -> unit) -> unitIterate on all bits.
val iter_true : t -> (int -> unit) -> unitIterate on bits set to 1.
val to_list : t -> int listList of indexes that are true.
val to_sorted_list : t -> int listSame as to_list, but also guarantees the list is sorted in increasing order.
val of_list : int list -> tFrom a list of true bits.
The bits are interpreted as indices into the returned bitvector, so the final bitvector bv will have length bv equal to 1 more than max of list indices.
val first : t -> int optionFirst set bit, or return None. Changed type at 1.2
val first_exn : t -> intFirst set bit, or
val filter : t -> (int -> bool) -> unitfilter bv p only keeps the true bits of bv whose index satisfies p index.
val negate_self : t -> unitnegate_self t flips all of the bits in t.
union_into ~into bv sets into to the union of itself and bv. Also updates the length of into to be at least length bv.
inter_into ~into bv sets into to the intersection of itself and bv. Also updates the length of into to be at most length bv.
diff_into ~into t modifies into with only the bits set but not in t.
val select : t -> 'a array -> 'a listselect arr bv selects the elements of arr whose index corresponds to a true bit in bv. If bv is too short, elements of arr with too high an index cannot be selected and are therefore not selected.
val selecti : t -> 'a array -> ('a * int) listSame as select, but selected elements are paired with their indexes.
Bitwise comparison, including the size (equal a b implies length a=length b).
val pp : Stdlib.Format.formatter -> t -> unitPrint the bitvector as a string of bits.
CCBijectionRepresents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely.
module type OrderedType = sig ... endmodule type S = sig ... endmodule Make (L : OrderedType) (R : OrderedType) : S with type left = L.t and type right = R.tCCBijectionFunctor to build a bijection Represents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely.
module type OrderedType = sig ... endmodule type S = sig ... endmodule Make (L : OrderedType) (R : OrderedType) : S with type left = L.t and type right = R.tCCBitFieldThis module defines efficient bitfields up to 30 or 62 bits (depending on the architecture) in a relatively type-safe way.
module B = CCBitField.Make(struct end);;
+CCBitField (containers-data.CCBitField) Module CCBitField
Efficient Bit Field for up to 31 or 61 fiels
This module defines efficient bitfields up to 31 or 61 bits (depending on the architecture) in a relatively type-safe way.
module B = CCBitField.Make(struct end);;
let x = B.mk_field ()
let y = B.mk_field ()
@@ -9,4 +9,4 @@ let f = B.empty |> B.set x true |> B.set y true;;
assert (not (B.get z f)) ;;
-assert (f |> B.set z true |> B.get z);;
module type S = sig ... endmodule type S = sig ... endCCCacheParticularly useful for memoization. See with_cache and with_cache_rec for more details.
Typical use case: one wants to memoize a function f : 'a -> 'b. Code sample:
let f x =
+CCCache (containers-data.CCCache) Module CCCache
Caches Utils
Particularly useful for memoization. See with_cache and with_cache_rec for more details.
Value interface
Typical use case: one wants to memoize a function f : 'a -> 'b. Code sample:
let f x =
print_endline "call f";
x + 1;;
diff --git a/dev/containers-data/CCDeque/index.html b/dev/containers-data/CCDeque/index.html
index e8da8a15..ca965c50 100644
--- a/dev/containers-data/CCDeque/index.html
+++ b/dev/containers-data/CCDeque/index.html
@@ -1,2 +1,2 @@
-CCDeque (containers-data.CCDeque) Module CCDeque
Imperative deque
This structure provides fast access to its front and back elements, with O(1) operations.
val create : unit -> 'a tNew deque.
val clear : _ t -> unitRemove all elements.
val is_empty : 'a t -> boolIs the deque empty?
equal a b checks whether a and b contain the same sequence of elements.
compare a b compares lexicographically a and b.
val length : 'a t -> intNumber of elements. Used to be linear time, now constant time.
val push_front : 'a t -> 'a -> unitPush value at the front.
val push_back : 'a t -> 'a -> unitPush value at the back.
val peek_front : 'a t -> 'aFirst value.
val peek_front_opt : 'a t -> 'a optionFirst value.
val peek_back : 'a t -> 'aLast value.
val peek_back_opt : 'a t -> 'a optionLast value.
val remove_back : 'a t -> unitRemove last value. If the deque is empty do nothing
val remove_front : 'a t -> unitRemove first value. If the deque is empty do nothing
val take_back : 'a t -> 'aTake last value.
val take_back_opt : 'a t -> 'a optionTake last value.
val take_front : 'a t -> 'aTake first value.
val take_front_opt : 'a t -> 'a optionTake first value.
val update_back : 'a t -> ('a -> 'a option) -> unitUpdate last value. If the deque is empty do nothing. If the function returns None, remove last element; if it returns Some x, replace last element with x.
val update_front : 'a t -> ('a -> 'a option) -> unitUpdate first value. If the deque is empty do nothing. Similar to update_back but for the first value.
append_front ~into q adds all elements of q at the front of into. O(length q) in time.
append_back ~into q adds all elements of q at the back of into. O(length q) in time.
val iter : ('a -> unit) -> 'a t -> unitIterate on elements.
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bFold on elements.
Conversions
Create a deque from the sequence. Optional argument deque disappears, use add_iter_back instead.
add_iter_front q seq adds elements of seq into the front of q, in reverse order. O(n) in time, where n is the number of elements to add.
add_iter_back q seq adds elements of seq into the back of q, in order. O(n) in time, where n is the number of elements to add.
val of_list : 'a list -> 'a tConversion from list, in order.
val to_list : 'a t -> 'a listList of elements, in order. Less efficient than to_rev_list.
val to_rev_list : 'a t -> 'a listEfficient conversion to list, in reverse order.
val filter_in_place : 'a t -> ('a -> bool) -> unitKeep only elements that satisfy the predicate.
print
\ No newline at end of file
+CCDeque (containers-data.CCDeque) Module CCDeque
Imperative deque
This structure provides fast access to its front and back elements, with O(1) operations.
val create : unit -> 'a tNew deque.
val clear : _ t -> unitRemove all elements.
val is_empty : 'a t -> boolIs the deque empty?
equal a b checks whether a and b contain the same sequence of elements.
compare a b compares lexicographically a and b.
val length : 'a t -> intNumber of elements. Used to be linear time, now constant time.
val push_front : 'a t -> 'a -> unitPush value at the front.
val push_back : 'a t -> 'a -> unitPush value at the back.
val peek_front : 'a t -> 'aFirst value.
val peek_front_opt : 'a t -> 'a optionFirst value.
val peek_back : 'a t -> 'aLast value.
val peek_back_opt : 'a t -> 'a optionLast value.
val remove_back : 'a t -> unitRemove last value. If the deque is empty do nothing
val remove_front : 'a t -> unitRemove first value. If the deque is empty do nothing
val take_back : 'a t -> 'aTake last value.
val take_back_opt : 'a t -> 'a optionTake last value.
val take_front : 'a t -> 'aTake first value.
val take_front_opt : 'a t -> 'a optionTake first value.
val update_back : 'a t -> ('a -> 'a option) -> unitUpdate last value. If the deque is empty do nothing. If the function returns None, remove last element; if it returns Some x, replace last element with x.
val update_front : 'a t -> ('a -> 'a option) -> unitUpdate first value. If the deque is empty do nothing. Similar to update_back but for the first value.
append_front ~into q adds all elements of q at the front of into. O(length q) in time.
append_back ~into q adds all elements of q at the back of into. O(length q) in time.
val iter : ('a -> unit) -> 'a t -> unitIterate on elements.
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bFold on elements.
Conversions
Create a deque from the sequence. Optional argument deque disappears, use add_iter_back instead.
add_iter_front q seq adds elements of seq into the front of q, in reverse order. O(n) in time, where n is the number of elements to add.
add_iter_back q seq adds elements of seq into the back of q, in order. O(n) in time, where n is the number of elements to add.
val of_list : 'a list -> 'a tConversion from list, in order.
val to_list : 'a t -> 'a listList of elements, in order. Less efficient than to_rev_list.
val to_rev_list : 'a t -> 'a listEfficient conversion to list, in reverse order.
val filter_in_place : 'a t -> ('a -> bool) -> unitKeep only elements that satisfy the predicate.
print
\ No newline at end of file
diff --git a/dev/containers-data/CCFQueue/index.html b/dev/containers-data/CCFQueue/index.html
index 0a8786f9..e536c934 100644
--- a/dev/containers-data/CCFQueue/index.html
+++ b/dev/containers-data/CCFQueue/index.html
@@ -1,2 +1,2 @@
-CCFQueue (containers-data.CCFQueue) Module CCFQueue
Functional queues
Basics
val empty : 'a tval is_empty : 'a t -> boolval singleton : 'a -> 'a tval doubleton : 'a -> 'a -> 'a tSame as take_front, but fails on empty queues.
take_front_l n q takes at most n elements from the front of q, and returns them wrapped in a list.
take_back_l n q removes and returns the last n elements of q. The elements are in the order of the queue, that is, the head of the returned list is the first element to appear via take_front. take_back_l 2 (of_list [1;2;3;4]) = of_list [1;2], [3;4].
Individual extraction
val first : 'a t -> 'a optionFirst element of the queue.
val last : 'a t -> 'a optionLast element of the queue.
val last_exn : 'a t -> 'aval nth : int -> 'a t -> 'a optionReturn the i-th element of the queue in logarithmic time.
Global Operations
Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.
val size : 'a t -> intNumber of elements in the queue (constant time).
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval iter : ('a -> unit) -> 'a t -> unitConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval to_seq : 'a t -> 'a Stdlib.Seq.tval of_seq : 'a Stdlib.Seq.t -> 'a tval (--) : int -> int -> int ta -- b is the integer range from a to b, both included.
val (--^) : int -> int -> int ta -- b is the integer range from a to b, where b is excluded.
\ No newline at end of file
+CCFQueue (containers-data.CCFQueue) Module CCFQueue
Functional queues
Basics
val empty : 'a tval is_empty : 'a t -> boolval singleton : 'a -> 'a tval doubleton : 'a -> 'a -> 'a tSame as take_front, but fails on empty queues.
take_front_l n q takes at most n elements from the front of q, and returns them wrapped in a list.
take_back_l n q removes and returns the last n elements of q. The elements are in the order of the queue, that is, the head of the returned list is the first element to appear via take_front. take_back_l 2 (of_list [1;2;3;4]) = of_list [1;2], [3;4].
Individual extraction
val first : 'a t -> 'a optionFirst element of the queue.
val last : 'a t -> 'a optionLast element of the queue.
val last_exn : 'a t -> 'aval nth : int -> 'a t -> 'a optionReturn the i-th element of the queue in logarithmic time.
Global Operations
Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.
val size : 'a t -> intNumber of elements in the queue (constant time).
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval iter : ('a -> unit) -> 'a t -> unitConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval to_seq : 'a t -> 'a Stdlib.Seq.tval of_seq : 'a Stdlib.Seq.t -> 'a tval (--) : int -> int -> int ta -- b is the integer range from a to b, both included.
val (--^) : int -> int -> int ta -- b is the integer range from a to b, where b is excluded.
\ No newline at end of file
diff --git a/dev/containers-data/CCFun_vec/index.html b/dev/containers-data/CCFun_vec/index.html
index 78f1b6b8..a74b7895 100644
--- a/dev/containers-data/CCFun_vec/index.html
+++ b/dev/containers-data/CCFun_vec/index.html
@@ -1,2 +1,2 @@
-CCFun_vec (containers-data.CCFun_vec) Module CCFun_vec
Functional Vectors
Tree with a large branching factor for logarithmic operations with a low multiplicative factor.
status: experimental. DO NOT USE (yet)
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]Signature
val empty : 'a tval is_empty : _ t -> boolval return : 'a -> 'a tval length : _ t -> intval get : int -> 'a t -> 'a optionval get_exn : int -> 'a t -> 'aval iter : f:('a -> unit) -> 'a t -> unitval iteri : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index, in increasing order.
val iteri_rev : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index, but starting from the end.
val fold : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bval foldi : f:('b -> int -> 'a -> 'b) -> x:'b -> 'a t -> 'bval choose : 'a t -> 'a optionConversions
val to_list : 'a t -> 'a listval of_list : 'a list -> 'a tIO
\ No newline at end of file
+CCFun_vec (containers-data.CCFun_vec) Module CCFun_vec
Functional Vectors
Tree with a large branching factor for logarithmic operations with a low multiplicative factor.
status: experimental. DO NOT USE (yet)
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]Signature
val empty : 'a tval is_empty : _ t -> boolval return : 'a -> 'a tval length : _ t -> intval get : int -> 'a t -> 'a optionval get_exn : int -> 'a t -> 'aval iter : f:('a -> unit) -> 'a t -> unitval iteri : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index, in increasing order.
val iteri_rev : f:(int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index, but starting from the end.
val fold : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bval foldi : f:('b -> int -> 'a -> 'b) -> x:'b -> 'a t -> 'bval choose : 'a t -> 'a optionConversions
val to_list : 'a t -> 'a listval of_list : 'a list -> 'a tIO
\ No newline at end of file
diff --git a/dev/containers-data/CCGraph/index.html b/dev/containers-data/CCGraph/index.html
index afb5ff4a..d92826cd 100644
--- a/dev/containers-data/CCGraph/index.html
+++ b/dev/containers-data/CCGraph/index.html
@@ -1,5 +1,5 @@
-CCGraph (containers-data.CCGraph) Module CCGraph
Simple Graph Interface
A collections of algorithms on (mostly read-only) graph structures. The user provides her own graph structure as a ('v, 'e) CCGraph.t, where 'v is the type of vertices and 'e the type of edges (for instance, 'e = ('v * 'v) is perfectly fine in many cases).
Such a ('v, 'e) CCGraph.t structure is a record containing three functions: two relate edges to their origin and destination, and one maps vertices to their outgoing edges. This abstract notion of graph makes it possible to run the algorithms on any user-specific type that happens to have a graph structure.
Many graph algorithms here take an iterator of vertices as input. The helper module Iter contains basic functions for that, as does the iter library on opam. If the user only has a single vertex (e.g., for a topological sort from a given vertex), they can use Iter.return x to build a iter of one element.
status: unstable
Iter Helpers
type 'a iter_once = 'a iterIter that should be used only once
module Iter : sig ... endInterfaces for graphs
This interface is designed for oriented graphs with labels on edges
type ('v, 'e) t = 'v -> ('e * 'v) iterDirected graph with vertices of type 'v and edges labeled with e'
type ('v, 'e) graph = ('v, 'e) tTags
Mutable tags from values of type 'v to tags of type bool
type ('k, 'a) table = {mem : 'k -> bool;find : 'k -> 'a;(**) add : 'k -> 'a -> unit;(*Erases previous binding
*)
}Table
Mutable table with keys 'k and values 'a
type 'a set = ('a, unit) tableMutable set
val mk_table : eq:('k -> 'k -> bool) -> ?hash:('k -> int) -> int -> ('k, 'a) tableDefault implementation for Table: a Hashtbl.t.
val mk_map : cmp:('k -> 'k -> int) -> unit -> ('k, 'a) tableUse a Map.S underneath.
Bags of vertices
type 'a bag = {push : 'a -> unit;is_empty : unit -> bool;pop : unit -> 'a;(*raises some exception is empty
*)
}Bag of elements of type 'a
val mk_queue : unit -> 'a bagval mk_stack : unit -> 'a bagval mk_heap : leq:('a -> 'a -> bool) -> 'a bagmk_heap ~leq makes a priority queue where leq x y = true means that x is smaller than y and should be prioritary.
Traversals
module Traverse : sig ... endCycles
is_dag ~graph vs returns true if the subset of graph reachable from vs is acyclic.
Topological Sort
val topo_sort : eq:('v -> 'v -> bool) -> ?rev:bool -> tbl:'v set -> graph:('v, 'e) t ->
+CCGraph (containers-data.CCGraph) Module CCGraph
Simple Graph Interface
A collections of algorithms on (mostly read-only) graph structures. The user provides her own graph structure as a ('v, 'e) CCGraph.t, where 'v is the type of vertices and 'e the type of edges (for instance, 'e = ('v * 'v) is perfectly fine in many cases).
Such a ('v, 'e) CCGraph.t structure is a record containing three functions: two relate edges to their origin and destination, and one maps vertices to their outgoing edges. This abstract notion of graph makes it possible to run the algorithms on any user-specific type that happens to have a graph structure.
Many graph algorithms here take an iterator of vertices as input. The helper module Iter contains basic functions for that, as does the iter library on opam. If the user only has a single vertex (e.g., for a topological sort from a given vertex), they can use Iter.return x to build a iter of one element.
status: unstable
Iter Helpers
type 'a iter_once = 'a iterIter that should be used only once
module Iter : sig ... endInterfaces for graphs
This interface is designed for oriented graphs with labels on edges
type ('v, 'e) t = 'v -> ('e * 'v) iterDirected graph with vertices of type 'v and edges labeled with e'
type ('v, 'e) graph = ('v, 'e) tTags
Mutable tags from values of type 'v to tags of type bool
type ('k, 'a) table = {mem : 'k -> bool;find : 'k -> 'a;(**) add : 'k -> 'a -> unit;(*Erases previous binding
*)
}Table
Mutable table with keys 'k and values 'a
type 'a set = ('a, unit) tableMutable set
val mk_table : eq:('k -> 'k -> bool) -> ?hash:('k -> int) -> int -> ('k, 'a) tableDefault implementation for Table: a Hashtbl.t.
val mk_map : cmp:('k -> 'k -> int) -> unit -> ('k, 'a) tableUse a Map.S underneath.
Bags of vertices
type 'a bag = {push : 'a -> unit;is_empty : unit -> bool;pop : unit -> 'a;(*raises some exception is empty
*)
}Bag of elements of type 'a
val mk_queue : unit -> 'a bagval mk_stack : unit -> 'a bagval mk_heap : leq:('a -> 'a -> bool) -> 'a bagmk_heap ~leq makes a priority queue where leq x y = true means that x is smaller than y and should be prioritary.
Traversals
module Traverse : sig ... endCycles
is_dag ~graph vs returns true if the subset of graph reachable from vs is acyclic.
Topological Sort
val topo_sort : eq:('v -> 'v -> bool) -> ?rev:bool -> tbl:'v set -> graph:('v, 'e) t ->
'v iter -> 'v listtopo_sort ~graph seq returns a list of vertices l where each element of l is reachable from seq. The list is sorted in a way such that if v -> v' in the graph, then v comes before v' in the list (i.e. has a smaller index). Basically v -> v' means that v is smaller than v'. See wikipedia.
val topo_sort_tag : eq:('v -> 'v -> bool) -> ?rev:bool -> tags:'v tag_set -> graph:('v, 'e) t ->
'v iter -> 'v listSame as topo_sort but uses an explicit tag set.
Lazy Spanning Tree
module Lazy_tree : sig ... endval spanning_tree : tbl:'v set -> graph:('v, 'e) t -> 'v -> ('v, 'e) Lazy_tree.tspanning_tree ~graph v computes a lazy spanning tree that has v as a root. The table tbl is used for the memoization part.
val spanning_tree_tag : tags:'v tag_set -> graph:('v, 'e) t -> 'v -> ('v, 'e) Lazy_tree.tStrongly Connected Components
Hidden state for scc.
Strongly connected components reachable from the given vertices. Each component is a list of vertices that are all mutually reachable in the graph. The components are explored in a topological order (if C1 and C2 are components, and C1 points to C2, then C2 will be yielded before C1). Uses Tarjan's algorithm.
Pretty printing in the DOT (graphviz) format
Example (print divisors from 42):
let open CCGraph in
let open Dot in
diff --git a/dev/containers-data/CCHashSet/index.html b/dev/containers-data/CCHashSet/index.html
index 5da846e3..864f3fe3 100644
--- a/dev/containers-data/CCHashSet/index.html
+++ b/dev/containers-data/CCHashSet/index.html
@@ -1,2 +1,2 @@
-CCHashSet (containers-data.CCHashSet) Module CCHashSet
\ No newline at end of file
+CCHashSet (containers-data.CCHashSet) Module CCHashSet
Mutable Set
status: unstable
\ No newline at end of file
diff --git a/dev/containers-data/CCHashTrie/index.html b/dev/containers-data/CCHashTrie/index.html
index e0115305..24e52be8 100644
--- a/dev/containers-data/CCHashTrie/index.html
+++ b/dev/containers-data/CCHashTrie/index.html
@@ -1,2 +1,2 @@
-CCHashTrie (containers-data.CCHashTrie) Module CCHashTrie
Hash Tries
Trie indexed by the hash of the keys, where the branching factor is fixed. The goal is to have a quite efficient functional structure with fast update and access if the hash function is good. The trie is not binary, to improve cache locality and decrease depth.
Preliminary benchmarks (see the "tbl" section of benchmarks) tend to show that this type is quite efficient for small data sets.
status: unstable
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]module Transient : sig ... endmodule type S = sig ... endmodule type KEY = sig ... end
\ No newline at end of file
+CCHashTrie (containers-data.CCHashTrie) Module CCHashTrie
Hash Tries
Trie indexed by the hash of the keys, where the branching factor is fixed. The goal is to have a quite efficient functional structure with fast update and access if the hash function is good. The trie is not binary, to improve cache locality and decrease depth.
Preliminary benchmarks (see the "tbl" section of benchmarks) tend to show that this type is quite efficient for small data sets.
status: unstable
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]module Transient : sig ... endmodule type S = sig ... endmodule type KEY = sig ... end
\ No newline at end of file
diff --git a/dev/containers-data/CCHet/index.html b/dev/containers-data/CCHet/index.html
index 4a34be79..486d0336 100644
--- a/dev/containers-data/CCHet/index.html
+++ b/dev/containers-data/CCHet/index.html
@@ -1,2 +1,2 @@
-CCHet (containers-data.CCHet) Module CCHet
Associative containers with Heterogeneous Values
This is similar to CCMixtbl, but the injection is directly used as a key.
module Key : sig ... endmodule Tbl : sig ... endmodule Map : sig ... end
\ No newline at end of file
+CCHet (containers-data.CCHet) Module CCHet
Associative containers with Heterogeneous Values
This is similar to CCMixtbl, but the injection is directly used as a key.
\ No newline at end of file
diff --git a/dev/containers-data/CCImmutArray/index.html b/dev/containers-data/CCImmutArray/index.html
index 28bc6bcb..f34be80e 100644
--- a/dev/containers-data/CCImmutArray/index.html
+++ b/dev/containers-data/CCImmutArray/index.html
@@ -1,2 +1,2 @@
-CCImmutArray (containers-data.CCImmutArray) Module CCImmutArray
Immutable Arrays
Purely functional use of arrays. Update is costly, but reads are very fast. Sadly, it is not possible to make this type covariant without using black magic.
Array of values of type 'a. The underlying type really is an array, but it will never be modified.
It should be covariant but OCaml will not accept it.
val empty : 'a tval length : _ t -> intval singleton : 'a -> 'a tval doubleton : 'a -> 'a -> 'a tval make : int -> 'a -> 'a tmake n x makes an array of n times x.
val init : int -> (int -> 'a) -> 'a tinit n f makes the array [| f 0; f 1; ... ; f (n-1) |].
val get : 'a t -> int -> 'aAccess the element.
sub a start len returns a fresh array of length len, containing the elements from start to pstart + len - 1 of array a.
Raises Invalid_argument "Array.sub" if start and len do not designate a valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.
val iter : ('a -> unit) -> 'a t -> unitval iteri : (int -> 'a -> unit) -> 'a t -> unitval foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'aval fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval for_all : ('a -> bool) -> 'a t -> boolval exists : ('a -> bool) -> 'a t -> boolConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval of_array_unsafe : 'a array -> 'a tTake ownership of the given array. Careful, the array must NOT be modified afterwards!
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
\ No newline at end of file
+CCImmutArray (containers-data.CCImmutArray) Module CCImmutArray
Immutable Arrays
Purely functional use of arrays. Update is costly, but reads are very fast. Sadly, it is not possible to make this type covariant without using black magic.
Array of values of type 'a. The underlying type really is an array, but it will never be modified.
It should be covariant but OCaml will not accept it.
val empty : 'a tval length : _ t -> intval singleton : 'a -> 'a tval doubleton : 'a -> 'a -> 'a tval make : int -> 'a -> 'a tmake n x makes an array of n times x.
val init : int -> (int -> 'a) -> 'a tinit n f makes the array [| f 0; f 1; ... ; f (n-1) |].
val get : 'a t -> int -> 'aAccess the element.
sub a start len returns a fresh array of length len, containing the elements from start to pstart + len - 1 of array a.
Raises Invalid_argument "Array.sub" if start and len do not designate a valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.
val iter : ('a -> unit) -> 'a t -> unitval iteri : (int -> 'a -> unit) -> 'a t -> unitval foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'aval fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval for_all : ('a -> bool) -> 'a t -> boolval exists : ('a -> bool) -> 'a t -> boolConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval of_array_unsafe : 'a array -> 'a tTake ownership of the given array. Careful, the array must NOT be modified afterwards!
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
\ No newline at end of file
diff --git a/dev/containers-data/CCIntMap/index.html b/dev/containers-data/CCIntMap/index.html
index 3953a53f..8ee04a16 100644
--- a/dev/containers-data/CCIntMap/index.html
+++ b/dev/containers-data/CCIntMap/index.html
@@ -1,3 +1,3 @@
-CCIntMap (containers-data.CCIntMap) Module CCIntMap
Map specialized for Int keys
status: stable
val empty : 'a tval is_empty : _ t -> boolIs the map empty?
val singleton : int -> 'a -> 'a tval doubleton : int -> 'a -> int -> 'a -> 'a tval mem : int -> _ t -> boolval find : int -> 'a t -> 'a optionequal ~eq a b checks whether a and b have the same set of pairs (key, value), comparing values with eq.
Total order between maps; the precise order is unspecified.
val cardinal : _ t -> intNumber of bindings in the map. Linear time.
val iter : (int -> 'a -> unit) -> 'a t -> unitval fold : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bval choose : 'a t -> (int * 'a) optionval choose_exn : 'a t -> int * 'aval merge : f:(int -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option)
+CCIntMap (containers-data.CCIntMap) Module CCIntMap
Map specialized for Int keys
status: stable
val empty : 'a tval is_empty : _ t -> boolIs the map empty?
val singleton : int -> 'a -> 'a tval doubleton : int -> 'a -> int -> 'a -> 'a tval mem : int -> _ t -> boolval find : int -> 'a t -> 'a optionequal ~eq a b checks whether a and b have the same set of pairs (key, value), comparing values with eq.
Total order between maps; the precise order is unspecified.
val cardinal : _ t -> intNumber of bindings in the map. Linear time.
val iter : (int -> 'a -> unit) -> 'a t -> unitval fold : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bval choose : 'a t -> (int * 'a) optionval choose_exn : 'a t -> int * 'aval merge : f:(int -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option)
-> 'a t -> 'b t -> 'c tmerge ~f m1 m2 merges m1 and m2 together, calling f once on every key that occurs in at least one of m1 and m2. if f k binding = Some c then k -> c is part of the result, else k is not part of the result.
Whole-collection operations
val of_list : (int * 'a) list -> 'a tval to_list : 'a t -> (int * 'a) listval of_seq : (int * 'a) Stdlib.Seq.t -> 'a tval to_seq : 'a t -> (int * 'a) Stdlib.Seq.ttype 'a tree = unit -> [ `Nil | `Node of 'a * 'a tree list ]IO
Helpers
\ No newline at end of file
diff --git a/dev/containers-data/CCKTree/index.html b/dev/containers-data/CCKTree/index.html
index f190d528..14f7d30c 100644
--- a/dev/containers-data/CCKTree/index.html
+++ b/dev/containers-data/CCKTree/index.html
@@ -1,5 +1,5 @@
-CCKTree (containers-data.CCKTree) Module CCKTree
Lazy Tree Structure
This structure can be used to represent trees and directed graphs (as infinite trees) in a lazy fashion. Like CCKList, it is a structural type.
Basics
type +'a t = unit -> [ `Nil | `Node of 'a * 'a t list ]val empty : 'a tval is_empty : _ t -> boolval singleton : 'a -> 'a tTree with only one label.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aFold on values in no specified order. May not terminate if the tree is infinite.
val iter : ('a -> unit) -> 'a t -> unitval size : _ t -> intNumber of elements.
val height : _ t -> intLength of the longest path to empty leaves.
Graph Traversals
class type 'a pset = object ... endAbstract Set structure
val set_of_cmp : cmp:('a -> 'a -> int) -> unit -> 'a psetBuild a set structure given a total ordering.
Depth-first traversal of the tree.
val force : 'a t -> [ `Nil | `Node of 'a * 'b list ] as 'bforce t evaluates t completely and returns a regular tree structure.
Look for an element that maps to Some _.
Pretty-printing
Example (tree of calls for naive Fibonacci function):
let mk_fib n =
+CCKTree (containers-data.CCKTree) Module CCKTree
Lazy Tree Structure This structure can be used to represent trees and directed graphs (as infinite trees) in a lazy fashion. Like CCKList, it is a structural type.
Basics
type +'a t = unit -> [ `Nil | `Node of 'a * 'a t list ]val empty : 'a tval is_empty : _ t -> boolval singleton : 'a -> 'a tTree with only one label.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aFold on values in no specified order. May not terminate if the tree is infinite.
val iter : ('a -> unit) -> 'a t -> unitval size : _ t -> intNumber of elements.
val height : _ t -> intLength of the longest path to empty leaves.
Graph Traversals
class type 'a pset = object ... endAbstract Set structure
val set_of_cmp : cmp:('a -> 'a -> int) -> unit -> 'a psetBuild a set structure given a total ordering.
Depth-first traversal of the tree.
val force : 'a t -> [ `Nil | `Node of 'a * 'b list ] as 'bforce t evaluates t completely and returns a regular tree structure.
Look for an element that maps to Some _.
Pretty-printing
Example (tree of calls for naive Fibonacci function):
let mk_fib n =
let rec fib' l r i =
if i=n then r else fib' r (l+r) (i+1)
in fib' 1 1 1;;
diff --git a/dev/containers-data/CCLazy_list/index.html b/dev/containers-data/CCLazy_list/index.html
index dbe4106a..990bb1f4 100644
--- a/dev/containers-data/CCLazy_list/index.html
+++ b/dev/containers-data/CCLazy_list/index.html
@@ -1,2 +1,2 @@
-CCLazy_list (containers-data.CCLazy_list) Module CCLazy_list
Lazy List
type +'a t = 'a node lazy_tval empty : 'a tEmpty list.
val return : 'a -> 'a tReturn a computed value.
val is_empty : _ t -> boolEvaluate the head.
val length : _ t -> intlength l returns the number of elements in l, eagerly (linear time). Caution, will not terminate if l is infinite.
module Infix : sig ... endval of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval to_list_rev : 'a t -> 'a list
\ No newline at end of file
+CCLazy_list (containers-data.CCLazy_list) Module CCLazy_list
Lazy List
type +'a t = 'a node lazy_tval empty : 'a tEmpty list.
val return : 'a -> 'a tReturn a computed value.
val is_empty : _ t -> boolEvaluate the head.
val length : _ t -> intlength l returns the number of elements in l, eagerly (linear time). Caution, will not terminate if l is infinite.
module Infix : sig ... endval of_list : 'a list -> 'a tval to_list : 'a t -> 'a listval to_list_rev : 'a t -> 'a list
\ No newline at end of file
diff --git a/dev/containers-data/CCMixmap/index.html b/dev/containers-data/CCMixmap/index.html
index 14a14552..698f9587 100644
--- a/dev/containers-data/CCMixmap/index.html
+++ b/dev/containers-data/CCMixmap/index.html
@@ -1,5 +1,5 @@
-CCMixmap (containers-data.CCMixmap) Module CCMixmap
Maps with Heterogeneous Values
status: experimental
module M = CCMixmap.Make(CCInt)
+CCMixmap (containers-data.CCMixmap) Module CCMixmap
Maps with Heterogeneous Values
status: experimental
module M = CCMixmap.Make(CCInt)
let inj_int = CCMixmap.create_inj()
let inj_str = CCMixmap.create_inj()
@@ -16,4 +16,4 @@ let m =
assert (M.get ~inj:inj_str 2 m = Some "2")
assert (M.get ~inj:inj_int 2 m = None)
assert (M.get ~inj:inj_list_int 3 m = Some [3;3;3])
- assert (M.get ~inj:inj_str 3 m = None)
change of API, the map is last argument to make piping with |> easier since 0.16.
An accessor for values of type 'a in any map. Values put in the map using a key can only be retrieved using this very same key.
val create_inj : unit -> 'a injectionReturn a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple maps (although not in a thread-safe way).
module type S = sig ... endmodule type ORD = sig ... end
\ No newline at end of file
+ assert (M.get ~inj:inj_str 3 m = None)
change of API, the map is last argument to make piping with |> easier since 0.16.
An accessor for values of type 'a in any map. Values put in the map using a key can only be retrieved using this very same key.
val create_inj : unit -> 'a injectionReturn a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple maps (although not in a thread-safe way).
module type S = sig ... endmodule type ORD = sig ... end
\ No newline at end of file
diff --git a/dev/containers-data/CCMixset/index.html b/dev/containers-data/CCMixset/index.html
index 2c7ffe67..b1f304b4 100644
--- a/dev/containers-data/CCMixset/index.html
+++ b/dev/containers-data/CCMixset/index.html
@@ -1,5 +1,5 @@
-CCMixset (containers-data.CCMixset) Module CCMixset
Set of Heterogeneous Values
let k1 : int key = newkey () in
+CCMixset (containers-data.CCMixset) Module CCMixset
Set of Heterogeneous Values
let k1 : int key = newkey () in
let k2 : int key = newkey () in
let k3 : string key = newkey () in
let set =
@@ -11,4 +11,4 @@ in
assert (get ~key:k1 set = Some 1);
assert (get ~key:k2 set = Some 2);
assert (get ~key:k3 set = Some "3");
-()
val newkey : unit -> 'a keynewkey () creates a new unique key that can be used to access a 'a value in a set. Each key created with newkey is distinct from any other key, even if they have the same type.
Not thread-safe.
val empty : tEmpty set.
set ~key v set maps key to v in set. It means that for every set, get ~key (set ~key v set) = Some v.
val cardinal : t -> intNumber of mappings.
\ No newline at end of file
+()val newkey : unit -> 'a keynewkey () creates a new unique key that can be used to access a 'a value in a set. Each key created with newkey is distinct from any other key, even if they have the same type.
Not thread-safe.
val empty : tEmpty set.
set ~key v set maps key to v in set. It means that for every set, get ~key (set ~key v set) = Some v.
val cardinal : t -> intNumber of mappings.
\ No newline at end of file
diff --git a/dev/containers-data/CCMixtbl/index.html b/dev/containers-data/CCMixtbl/index.html
index 507cd00f..51448b5b 100644
--- a/dev/containers-data/CCMixtbl/index.html
+++ b/dev/containers-data/CCMixtbl/index.html
@@ -1,5 +1,5 @@
-CCMixtbl (containers-data.CCMixtbl) Module CCMixtbl
Hash Table with Heterogeneous Keys
From https://github.com/mjambon/mixtbl (thanks to him). Example:
let inj_int = CCMixtbl.create_inj () ;;
+CCMixtbl (containers-data.CCMixtbl) Module CCMixtbl
Hash Table with Heterogeneous Keys
From https://github.com/mjambon/mixtbl (thanks to him). Example:
let inj_int = CCMixtbl.create_inj () ;;
let tbl = CCMixtbl.create 10 ;;
@@ -19,4 +19,4 @@ OUnit.assert_equal (Some 1) (CCMixtbl.get inj_int tbl "a");;
CCMixtbl.set inj_string tbl "a" "Bye";;
OUnit.assert_equal None (CCMixtbl.get inj_int tbl "a");;
-OUnit.assert_equal (Some "Bye") (CCMixtbl.get inj_string tbl "a");;
A hash table containing values of different types. The type parameter 'a represents the type of the keys.
An accessor for values of type 'b in any table. Values put in the table using a key can only be retrieved using this very same key.
val create : int -> 'a tcreate n creates a hash table of initial size n.
val create_inj : unit -> 'b injectionReturn a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple tables (although not in a thread-safe way).
Get the value corresponding to this key, if it exists and belongs to the same key.
Find the value for the given key, which must be of the right type.
val length : 'a t -> intNumber of bindings.
val clear : 'a t -> unitClear content of the hashtable.
val remove : 'a t -> 'a -> unitRemove the binding for this key.
val iter_keys : 'a t -> ('a -> unit) -> unitIterate on the keys of this table.
val fold_keys : 'a t -> 'b -> ('b -> 'a -> 'b) -> 'bFold over the keys.
Iterators
All the bindings that come from the corresponding injection.
\ No newline at end of file
+OUnit.assert_equal (Some "Bye") (CCMixtbl.get inj_string tbl "a");;A hash table containing values of different types. The type parameter 'a represents the type of the keys.
An accessor for values of type 'b in any table. Values put in the table using a key can only be retrieved using this very same key.
val create : int -> 'a tcreate n creates a hash table of initial size n.
val create_inj : unit -> 'b injectionReturn a value that works for a given type of values. This function is normally called once for each type of value. Several keys may be created for the same type, but a value set with a given setter can only be retrieved with the matching getter. The same key can be reused across multiple tables (although not in a thread-safe way).
Get the value corresponding to this key, if it exists and belongs to the same key.
Find the value for the given key, which must be of the right type.
val length : 'a t -> intNumber of bindings.
val clear : 'a t -> unitClear content of the hashtable.
val remove : 'a t -> 'a -> unitRemove the binding for this key.
val iter_keys : 'a t -> ('a -> unit) -> unitIterate on the keys of this table.
val fold_keys : 'a t -> 'b -> ('b -> 'a -> 'b) -> 'bFold over the keys.
Iterators
All the bindings that come from the corresponding injection.
\ No newline at end of file
diff --git a/dev/containers-data/CCMultiMap/index.html b/dev/containers-data/CCMultiMap/index.html
index ccdfcb41..4bc62930 100644
--- a/dev/containers-data/CCMultiMap/index.html
+++ b/dev/containers-data/CCMultiMap/index.html
@@ -1,2 +1,2 @@
-CCMultiMap (containers-data.CCMultiMap) Module CCMultiMap
Multimap
module type S = sig ... endmodule type OrderedType = sig ... endmodule Make (K : OrderedType) (V : OrderedType) : S with type key = K.t and type value = V.tTwo-Way Multimap
Represents n-to-n mappings between two types. Each element from the "left" is mapped to several right values, and conversely.
module type BIDIR = sig ... endmodule MakeBidir (L : OrderedType) (R : OrderedType) : BIDIR with type left = L.t and type right = R.t
\ No newline at end of file
+CCMultiMap (containers-data.CCMultiMap) Module CCMultiMap
Map that can map key to several values
module type S = sig ... endmodule type OrderedType = sig ... endmodule Make (K : OrderedType) (V : OrderedType) : S with type key = K.t and type value = V.tTwo-Way Multimap
Represents n-to-n mappings between two types. Each element from the "left" is mapped to several right values, and conversely.
module type BIDIR = sig ... endmodule MakeBidir (L : OrderedType) (R : OrderedType) : BIDIR with type left = L.t and type right = R.t
\ No newline at end of file
diff --git a/dev/containers-data/CCMultiSet/index.html b/dev/containers-data/CCMultiSet/index.html
index e31e6bd7..6ef0cb75 100644
--- a/dev/containers-data/CCMultiSet/index.html
+++ b/dev/containers-data/CCMultiSet/index.html
@@ -1,2 +1,2 @@
-CCMultiSet (containers-data.CCMultiSet) Module CCMultiSet
Multiset
module type S = sig ... end
\ No newline at end of file
+CCMultiSet (containers-data.CCMultiSet) Module CCMultiSet
Multiset
module type S = sig ... end
\ No newline at end of file
diff --git a/dev/containers-data/CCMutHeap/index.html b/dev/containers-data/CCMutHeap/index.html
index 86c4d2d9..9dff272f 100644
--- a/dev/containers-data/CCMutHeap/index.html
+++ b/dev/containers-data/CCMutHeap/index.html
@@ -1,2 +1,2 @@
-CCMutHeap (containers-data.CCMutHeap) Module CCMutHeap
Mutable Heaps
The classic binary heap in a vector.
STATUS: experimental, this might change in breaking ways.
module type RANKED = CCMutHeap_intf.RANKEDmodule type S = CCMutHeap_intf.S
\ No newline at end of file
+CCMutHeap (containers-data.CCMutHeap) Module CCMutHeap
Mutable Heaps
The classic binary heap in a vector.
STATUS: experimental, this might change in breaking ways.
module type RANKED = CCMutHeap_intf.RANKEDmodule type S = CCMutHeap_intf.S
\ No newline at end of file
diff --git a/dev/containers-data/CCPersistentArray/index.html b/dev/containers-data/CCPersistentArray/index.html
index 5d06bbbf..2ad31d2b 100644
--- a/dev/containers-data/CCPersistentArray/index.html
+++ b/dev/containers-data/CCPersistentArray/index.html
@@ -1,2 +1,2 @@
-CCPersistentArray (containers-data.CCPersistentArray) Module CCPersistentArray
Persistent Arrays
From the paper by Jean-Christophe Filliâtre, "A persistent Union-Find data structure", see the ps version
val make : int -> 'a -> 'a tmake n x returns a persistent array of length n, with x. All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of the array entries will modify all other entries at the same time.
val init : int -> (int -> 'a) -> 'a tinit n f returns a persistent array of length n, with element i initialized to the result of f i.
val get : 'a t -> int -> 'aget a i returns the element with index i from the array a.
val length : 'a t -> intReturn the length of the persistent array.
Apply the given function to all elements of the array, and return a persistent array initialized by the results of f. In the case of mapi, the function is also given the index of the element. It is equivalent to fun f t -> init (fun i -> f (get t i)).
val iter : ('a -> unit) -> 'a t -> unititer f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.
val iteri : (int -> 'a -> unit) -> 'a t -> unititer f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'bFold on the elements of the array.
val to_array : 'a t -> 'a arrayto_array t returns a mutable copy of t.
val of_array : 'a array -> 'a tof_array a returns an immutable copy of a.
val to_list : 'a t -> 'a listto_list t returns the list of elements in t.
val of_list : 'a list -> 'a tof_list l returns a fresh persistent array containing the elements of l.
val of_rev_list : 'a list -> 'a tof_rev_list l is the same as of_list (List.rev l) but more efficient.
Conversions
IO
\ No newline at end of file
+CCPersistentArray (containers-data.CCPersistentArray) Module CCPersistentArray
Persistent Arrays
From the paper by Jean-Christophe Filliâtre, "A persistent Union-Find data structure", see the ps version
val make : int -> 'a -> 'a tmake n x returns a persistent array of length n, with x. All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of the array entries will modify all other entries at the same time.
val init : int -> (int -> 'a) -> 'a tinit n f returns a persistent array of length n, with element i initialized to the result of f i.
val get : 'a t -> int -> 'aget a i returns the element with index i from the array a.
val length : 'a t -> intReturn the length of the persistent array.
Apply the given function to all elements of the array, and return a persistent array initialized by the results of f. In the case of mapi, the function is also given the index of the element. It is equivalent to fun f t -> init (fun i -> f (get t i)).
val iter : ('a -> unit) -> 'a t -> unititer f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.
val iteri : (int -> 'a -> unit) -> 'a t -> unititer f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'bFold on the elements of the array.
val to_array : 'a t -> 'a arrayto_array t returns a mutable copy of t.
val of_array : 'a array -> 'a tof_array a returns an immutable copy of a.
val to_list : 'a t -> 'a listto_list t returns the list of elements in t.
val of_list : 'a list -> 'a tof_list l returns a fresh persistent array containing the elements of l.
val of_rev_list : 'a list -> 'a tof_rev_list l is the same as of_list (List.rev l) but more efficient.
Conversions
IO
\ No newline at end of file
diff --git a/dev/containers-data/CCPersistentHashtbl/index.html b/dev/containers-data/CCPersistentHashtbl/index.html
index 39808b77..b427ed27 100644
--- a/dev/containers-data/CCPersistentHashtbl/index.html
+++ b/dev/containers-data/CCPersistentHashtbl/index.html
@@ -1,2 +1,2 @@
-CCPersistentHashtbl (containers-data.CCPersistentHashtbl) Module CCPersistentHashtbl
Persistent hash-table on top of OCaml's hashtables
Almost as efficient as the regular Hashtbl type, but with a persistent interface (rewinding changes to get back in the past history). This is mostly useful for backtracking-like uses, or forward uses (never using old values).
This module is not thread-safe.
module type HashedType = sig ... endSignature of such a hashtable
module type S = sig ... endImplementation
\ No newline at end of file
+CCPersistentHashtbl (containers-data.CCPersistentHashtbl) Module CCPersistentHashtbl
Persistent hash-table on top of OCaml's hashtables
Almost as efficient as the regular Hashtbl type, but with a persistent interface (rewinding changes to get back in the past history). This is mostly useful for backtracking-like uses, or forward uses (never using old values).
This module is not thread-safe.
module type HashedType = sig ... endSignature of such a hashtable
module type S = sig ... endImplementation
\ No newline at end of file
diff --git a/dev/containers-data/CCRAL/index.html b/dev/containers-data/CCRAL/index.html
index 9c38c493..0a5848fc 100644
--- a/dev/containers-data/CCRAL/index.html
+++ b/dev/containers-data/CCRAL/index.html
@@ -1,2 +1,2 @@
-CCRAL (containers-data.CCRAL) Module CCRAL
Random-Access Lists
This is an OCaml implementation of Okasaki's paper "Purely Functional Random Access Lists". It defines a list-like data structure with O(1) cons/tail operations, and O(log(n)) lookup/modification operations.
This module used to be part of containers.misc
status: stable
val empty : 'a tEmpty list.
val is_empty : _ t -> boolCheck whether the list is empty.
val return : 'a -> 'a tSingleton.
val hd : 'a t -> 'aFirst element of the list, or
val length : 'a t -> intNumber of elements. Complexity O(ln n) where n=number of elements.
val get : 'a t -> int -> 'a optionget l i accesses the i-th element of the list. O(log(n)).
get_and_remove_exn l i accesses and removes the i-th element of l.
take_drop n l splits l into a, b such that length a = n if length l >= n, and such that append a b = l.
val iter : f:('a -> unit) -> 'a t -> unitIterate on the list's elements.
val iteri : f:(int -> 'a -> unit) -> 'a t -> unitval fold : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bFold on the list's elements.
val fold_rev : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bFold on the list's elements, in reverse order (starting from the tail).
Utils
val make : int -> 'a -> 'a tval range : int -> int -> int trange i j is i; i+1; ... ; j or j; j-1; ...; i.
Conversions
val of_list : 'a list -> 'a tConvert a list to a RAL. Caution: non tail-rec.
val to_list : 'a t -> 'a listval of_array : 'a array -> 'a tval to_array : 'a t -> 'a arrayMore efficient than on usual lists.
Infix
module Infix : sig ... endIO
\ No newline at end of file
+CCRAL (containers-data.CCRAL) Module CCRAL
Random-Access Lists
This is an OCaml implementation of Okasaki's paper "Purely Functional Random Access Lists". It defines a list-like data structure with O(1) cons/tail operations, and O(log(n)) lookup/modification operations.
This module used to be part of containers.misc
status: stable
val empty : 'a tEmpty list.
val is_empty : _ t -> boolCheck whether the list is empty.
val return : 'a -> 'a tSingleton.
val hd : 'a t -> 'aFirst element of the list, or
val length : 'a t -> intNumber of elements. Complexity O(ln n) where n=number of elements.
val get : 'a t -> int -> 'a optionget l i accesses the i-th element of the list. O(log(n)).
get_and_remove_exn l i accesses and removes the i-th element of l.
take_drop n l splits l into a, b such that length a = n if length l >= n, and such that append a b = l.
val iter : f:('a -> unit) -> 'a t -> unitIterate on the list's elements.
val iteri : f:(int -> 'a -> unit) -> 'a t -> unitval fold : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bFold on the list's elements.
val fold_rev : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'bFold on the list's elements, in reverse order (starting from the tail).
Utils
val make : int -> 'a -> 'a tval range : int -> int -> int trange i j is i; i+1; ... ; j or j; j-1; ...; i.
Conversions
val of_list : 'a list -> 'a tConvert a list to a RAL. Caution: non tail-rec.
val to_list : 'a t -> 'a listval of_array : 'a array -> 'a tval to_array : 'a t -> 'a arrayMore efficient than on usual lists.
Infix
module Infix : sig ... endIO
\ No newline at end of file
diff --git a/dev/containers-data/CCRingBuffer/index.html b/dev/containers-data/CCRingBuffer/index.html
index dc5834c6..4c465c19 100644
--- a/dev/containers-data/CCRingBuffer/index.html
+++ b/dev/containers-data/CCRingBuffer/index.html
@@ -1,2 +1,2 @@
-CCRingBuffer (containers-data.CCRingBuffer) Module CCRingBuffer
Circular Buffer (Deque)
Useful for IO, or as a bounded-size alternative to Queue when batch operations are needed.
status: experimental
Change in the API to provide only a bounded buffer since 1.3
Underlying Array
module Array : sig ... endThe abstract type for arrays
module type S = sig ... endmodule Byte : S with module Array = Array.ByteAn efficient byte based ring buffer
Makes a ring buffer module with the given array type
\ No newline at end of file
+CCRingBuffer (containers-data.CCRingBuffer) Module CCRingBuffer
Circular Buffer (Deque)
Useful for IO, or as a bounded-size alternative to Queue when batch operations are needed.
status: experimental
Change in the API to provide only a bounded buffer since 1.3
Underlying Array
module Array : sig ... endThe abstract type for arrays
module type S = sig ... endmodule Byte : S with module Array = Array.ByteAn efficient byte based ring buffer
Makes a ring buffer module with the given array type
\ No newline at end of file
diff --git a/dev/containers-data/CCSimple_queue/index.html b/dev/containers-data/CCSimple_queue/index.html
index 858d441e..3c185448 100644
--- a/dev/containers-data/CCSimple_queue/index.html
+++ b/dev/containers-data/CCSimple_queue/index.html
@@ -1,2 +1,2 @@
-CCSimple_queue (containers-data.CCSimple_queue) Module CCSimple_queue
Functional queues (fifo)
Simple implementation of functional queues
val empty : 'a tval is_empty : 'a t -> boolval peek : 'a t -> 'a optionFirst element of the queue.
Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.
module Infix : sig ... endval length : 'a t -> intNumber of elements in the queue (linear in time).
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval iter : ('a -> unit) -> 'a t -> unitval to_list : 'a t -> 'a listval of_list : 'a list -> 'a tval to_seq : 'a t -> 'a Stdlib.Seq.tRenamed from to_std_seq since 3.0.
val of_seq : 'a Stdlib.Seq.t -> 'a tRenamed from of_std_seq since 3.0.
IO
\ No newline at end of file
+CCSimple_queue (containers-data.CCSimple_queue) Module CCSimple_queue
Functional queues (fifo)
Simple implementation of functional queues
val empty : 'a tval is_empty : 'a t -> boolval peek : 'a t -> 'a optionFirst element of the queue.
Append two queues. Elements from the second one come after elements of the first one. Linear in the size of the second queue.
module Infix : sig ... endval length : 'a t -> intNumber of elements in the queue (linear in time).
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval iter : ('a -> unit) -> 'a t -> unitval to_list : 'a t -> 'a listval of_list : 'a list -> 'a tval to_seq : 'a t -> 'a Stdlib.Seq.tRenamed from to_std_seq since 3.0.
val of_seq : 'a Stdlib.Seq.t -> 'a tRenamed from of_std_seq since 3.0.
IO
\ No newline at end of file
diff --git a/dev/containers-data/CCTrie/index.html b/dev/containers-data/CCTrie/index.html
index 5769e037..868ec9d2 100644
--- a/dev/containers-data/CCTrie/index.html
+++ b/dev/containers-data/CCTrie/index.html
@@ -1,2 +1,2 @@
-CCTrie (containers-data.CCTrie) Module CCTrie
Prefix Tree
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]Signatures
A Composite Word
Words are made of characters, who belong to a total order
module type WORD = sig ... endmodule type S = sig ... endImplementation
module type ORDERED = sig ... end
\ No newline at end of file
+CCTrie (containers-data.CCTrie) Module CCTrie
Prefix Tree
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]Signatures
A Composite Word
Words are made of characters, who belong to a total order
module type WORD = sig ... endmodule type S = sig ... endImplementation
module type ORDERED = sig ... end
\ No newline at end of file
diff --git a/dev/containers-data/CCWBTree/index.html b/dev/containers-data/CCWBTree/index.html
index 37603ae5..0b1e7e23 100644
--- a/dev/containers-data/CCWBTree/index.html
+++ b/dev/containers-data/CCWBTree/index.html
@@ -1,2 +1,2 @@
-CCWBTree (containers-data.CCWBTree) Module CCWBTree
Weight-Balanced Tree
status: experimental
module type ORD = sig ... endmodule type KEY = sig ... endSignature
module type S = sig ... endFunctor
\ No newline at end of file
+CCWBTree (containers-data.CCWBTree) Module CCWBTree
Weight-Balanced Tree
status: experimental
module type ORD = sig ... endmodule type KEY = sig ... endSignature
module type S = sig ... endFunctor
\ No newline at end of file
diff --git a/dev/containers-data/CCZipper/index.html b/dev/containers-data/CCZipper/index.html
index 7a423161..0b3079ef 100644
--- a/dev/containers-data/CCZipper/index.html
+++ b/dev/containers-data/CCZipper/index.html
@@ -1,2 +1,2 @@
-CCZipper (containers-data.CCZipper) Module CCZipper
List Zipper
The pair l, r represents the list List.rev_append l r, but with the focus on r
val empty : 'a tEmpty zipper.
val is_empty : _ t -> boolEmpty zipper? Returns true iff the two lists are empty.
val to_list : 'a t -> 'a listConvert the zipper back to a list. to_list (l,r) is List.rev_append l r.
val to_rev_list : 'a t -> 'a listConvert the zipper back to a reversed list. In other words, to_list (l,r) is List.rev_append r l.
val make : 'a list -> 'a tCreate a zipper pointing at the first element of the list.
Modify the current element, if any, by returning a new element, or returning None if the element is to be deleted.
Insert an element at the current position. If an element was focused, insert x l adds x just before it, and focuses on x.
val is_focused : _ t -> boolIs the zipper focused on some element? That is, will focused return a Some v?
val focused : 'a t -> 'a optionReturn the focused element, if any. focused zip = Some _ iff empty zip = false.
val focused_exn : 'a t -> 'aReturn the focused element, or
Drop every element on the "right" (calling right then will do nothing), keeping the focused element, if any.
\ No newline at end of file
+CCZipper (containers-data.CCZipper) Module CCZipper
List Zipper
The pair l, r represents the list List.rev_append l r, but with the focus on r
val empty : 'a tEmpty zipper.
val is_empty : _ t -> boolEmpty zipper? Returns true iff the two lists are empty.
val to_list : 'a t -> 'a listConvert the zipper back to a list. to_list (l,r) is List.rev_append l r.
val to_rev_list : 'a t -> 'a listConvert the zipper back to a reversed list. In other words, to_list (l,r) is List.rev_append r l.
val make : 'a list -> 'a tCreate a zipper pointing at the first element of the list.
Modify the current element, if any, by returning a new element, or returning None if the element is to be deleted.
Insert an element at the current position. If an element was focused, insert x l adds x just before it, and focuses on x.
val is_focused : _ t -> boolIs the zipper focused on some element? That is, will focused return a Some v?
val focused : 'a t -> 'a optionReturn the focused element, if any. focused zip = Some _ iff empty zip = false.
val focused_exn : 'a t -> 'aReturn the focused element, or
Drop every element on the "right" (calling right then will do nothing), keeping the focused element, if any.
\ No newline at end of file
diff --git a/dev/containers-data/index.html b/dev/containers-data/index.html
index 6aeb5b86..5d4fe3cd 100644
--- a/dev/containers-data/index.html
+++ b/dev/containers-data/index.html
@@ -1,2 +1,2 @@
-index (containers-data.index) containers-data index
Library containers-data
This library exposes the following toplevel modules:
CCBV CCBijection CCBitField CCCache CCDeque CCFQueue CCFun_vec CCGraph CCHashSet CCHashTrie CCHet CCImmutArray CCIntMap CCKTree CCLazy_list CCMixmap CCMixset CCMixtbl CCMultiMap CCMultiSet CCMutHeap CCMutHeap_intf CCPersistentArray CCPersistentHashtbl CCRAL CCRingBuffer CCSimple_queue CCTrie CCWBTree CCZipper
Library containers-data.top
The entry point of this library is the module: Containers_data_top.
\ No newline at end of file
+index (containers-data.index) containers-data index
Library containers-data
This library exposes the following toplevel modules:
CCBV Imperative BitvectorsCCBijection Functor to build a bijection Represents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely.CCBitField Efficient Bit Field for up to 31 or 61 fielsCCCache Caches UtilsCCDeque Imperative dequeCCFQueue Functional queuesCCFun_vec Functional VectorsCCGraph Simple Graph InterfaceCCHashSet Mutable SetCCHashTrie Hash TriesCCHet Associative containers with Heterogeneous ValuesCCImmutArray Immutable ArraysCCIntMap Map specialized for Int keysCCKTree Lazy Tree Structure This structure can be used to represent trees and directed graphs (as infinite trees) in a lazy fashion. Like CCKList, it is a structural type.CCLazy_list Lazy ListCCMixmap Maps with Heterogeneous ValuesCCMixset Set of Heterogeneous ValuesCCMixtbl Hash Table with Heterogeneous KeysCCMultiMap Map that can map key to several valuesCCMultiSet MultisetCCMutHeap Mutable HeapsCCMutHeap_intf CCPersistentArray Persistent ArraysCCPersistentHashtbl Persistent hash-table on top of OCaml's hashtablesCCRAL Random-Access ListsCCRingBuffer Circular Buffer (Deque)CCSimple_queue Functional queues (fifo)CCTrie Prefix TreeCCWBTree Weight-Balanced TreeCCZipper List Zipper
Library containers-data.top
The entry point of this library is the module: Containers_data_top.
\ No newline at end of file
diff --git a/dev/containers/CCArray/index.html b/dev/containers/CCArray/index.html
index 3f3b8d33..186bf252 100644
--- a/dev/containers/CCArray/index.html
+++ b/dev/containers/CCArray/index.html
@@ -1,4 +1,4 @@
-CCArray (containers.CCArray) Module CCArray
Array utils
Arrays
include module type of CCShimsArray_
include module type of struct include Stdlib.Array end
val empty : 'a tempty is the empty array, physically equal to ||.
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'afoldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init a is a fold_left-like function, but it also maps the array to another array.
scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : ('a -> 'a -> int) -> 'a t -> 'a arraysorted f a makes a copy of a and sorts it with f.
val sort_indices : ('a -> 'a -> int) -> 'a t -> int arraysort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : ('a -> 'a -> int) -> 'a t -> int arraysort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : ('a -> 'b option) -> 'a t -> 'b optionfind_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : (int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) optionfind_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).
val bsearch : cmp:('a -> 'a -> int) ->
+CCArray (containers.CCArray) Module CCArray
Array utils
Arrays
include module type of CCShimsArray_
include module type of struct include Stdlib.Array end
val empty : 'a tempty is the empty array, physically equal to [||].
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as Array.fold_left
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'afoldi f init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init a is a fold_left-like function, but it also maps the array to another array.
scan_left f init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : ('a -> 'a -> int) -> 'a t -> 'a arraysorted f a makes a copy of a and sorts it with f.
val sort_indices : ('a -> 'a -> int) -> 'a t -> int arraysort_indices f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : ('a -> 'a -> int) -> 'a t -> int arraysort_ranking f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : ('a -> 'b option) -> 'a t -> 'b optionfind_map f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : (int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) optionfind_idx f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt ~cmp. Complexity: O(log (n)) (dichotomic search).
val bsearch : cmp:('a -> 'a -> int) ->
'a -> 'a t -> [ `All_lower | `All_bigger | `Just_after of int | `Empty | `At of int ]bsearch ~cmp key a finds the index of the object key in the array a, provided a 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 a (dichotomic search).
for_all2 f [|a1; …; an|] [|b1; …; bn|] is true if each pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) && (f a2 b2) && … && (f an bn).
exists2 f [|a1; …; an|] [|b1; …; bn|] is true if any pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) || (f a2 b2) || … || (f an bn).
fold2 f init a b fold on two arrays a and b stepwise. It computes f (… (f init a1 b1) …) an bn.
val shuffle : 'a t -> unitshuffle a randomly shuffles the array a, in place.
val shuffle_with : Stdlib.Random.State.t -> 'a t -> unitshuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random state rs is used to control the random numbers being produced during shuffling (for reproducibility).
val random_choose : 'a t -> 'a random_genrandom_choose a rs randomly chooses an element of a.
to_string ~sep item_to_string a print a to a string using sep as a separator between elements of a.
to_iter a returns an iter of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the iterator.
val to_seq : 'a t -> 'a Stdlib.Seq.tto_seq a returns a Seq.t of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the sequence. Renamed from to_std_seq since 3.0.
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
val pp_i : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> (int -> 'a printer) -> 'a t printerpp_i ~pp_start ~pp_stop ~pp_sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
filter f a filters elements out of the array a. Only the elements satisfying the given predicate f will be kept.
filter_map f [|a1; …; an|] calls (f a1) … (f an) and returns an array b consisting of all elements bi such as f ai = Some bi. When f returns None, the corresponding element of a is discarded.
monoid_product f a b passes all combinaisons of tuples from the two arrays a and b to the function f.
flat_map f a transforms each element of a into an array, then flattens.
val except_idx : 'a t -> int -> 'a listexcept_idx a i removes the element of a at given index i, and returns the list of the other elements.
val random : 'a random_gen -> 'a t random_genval random_non_empty : 'a random_gen -> 'a t random_genval random_len : int -> 'a random_gen -> 'a t random_genGeneric Functions
module type MONO_ARRAY = sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) -> cmp:('elt -> 'elt -> int)
-> 'arr -> unitsort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
Infix Operators
It is convenient to open CCArray.Infix to access the infix operators without cluttering the scope too much.
module Infix : sig ... endinclude module type of Infix
val (--) : int -> int -> int tx -- y creates an array containing integers in the range x .. y. Bounds included.
val (--^) : int -> int -> int tx --^ y creates an array containing integers in the range x .. y. Right bound excluded.
Let operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a array
\ No newline at end of file
diff --git a/dev/containers/CCArrayLabels/index.html b/dev/containers/CCArrayLabels/index.html
index 5d7564ae..8a0284e2 100644
--- a/dev/containers/CCArrayLabels/index.html
+++ b/dev/containers/CCArrayLabels/index.html
@@ -1,5 +1,5 @@
-CCArrayLabels (containers.CCArrayLabels) Module CCArrayLabels
Array utils
Arrays
include module type of CCShimsArrayLabels_
include module type of Stdlib.ArrayLabels with module Floatarray = Stdlib.Array.Floatarray
val blit : src:'a array -> src_pos:int -> dst:'a array -> dst_pos:int -> len:int ->
+CCArrayLabels (containers.CCArrayLabels) Module CCArrayLabels
Array utils (Labeled version of CCArray)
Arrays
include module type of CCShimsArrayLabels_
include module type of Stdlib.ArrayLabels with module Floatarray = Stdlib.Array.Floatarray
module Floatarray : sig ... endval empty : 'a tempty is the empty array, physically equal to ||.
equal eq a1 a2 is true if the lengths of a1 and a2 are the same and if their corresponding elements test equal, using eq.
compare cmp a1 a2 compares arrays a1 and a2 using the function comparison cmp.
val swap : 'a t -> int -> int -> unitswap a i j swaps elements at indices i and j.
val get_safe : 'a t -> int -> 'a optionget_safe a i returns Some a.(i) if i is a valid index.
val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'afold ~f ~init a computes f (… (f (f init a.(0)) a.(1)) …) a.(n-1), where n is the length of the array a. Same as ArrayLabels.fold_left
val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'afoldi ~f ~init a is just like fold, but it also passes in the index of each element as the second argument to the folded function f.
val fold_while : f:('a -> 'b -> 'a * [ `Stop | `Continue ]) -> init:'a -> 'b t -> 'afold_while ~f ~init a folds left on array a until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map ~f ~init a is a fold_left-like function, but it also maps the array to another array.
scan_left ~f ~init a returns the array [|init; f init x0; f (f init a.(0)) a.(1); …|] .
val reverse_in_place : 'a t -> unitreverse_in_place a reverses the array a in place.
val sorted : f:('a -> 'a -> int) -> 'a t -> 'a arraysorted ~f a makes a copy of a and sorts it with f.
val sort_indices : f:('a -> 'a -> int) -> 'a t -> int arraysort_indices ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of sorted f a appears in a. a is not modified.
In other words, map (fun i -> a.(i)) (sort_indices f a) = sorted f a. sort_indices yields the inverse permutation of sort_ranking.
val sort_ranking : f:('a -> 'a -> int) -> 'a t -> int arraysort_ranking ~f a returns a new array b, with the same length as a, such that b.(i) is the index at which the i-th element of a appears in sorted f a. a is not modified.
In other words, map (fun i -> (sorted f a).(i)) (sort_ranking f a) = a. sort_ranking yields the inverse permutation of sort_indices.
In the absence of duplicate elements in a, we also have lookup_exn a.(i) (sorted a) = (sorted_ranking a).(i).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> boolmem ~eq x a return true if x is present in a. Linear time.
val find_map : f:('a -> 'b option) -> 'a t -> 'b optionfind_map ~f a returns Some y if there is an element x such that f x = Some y. Otherwise returns None.
val find_map_i : f:(int -> 'a -> 'b option) -> 'a t -> 'b optionfind_map_i ~f a is like find_map, but the index of the element is also passed to the predicate function f.
val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) optionfind_idx ~f a returns Some (i,x) where x is the i-th element of a, and f x holds. Otherwise returns None.
lookup ~cmp ~key a lookups the index of some key key in a sorted array a. Undefined behavior if the array a is not sorted wrt cmp. Complexity: O(log (n)) (dichotomic search).
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 a finds the index of the object key in the array a, provided a 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 a (dichotomic search).
for_all2 ~f [|a1; …; an|] [|b1; …; bn|] is true if each pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) && (f a2 b2) && … && (f an bn).
exists2 ~f [|a1; …; an|] [|b1; …; bn|] is true if any pair of elements ai bi satisfies the predicate f. That is, it returns (f a1 b1) || (f a2 b2) || … || (f an bn).
fold2 ~f ~init a b fold on two arrays a and b stepwise. It computes f (… (f init a1 b1) …) an bn.
iter2 ~f a b iterates on the two arrays a and b stepwise. It is equivalent to f a0 b0; …; f a.(length a - 1) b.(length b - 1); ().
val shuffle : 'a t -> unitshuffle a randomly shuffles the array a, in place.
val shuffle_with : Stdlib.Random.State.t -> 'a t -> unitshuffle_with rs a randomly shuffles the array a (like shuffle) but a specialized random state rs is used to control the random numbers being produced during shuffling (for reproducibility).
val random_choose : 'a t -> 'a random_genrandom_choose a rs randomly chooses an element of a.
to_string ~sep item_to_string a print a to a string using sep as a separator between elements of a.
to_iter a returns an iter of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the iterator.
val to_seq : 'a t -> 'a Stdlib.Seq.tto_seq a returns a Seq.t of the elements of an array a. The input array a is shared with the sequence and modification of it will result in modification of the sequence. Renamed from to_std_seq since 3.0.
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf a formats the array a on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
val pp_i : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> (int -> 'a printer) -> 'a t printerpp_i ~pp_start ~pp_stop ~pp_sep pp_item ppf a prints the array a on ppf. The printing function pp_item is giving both index and element. pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
map2 ~f a b applies function f to all 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)|].
filter ~f a filters elements out of the array a. Only the elements satisfying the given predicate f will be kept.
filter_map ~f [|a1; …; an|] calls (f a1) … (f an) and returns an array b consisting of all elements bi such as f ai = Some bi. When f returns None, the corresponding element of a is discarded.
monoid_product ~f a b passes all combinaisons of tuples from the two arrays a and b to the function f.
flat_map ~f a transforms each element of a into an array, then flattens.
val except_idx : 'a t -> int -> 'a listexcept_idx a i removes the element of a at given index i, and returns the list of the other elements.
val random : 'a random_gen -> 'a t random_genval random_non_empty : 'a random_gen -> 'a t random_genval random_len : int -> 'a random_gen -> 'a t random_genGeneric Functions
module type MONO_ARRAY = sig ... endval sort_generic : (module MONO_ARRAY with type elt = 'elt and type t = 'arr) -> cmp:('elt -> 'elt -> int)
-> 'arr -> unitsort_generic (module M) ~cmp a sorts the array a, without allocating (eats stack space though). Performance might be lower than Array.sort.
Infix Operators
It is convenient to open CCArray.Infix to access the infix operators without cluttering the scope too much.
module Infix : sig ... endinclude module type of Infix
val (--) : int -> int -> int tx -- y creates an array containing integers in the range x .. y. Bounds included.
val (--^) : int -> int -> int tx --^ y creates an array containing integers in the range x .. y. Right bound excluded.
Let operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a array
\ No newline at end of file
diff --git a/dev/containers/CCBool/index.html b/dev/containers/CCBool/index.html
index 266a3fab..b2da18b5 100644
--- a/dev/containers/CCBool/index.html
+++ b/dev/containers/CCBool/index.html
@@ -1,2 +1,2 @@
-CCBool (containers.CCBool) Module CCBool
Basic Bool functions
compare b1 b2 is the total ordering on booleans b1 and b2, similar to Stdlib.compare.
val to_int : t -> intto_int true = 1, to_int false = 0.
val of_int : int -> tof_int i is the same as i <> 0
\ No newline at end of file
+CCBool (containers.CCBool) Module CCBool
Basic Bool functions
compare b1 b2 is the total ordering on booleans b1 and b2, similar to Stdlib.compare.
val to_int : t -> intto_int true = 1, to_int false = 0.
val of_int : int -> tof_int i is the same as i <> 0
\ No newline at end of file
diff --git a/dev/containers/CCCanonical_sexp/index.html b/dev/containers/CCCanonical_sexp/index.html
index 7e4a001c..803fbd7d 100644
--- a/dev/containers/CCCanonical_sexp/index.html
+++ b/dev/containers/CCCanonical_sexp/index.html
@@ -1,2 +1,2 @@
-CCCanonical_sexp (containers.CCCanonical_sexp) Module CCCanonical_sexp
Canonical S-expressions
See wikipedia. These S-expressions are binary safe.
module type SEXP = CCSexp_intf.BASIC_SEXPmodule type S = CCSexp_intf.S0Basics
A simple, structural representation of S-expressions. Compatible with CCSexp.
include S with type t := t
type sexp = tRe-exports
Constructors
val of_int : int -> tval of_bool : bool -> tval of_float : float -> tval of_unit : tof_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.
Printing
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval to_file_iter : string -> t CCSexp_intf.iter -> unitPrint the given iter of expressions to a file.
val to_chan : Stdlib.out_channel -> t -> unitval pp : Stdlib.Format.formatter -> t -> unitPretty-printer nice on human eyes (including indentation).
val pp_noindent : Stdlib.Format.formatter -> t -> unitRaw, direct printing as compact as possible.
Parsing
val parse_string : string -> t CCSexp_intf.or_errorParse a string.
val parse_string_list : string -> t list CCSexp_intf.or_errorParse a string into a list of S-exprs.
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_errorParse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).
val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.genParse a channel into a generator of S-expressions.
val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_errorval parse_file : string -> t CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val parse_file_list : string -> t list CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val atom : string -> t
\ No newline at end of file
+CCCanonical_sexp (containers.CCCanonical_sexp) Module CCCanonical_sexp
Canonical S-expressions
See wikipedia. These S-expressions are binary safe.
module type SEXP = CCSexp_intf.BASIC_SEXPmodule type S = CCSexp_intf.S0Basics
A simple, structural representation of S-expressions. Compatible with CCSexp.
include S with type t := t
type sexp = tRe-exports
Constructors
val of_int : int -> tval of_bool : bool -> tval of_float : float -> tval of_unit : tof_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.
Printing
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval to_file_iter : string -> t CCSexp_intf.iter -> unitPrint the given iter of expressions to a file.
val to_chan : Stdlib.out_channel -> t -> unitval pp : Stdlib.Format.formatter -> t -> unitPretty-printer nice on human eyes (including indentation).
val pp_noindent : Stdlib.Format.formatter -> t -> unitRaw, direct printing as compact as possible.
Parsing
val parse_string : string -> t CCSexp_intf.or_errorParse a string.
val parse_string_list : string -> t list CCSexp_intf.or_errorParse a string into a list of S-exprs.
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_errorParse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).
val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.genParse a channel into a generator of S-expressions.
val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_errorval parse_file : string -> t CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val parse_file_list : string -> t list CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val atom : string -> t
\ No newline at end of file
diff --git a/dev/containers/CCChar/index.html b/dev/containers/CCChar/index.html
index 4606f20c..3e207133 100644
--- a/dev/containers/CCChar/index.html
+++ b/dev/containers/CCChar/index.html
@@ -1,2 +1,2 @@
-CCChar (containers.CCChar) Module CCChar
Utils around char
include module type of struct include Stdlib.Char end
The comparison function for characters, with the same specification as Stdlib.compare. Along with the type t, this function compare allows the module Char to be passed as argument to the functors Set.Make and Map.Make.
val of_int_exn : int -> tAlias to Char.chr. Return the character with the given ASCII code.
val of_int : int -> t optionSafe version of of_int_exn.
val to_int : t -> intAlias to Char.code. Return the ASCII code of the argument.
val to_string : t -> stringto_string c returns a string containing c
val pp_buf : Stdlib.Buffer.t -> t -> unitRenamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitRenamed from print since 2.0.
Infix Operators
module Infix : sig ... end
\ No newline at end of file
+CCChar (containers.CCChar) Module CCChar
Utils around char
include module type of struct include Stdlib.Char end
The comparison function for characters, with the same specification as Stdlib.compare. Along with the type t, this function compare allows the module Char to be passed as argument to the functors Set.Make and Map.Make.
val of_int_exn : int -> tAlias to Char.chr. Return the character with the given ASCII code.
val of_int : int -> t optionSafe version of of_int_exn.
val to_int : t -> intAlias to Char.code. Return the ASCII code of the argument.
val to_string : t -> stringto_string c returns a string containing c
val pp_buf : Stdlib.Buffer.t -> t -> unitRenamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitRenamed from print since 2.0.
Infix Operators
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCEither/index.html b/dev/containers/CCEither/index.html
index 388feba8..e0fe2ee2 100644
--- a/dev/containers/CCEither/index.html
+++ b/dev/containers/CCEither/index.html
@@ -1,4 +1,4 @@
-CCEither (containers.CCEither) Module CCEither
Either Monad
Module that is compatible with Either form OCaml 4.12 but can be use with any ocaml version compatible with container
Basics
val left : 'a -> ('a, 'b) tleft l is Left l
val right : 'b -> ('a, 'b) tright r is Right r
val is_left : ('a, 'b) t -> boolis_left x checks if x = Left _
val is_right : ('a, 'b) t -> boolis_right x checks if x = Right _
val find_left : ('a, 'b) t -> 'a optionfind_left x returns l if x = Left l and None otherwise.
val find_right : ('a, 'b) t -> 'b optionfind_right x returns r if x = Left r and None otherwise.
Map using left or right.
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'cFold using left or right.
val iter : left:('a -> unit) -> right:('b -> unit) -> ('a, 'b) t -> unitIter using left or right.
val for_all : left:('a -> bool) -> right:('b -> bool) -> ('a, 'b) t -> boolCheck some property on Left or Right variant.
val equal : left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
+CCEither (containers.CCEither) Module CCEither
Either Monad
Module that is compatible with Either form OCaml 4.12 but can be use with any ocaml version compatible with container
Basics
val left : 'a -> ('a, 'b) tleft l is Left l
val right : 'b -> ('a, 'b) tright r is Right r
val is_left : ('a, 'b) t -> boolis_left x checks if x = Left _
val is_right : ('a, 'b) t -> boolis_right x checks if x = Right _
val find_left : ('a, 'b) t -> 'a optionfind_left x returns l if x = Left l and None otherwise.
val find_right : ('a, 'b) t -> 'b optionfind_right x returns r if x = Left r and None otherwise.
Map using left or right.
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'cFold using left or right.
val iter : left:('a -> unit) -> right:('b -> unit) -> ('a, 'b) t -> unitIter using left or right.
val for_all : left:('a -> bool) -> right:('b -> bool) -> ('a, 'b) t -> boolCheck some property on Left or Right variant.
IO
\ No newline at end of file
diff --git a/dev/containers/CCEqual/index.html b/dev/containers/CCEqual/index.html
index 003634df..13526665 100644
--- a/dev/containers/CCEqual/index.html
+++ b/dev/containers/CCEqual/index.html
@@ -1,2 +1,2 @@
-CCEqual (containers.CCEqual) Module CCEqual
Equality Combinators
val poly : 'a tStandard polymorphic equality.
val physical : 'a tStandard physical equality.
val int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap 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 always_eq : _ tAlways returns true. All values are equal.
val never_eq : _ tAlways returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!
module Infix : sig ... end
\ No newline at end of file
+CCEqual (containers.CCEqual) Module CCEqual
Equality Combinators
val poly : 'a tStandard polymorphic equality.
val physical : 'a tStandard physical equality.
val int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap 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 always_eq : _ tAlways returns true. All values are equal.
val never_eq : _ tAlways returns false. No values are, so this is not even reflexive (i.e. x=x is false). Be careful!
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCEqualLabels/index.html b/dev/containers/CCEqualLabels/index.html
index c759b88c..87b8f461 100644
--- a/dev/containers/CCEqualLabels/index.html
+++ b/dev/containers/CCEqualLabels/index.html
@@ -1,2 +1,2 @@
-CCEqualLabels (containers.CCEqualLabels) Module CCEqualLabels
Equality Combinators
val poly : 'a tStandard polymorphic equality.
val physical : 'a tStandard physical equality.
val int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap 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.
module Infix : sig ... end
\ No newline at end of file
+CCEqualLabels (containers.CCEqualLabels) Module CCEqualLabels
Equality Combinators (Labeled version of CCEqual)
val poly : 'a tStandard polymorphic equality.
val physical : 'a tStandard physical equality.
val int : int tval string : string tval bool : bool tval float : float tval unit : unit tmap 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.
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCFloat/index.html b/dev/containers/CCFloat/index.html
index 82164faf..cf8f8014 100644
--- a/dev/containers/CCFloat/index.html
+++ b/dev/containers/CCFloat/index.html
@@ -1,2 +1,2 @@
-CCFloat (containers.CCFloat) Module CCFloat
Basic operations on floating-point numbers
val nan : tnan is Not a Number (NaN). Equal to Stdlib.nan.
val max_value : tmax_value is Positive infinity. Equal to Stdlib.infinity.
val min_value : tmin_value is Negative infinity. Equal to Stdlib.neg_infinity.
val max_finite_value : tmax_finite_value is the largest finite float value. Equal to Stdlib.max_float.
val epsilon : tepsilon is the smallest positive float x such that 1.0 +. x <> 1.0. Equal to Stdlib.epsilon_float.
val pi : tpi is the constant pi. The ratio of a circumference to its diameter.
val is_nan : t -> boolis_nan f returns true if f is NaN, false otherwise.
abs x is the absolute value of the floating-point number x. Equal to Stdlib.abs_float.
val hash : t -> intval random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genround x returns the closest integer value, either above or below. For n + 0.5, round returns n.
val sign_exn : t -> intsign_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.
val to_int : t -> intAlias to int_of_float. Unspecified if outside of the range of integers.
val of_int : int -> tAlias to float_of_int.
val to_string : t -> stringval of_string_exn : string -> tAlias to float_of_string.
val of_string_opt : string -> t optionEquality with allowed error up to a non negative epsilon value.
classify x returns the class of the given floating-point number x: normal, subnormal, zero, infinite or nan (not a number).
Infix Operators
module Infix : sig ... endinclude module type of Infix
\ No newline at end of file
+CCFloat (containers.CCFloat) Module CCFloat
Basic operations on floating-point numbers
val nan : tnan is Not a Number (NaN). Equal to Stdlib.nan.
val max_value : tmax_value is Positive infinity. Equal to Stdlib.infinity.
val min_value : tmin_value is Negative infinity. Equal to Stdlib.neg_infinity.
val max_finite_value : tmax_finite_value is the largest finite float value. Equal to Stdlib.max_float.
val epsilon : tepsilon is the smallest positive float x such that 1.0 +. x <> 1.0. Equal to Stdlib.epsilon_float.
val pi : tpi is the constant pi. The ratio of a circumference to its diameter.
val is_nan : t -> boolis_nan f returns true if f is NaN, false otherwise.
abs x is the absolute value of the floating-point number x. Equal to Stdlib.abs_float.
val hash : t -> intval random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genround x returns the closest integer value, either above or below. For n + 0.5, round returns n.
val sign_exn : t -> intsign_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.
val to_int : t -> intAlias to int_of_float. Unspecified if outside of the range of integers.
val of_int : int -> tAlias to float_of_int.
val to_string : t -> stringval of_string_exn : string -> tAlias to float_of_string.
val of_string_opt : string -> t optionEquality with allowed error up to a non negative epsilon value.
classify x returns the class of the given floating-point number x: normal, subnormal, zero, infinite or nan (not a number).
Infix Operators
module Infix : sig ... endinclude module type of Infix
\ No newline at end of file
diff --git a/dev/containers/CCFormat/index.html b/dev/containers/CCFormat/index.html
index c7afeb02..806a6dee 100644
--- a/dev/containers/CCFormat/index.html
+++ b/dev/containers/CCFormat/index.html
@@ -1,5 +1,5 @@
-CCFormat (containers.CCFormat) Module CCFormat
Helpers for Format
include module type of struct include Stdlib.Format end
val pp_open_box : formatter -> int -> unitval pp_close_box : formatter -> unit -> unitval pp_open_hbox : formatter -> unit -> unitval pp_open_vbox : formatter -> int -> unitval pp_open_hvbox : formatter -> int -> unitval pp_open_hovbox : formatter -> int -> unitval pp_print_string : formatter -> string -> unitval pp_print_as : formatter -> int -> string -> unitval pp_print_int : formatter -> int -> unitval pp_print_float : formatter -> float -> unitval pp_print_char : formatter -> char -> unitval pp_print_bool : formatter -> bool -> unitval pp_print_space : formatter -> unit -> unitval pp_print_cut : formatter -> unit -> unitval pp_print_break : formatter -> int -> int -> unitval pp_print_custom_break : formatter -> fits:(string * int * string) ->
+CCFormat (containers.CCFormat) Module CCFormat
Helpers for Format
include module type of struct include Stdlib.Format end
val pp_open_box : formatter -> int -> unitval pp_close_box : formatter -> unit -> unitval pp_open_hbox : formatter -> unit -> unitval pp_open_vbox : formatter -> int -> unitval pp_open_hvbox : formatter -> int -> unitval pp_open_hovbox : formatter -> int -> unitval pp_print_string : formatter -> string -> unitval pp_print_as : formatter -> int -> string -> unitval pp_print_int : formatter -> int -> unitval pp_print_float : formatter -> float -> unitval pp_print_char : formatter -> char -> unitval pp_print_bool : formatter -> bool -> unitval pp_print_space : formatter -> unit -> unitval pp_print_cut : formatter -> unit -> unitval pp_print_break : formatter -> int -> int -> unitval pp_print_custom_break : formatter -> fits:(string * int * string) ->
breaks:(string * int * string) -> unitval pp_force_newline : formatter -> unit -> unitval pp_print_if_newline : formatter -> unit -> unitval pp_print_flush : formatter -> unit -> unitval pp_print_newline : formatter -> unit -> unitval pp_set_margin : formatter -> int -> unitval pp_get_margin : formatter -> unit -> intval pp_set_max_indent : formatter -> int -> unitval pp_get_max_indent : formatter -> unit -> intval check_geometry : geometry -> boolval pp_set_geometry : formatter -> max_indent:int -> margin:int -> unitval pp_safe_set_geometry : formatter -> max_indent:int -> margin:int -> unitval get_geometry : unit -> geometryval pp_set_max_boxes : formatter -> int -> unitval pp_get_max_boxes : formatter -> unit -> intval pp_over_max_boxes : formatter -> unit -> boolval pp_open_tbox : formatter -> unit -> unitval pp_close_tbox : formatter -> unit -> unitval pp_set_tab : formatter -> unit -> unitval pp_print_tab : formatter -> unit -> unitval pp_print_tbreak : formatter -> int -> int -> unitval pp_set_ellipsis_text : formatter -> string -> unitval pp_get_ellipsis_text : formatter -> unit -> stringval open_stag : stag -> unitval pp_close_stag : formatter -> unit -> unitval pp_set_tags : formatter -> bool -> unitval pp_set_print_tags : formatter -> bool -> unitval pp_set_mark_tags : formatter -> bool -> unitval pp_get_print_tags : formatter -> unit -> boolval pp_get_mark_tags : formatter -> unit -> boolval pp_set_formatter_out_channel : formatter -> Stdlib.out_channel -> unitval pp_set_formatter_output_functions : formatter -> (string -> int -> int -> unit) -> (unit -> unit) -> unitval pp_get_formatter_output_functions : formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit)val pp_set_formatter_out_functions : formatter -> formatter_out_functions -> unitval set_formatter_out_functions : formatter_out_functions -> unitval pp_get_formatter_out_functions : formatter -> unit -> formatter_out_functionsval get_formatter_out_functions : unit -> formatter_out_functionsval pp_set_formatter_stag_functions : formatter -> formatter_stag_functions -> unitval set_formatter_stag_functions : formatter_stag_functions -> unitval pp_get_formatter_stag_functions : formatter -> unit -> formatter_stag_functionsval get_formatter_stag_functions : unit -> formatter_stag_functionsval formatter_of_out_channel : Stdlib.out_channel -> formatterval std_formatter : formatterval err_formatter : formatterval formatter_of_buffer : Stdlib.Buffer.t -> formatterval str_formatter : formatterval make_formatter : (string -> int -> int -> unit) -> (unit -> unit) -> formatterval formatter_of_out_functions : formatter_out_functions -> formatterval make_symbolic_output_buffer : unit -> symbolic_output_bufferval clear_symbolic_output_buffer : symbolic_output_buffer -> unitval get_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval flush_symbolic_output_buffer : symbolic_output_buffer -> symbolic_output_item listval add_symbolic_output_item : symbolic_output_buffer -> symbolic_output_item -> unitval formatter_of_symbolic_output_buffer : symbolic_output_buffer -> formatterval pp_print_text : formatter -> string -> unitval printf : ('a, formatter, unit) Stdlib.format -> 'aval eprintf : ('a, formatter, unit) Stdlib.format -> 'aval asprintf : ('a, formatter, unit, string) Stdlib.format4 -> 'aval kasprintf : (string -> 'a) -> ('b, formatter, unit, 'a) Stdlib.format4 -> 'bval bprintf : Stdlib.Buffer.t -> ('a, formatter, unit) Stdlib.format -> 'aval pp_set_all_formatter_output_functions : formatter -> out:(string -> int -> int -> unit) ->
diff --git a/dev/containers/CCFun/index.html b/dev/containers/CCFun/index.html
index fd7f46b9..0765564d 100644
--- a/dev/containers/CCFun/index.html
+++ b/dev/containers/CCFun/index.html
@@ -1,4 +1,4 @@
-CCFun (containers.CCFun) Module CCFun
Basic Functions
include module type of CCShimsFun_
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].
curry f x y is f (x,y). Convert a function which accepts a pair of arguments into a function which accepts two arguments.
uncurry f (x,y) is f x y. Convert a function which accepts a two arguments into a function which accepts a pair of arguments.
tap f x evaluates f x, discards it, then returns x. Useful in a pipeline, for instance:
CCArray.(1 -- 10)
+CCFun (containers.CCFun) Module CCFun
Basic operations on Functions
include module type of CCShimsFun_
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].
curry f x y is f (x,y). Convert a function which accepts a pair of arguments into a function which accepts two arguments.
uncurry f (x,y) is f x y. Convert a function which accepts a two arguments into a function which accepts a pair of arguments.
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 Stdlib.compare
Lexicographic combination of comparison functions.
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. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.
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. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.
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. If h () raises an exception, then this exception will be passed on and any exception that may have been raised by f () is lost.
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).
iterate n f is f iterated n times. That is to say, iterate 0 f x is x, iterate 1 f x is f x, iterate 2 f x is f (f x), etc.
Infix
Infix operators.
module Infix : sig ... endinclude module type of Infix
(f %> g) x or (%>) f g x is g (f x). Alias to compose.
Monad
Functions with a fixed domain are monads in their codomain.
\ No newline at end of file
diff --git a/dev/containers/CCHash/index.html b/dev/containers/CCHash/index.html
index ef0a5e90..8fe1b9cb 100644
--- a/dev/containers/CCHash/index.html
+++ b/dev/containers/CCHash/index.html
@@ -1,4 +1,4 @@
-CCHash (containers.CCHash) Module CCHash
Hash combinators
The API of this module is stable as per semantic versioning, like the rest of containers. However the exact implementation of hashing function can change and should not be relied on (i.e. hashing a value always returns the same integer within a run of a program, not across versions of OCaml and Containers).
Definitions
type 'a t = 'a -> hashA hash function for values of type 'a.
val const0 : _ tAlways 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).
val int : int tval bool : bool tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval slice : string -> int -> int tslice s i len state hashes the slice i, …, i+len-1 of s into state.
val bytes : bytes tHash a byte array.
val string : string tmap f h is the hasher that takes x, and uses h to hash f x.
For example:
module Str_set = Set.Make(String)
+CCHash (containers.CCHash) Module CCHash
Hash combinators
The API of this module is stable as per semantic versioning, like the rest of containers. However the exact implementation of hashing function can change and should not be relied on (i.e. hashing a value always returns the same integer within a run of a program, not across versions of OCaml and Containers).
Definitions
type 'a t = 'a -> hashA hash function for values of type 'a.
val const0 : _ tAlways 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).
val int : int tval bool : bool tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval slice : string -> int -> int tslice s i len state hashes the slice i, …, i+len-1 of s into state.
val bytes : bytes tHash a byte array.
val string : string tmap f h is the hasher that takes x, and uses h to hash f x.
For example:
module Str_set = Set.Make(String)
let hash_str_set : Str_set.t CCHash.t = CCHash.(map Str_set.to_seq @@ seq string)
val poly : 'a tpoly x is Hashtbl.hash x. The regular polymorphic hash function.
Commutative version of list. Lists that are equal up to permutation will have the same hash.
Commutative version of array. Arrays that are equal up to permutation will have the same hash.
Base hash combinators
Iterators
\ No newline at end of file
diff --git a/dev/containers/CCHashtbl/index.html b/dev/containers/CCHashtbl/index.html
index ecb23b08..231cd1e3 100644
--- a/dev/containers/CCHashtbl/index.html
+++ b/dev/containers/CCHashtbl/index.html
@@ -1,5 +1,5 @@
-CCHashtbl (containers.CCHashtbl) Module CCHashtbl
Extension to the standard Hashtbl
Polymorphic tables
This sub-module contains the extension of the standard polymorphic Hashtbl.
module Poly : sig ... endinclude module type of Poly
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
+CCHashtbl (containers.CCHashtbl) Module CCHashtbl
Extension to the standard Hashtbl
Polymorphic tables
This sub-module contains the extension of the standard polymorphic Hashtbl.
module Poly : sig ... endinclude module type of Poly
get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.
get_or tbl k ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in tbl).
val keys : ('a, 'b) Stdlib.Hashtbl.t -> 'a iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b itervalues tbl f iterates on values in the table tbl.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
map_list f tbl maps on a tbl's items. Collect into a list.
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).
decr ?by tbl x is 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.
val to_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) iterIterate on bindings in the table.
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
val add_iter : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add.
val add_iter_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) iter -> unitAdd the corresponding pairs to the table, using Hashtbl.add. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
Add the corresponding pairs to the table, using Hashtbl.add. Renamed from add_std_seq since 3.0.
val add_seq_with : f:('a -> 'b -> 'b -> 'b) ->
('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) Stdlib.Seq.t -> unitAdd the corresponding pairs to the table. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val of_iter : ('a * 'b) iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order.
val of_iter_with : f:('a -> 'b -> 'b -> 'b) -> ('a * 'b) iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
From the given bindings, added in order. Renamed from of_std_seq since 3.0.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a iter -> unitadd_iter_count tbl i increments the count of each element of i by calling incr. This is useful for counting how many times each element of i occurs.
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. Renamed from add_std_seq_count since 3.0.
val of_iter_count : 'a iter -> ('a, int) Stdlib.Hashtbl.tLike add_seq_count, but allocates a new table and returns it.
Like add_seq_count, but allocates a new table and returns it. Renamed from of_std_seq_count since 3.0.
to_list tbl returns the list of (key,value) bindings (order unspecified).
of_list l builds a table from the given list l 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.
From the given bindings, added in order. If a key occurs multiple times in the input, the values are combined using f in an unspecified order.
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.
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.
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> ?pp_arrow:unit printer ->
'a printer -> 'b printer -> ('a, 'b) Stdlib.Hashtbl.t printerpp ~pp_start ~pp_stop ~pp_sep ~pp arrow pp_k pp_v returns a table printer given a pp_k printer for individual key and a pp_v printer for individual value. pp_start and pp_stop control the opening and closing delimiters, by default print nothing. pp_sep control the separator between binding. pp_arrow control the arrow between the key and value. Renamed from print since 2.0.
Functor
module type S = sig ... endmodule Make (X : Stdlib.Hashtbl.HashedType) : S with type key = X.t and type
diff --git a/dev/containers/CCHeap/index.html b/dev/containers/CCHeap/index.html
index 05019bf6..6029f84f 100644
--- a/dev/containers/CCHeap/index.html
+++ b/dev/containers/CCHeap/index.html
@@ -1,2 +1,2 @@
-CCHeap (containers.CCHeap) Module CCHeap
Leftist Heaps
Implementation following Okasaki's book.
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]module type PARTIAL_ORD = sig ... endmodule type TOTAL_ORD = sig ... endmodule type S = sig ... end
\ No newline at end of file
+CCHeap (containers.CCHeap) Module CCHeap
Leftist Heaps
Implementation following Okasaki's book.
type 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]module type PARTIAL_ORD = sig ... endmodule type TOTAL_ORD = sig ... endmodule type S = sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCIO/index.html b/dev/containers/CCIO/index.html
index 9ef16dc8..6aa1d257 100644
--- a/dev/containers/CCIO/index.html
+++ b/dev/containers/CCIO/index.html
@@ -1,5 +1,5 @@
-CCIO (containers.CCIO) Module CCIO
IO Utils
Simple utilities to deal with basic Input/Output tasks in a resource-safe way. For advanced IO tasks, the user is advised to use something like Lwt or Async, that are far more comprehensive.
Examples:
- obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines_l);;
- transfer one file into another:
# CCIO.(
+CCIO (containers.CCIO) Module CCIO
1 IO Utils
Simple utilities to deal with basic Input/Output tasks in a resource-safe way. For advanced IO tasks, the user is advised to use something like Lwt or Async, that are far more comprehensive.
Examples:
- obtain the list of lines of a file:
# let l = CCIO.(with_in "/tmp/some_file" read_lines_l);;
- transfer one file into another:
# CCIO.(
with_in "/tmp/input"
(fun ic ->
let chunks = read_chunks_gen ic in
@@ -17,7 +17,7 @@
(fun oc ->
write_gen oc chunks
)
- ) ;;
See Gen in the gen library.
Input
val with_in : ?mode:int -> ?flags:Stdlib.open_flag list ->
+ ) ;;See Gen in the gen library.
Input
val with_in : ?mode:int -> ?flags:Stdlib.open_flag list ->
string -> (Stdlib.in_channel -> 'a) -> 'aOpen 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.
val read_chunks_gen : ?size:int -> Stdlib.in_channel -> string genRead the channel's content into chunks of size at most size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
Read the channel's content into chunks of size at most size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
val read_chunks_iter : ?size:int -> Stdlib.in_channel -> string iterRead the channel's content into chunks of size at most size
Read a line from the channel. Returns None if the input is terminated. The "\n" is removed from the line.
val read_lines_gen : Stdlib.in_channel -> string genRead all lines. The generator should be traversed only once. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
Read all lines. NOTE the seq must be used within the lifetime of the channel, see warning at the top of the file.
val read_lines_iter : Stdlib.in_channel -> string iterRead all lines.
Read the whole channel into a buffer, then converted into a string.
Read the whole channel into a mutable byte array.
Output
val with_out : ?mode:int -> ?flags:Stdlib.open_flag list ->
string -> (Stdlib.out_channel -> 'a) -> 'aLike with_in but for an output channel.
val with_out_a : ?mode:int -> ?flags:Stdlib.open_flag list ->
string -> (Stdlib.out_channel -> 'a) -> 'aLike with_out but with the [Open_append; Open_creat; Open_wronly] flags activated, to append to the file.
Write the given string on the channel, followed by "\n".
val write_gen : ?sep:string -> Stdlib.out_channel -> string gen -> unitWrite the given strings on the output. If provided, add sep between every two strings (but not at the end).
Write the given strings on the output. If provided, add sep between every two strings (but not at the end).
val write_lines : Stdlib.out_channel -> string gen -> unitWrite every string on the output, followed by "\n".
val write_lines_iter : Stdlib.out_channel -> string iter -> unitWrite every string on the output, followed by "\n".
Write every string on the output, followed by "\n".
Both
val with_in_out : ?mode:int -> ?flags:Stdlib.open_flag list ->
diff --git a/dev/containers/CCInt/index.html b/dev/containers/CCInt/index.html
index 256f7725..0c145b90 100644
--- a/dev/containers/CCInt/index.html
+++ b/dev/containers/CCInt/index.html
@@ -1,2 +1,2 @@
-CCInt (containers.CCInt) Module CCInt
Basic Int functions
include module type of CCShimsInt_
include module type of struct include Stdlib.Int end
val zero : tzero is the integer 0.
val one : tone is the integer 1.
val minus_one : tminus_one is the integer -1.
val max_int : tmax_int is the maximum integer.
val min_int : tmin_int is the minimum integer.
compare x y is the comparison function for integers with the same specification as Stdlib.compare.
val hash : t -> inthash x computes the hash of x.
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x 0.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
val random : int -> t random_genval random_small : t random_genval random_range : int -> int -> t random_genval to_float : t -> floatto_float is the same as float_of_int
val to_string : t -> stringto_string x returns the string representation of the integer x, in signed decimal.
val of_string : string -> t optionof_string s converts the given string s into an integer. Safe version of of_string_exn.
val of_string_exn : string -> tof_string_exn s converts the given string s to an integer. Alias to int_of_string.
val of_float : float -> tof_float x converts the given floating-point number x to an integer. Alias to int_of_float.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val popcount : t -> intNumber of bits set to 1
Infix Operators
module Infix : sig ... endinclude module type of Infix
\ No newline at end of file
+CCInt (containers.CCInt) Module CCInt
Basic Int functions
include module type of CCShimsInt_
include module type of struct include Stdlib.Int end
val zero : tzero is the integer 0.
val one : tone is the integer 1.
val minus_one : tminus_one is the integer -1.
val max_int : tmax_int is the maximum integer.
val min_int : tmin_int is the minimum integer.
compare x y is the comparison function for integers with the same specification as Stdlib.compare.
val hash : t -> inthash x computes the hash of x.
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x 0.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
val random : int -> t random_genval random_small : t random_genval random_range : int -> int -> t random_genval to_float : t -> floatto_float is the same as float_of_int
val to_string : t -> stringto_string x returns the string representation of the integer x, in signed decimal.
val of_string : string -> t optionof_string s converts the given string s into an integer. Safe version of of_string_exn.
val of_string_exn : string -> tof_string_exn s converts the given string s to an integer. Alias to int_of_string.
val of_float : float -> tof_float x converts the given floating-point number x to an integer. Alias to int_of_float.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val popcount : t -> intNumber of bits set to 1
Infix Operators
module Infix : sig ... endinclude module type of Infix
\ No newline at end of file
diff --git a/dev/containers/CCInt32/index.html b/dev/containers/CCInt32/index.html
index 7c91f325..32134e3e 100644
--- a/dev/containers/CCInt32/index.html
+++ b/dev/containers/CCInt32/index.html
@@ -1,2 +1,2 @@
-CCInt32 (containers.CCInt32) Module CCInt32
Int32
Helpers for 32-bit integers.
This module provides operations on the type int32 of signed 32-bit integers. Unlike the built-in int type, the type int32 is guaranteed to be exactly 32-bit wide on all platforms. All arithmetic operations over int32 are taken modulo 232.
Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.
include module type of struct include Stdlib.Int32 end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a 32-bit integer. Alias to Int32.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int it is converted to the signed integer CCInt32.min_int + input - CCInt32.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int32.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int32.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.
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 >= 32.
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 >= 32.
\ No newline at end of file
+CCInt32 (containers.CCInt32) Module CCInt32
Helpers for 32-bit integers.
This module provides operations on the type int32 of signed 32-bit integers. Unlike the built-in int type, the type int32 is guaranteed to be exactly 32-bit wide on all platforms. All arithmetic operations over int32 are taken modulo 232.
Performance notice: values of type int32 occupy more memory space than values of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic.
include module type of struct include Stdlib.Int32 end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a 32-bit integer. Alias to Int32.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt32.max_int+1]. If the input exceeds CCInt32.max_int it is converted to the signed integer CCInt32.min_int + input - CCInt32.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int32.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int32.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits, filling in with zeroes. The result is unspecified if y < 0 or y >= 32.
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 >= 32.
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 >= 32.
\ No newline at end of file
diff --git a/dev/containers/CCInt64/index.html b/dev/containers/CCInt64/index.html
index 6645fb32..0f692135 100644
--- a/dev/containers/CCInt64/index.html
+++ b/dev/containers/CCInt64/index.html
@@ -1,2 +1,2 @@
-CCInt64 (containers.CCInt64) Module CCInt64
Int64
Helpers for 64-bit integers.
This module provides operations on the type int64 of signed 64-bit integers. Unlike the built-in int type, the type int64 is guaranteed to be exactly 64-bit wide on all platforms. All arithmetic operations over int64 are taken modulo 264.
Performance notice: values of type int64 occupy more memory space than values of type int, and arithmetic operations on int64 are generally slower than those on int. Use int64 only when the application requires exact 64-bit arithmetic.
include module type of struct include Stdlib.Int64 end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a 64-bit integer. Alias to Int64.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int it is converted to the signed integer CCInt64.min_int + input - CCInt64.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int64.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int64.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
Infix operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
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.
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.
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.
\ No newline at end of file
+CCInt64 (containers.CCInt64) Module CCInt64
Helpers for 64-bit integers.
This module provides operations on the type int64 of signed 64-bit integers. Unlike the built-in int type, the type int64 is guaranteed to be exactly 64-bit wide on all platforms. All arithmetic operations over int64 are taken modulo 264.
Performance notice: values of type int64 occupy more memory space than values of type int, and arithmetic operations on int64 are generally slower than those on int. Use int64 only when the application requires exact 64-bit arithmetic.
include module type of struct include Stdlib.Int64 end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a 64-bit integer. Alias to Int64.of_string. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCInt64.max_int+1]. If the input exceeds CCInt64.max_int it is converted to the signed integer CCInt64.min_int + input - CCInt64.max_int - 1.
The _ (underscore) character can appear anywhere in the string and is ignored. Raise Failure "Int64.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int64.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
Infix operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
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.
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.
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.
\ No newline at end of file
diff --git a/dev/containers/CCList/index.html b/dev/containers/CCList/index.html
index c168ccfe..5fa46640 100644
--- a/dev/containers/CCList/index.html
+++ b/dev/containers/CCList/index.html
@@ -1,5 +1,5 @@
-CCList (containers.CCList) Module CCList
Complements to list
include module type of Stdlib.List
val empty : 'a tempty is [].
val is_empty : _ t -> boolis_empty l returns true iff l = [].
map f [a0; a1; …; an] applies function f in turn to a0; a1; …; an. Safe version of List.map.
append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.
cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.
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 l is preserved. Safe version of List.filter.
val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'bfold_right f [a1; …; an] b is f a1 (f a2 ( … (f an b) … )). Safe version of List.fold_right.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init l is a fold_left-like function, but it also maps the list to another list.
fold_map_i f init l is a foldi-like function, but it also maps the list to another list.
fold_on_map ~f ~reduce init l combines map f and fold_left reduce init in one operation.
scan_left f init l returns the list [init; f init x0; f (f init x0) x1; …] where x0, x1, etc. are the elements of l.
reduce f (hd::tl) returns Some (fold_left f hd tl). If l is empty, then None is returned.
reduce_exn is the unsafe version of reduce.
fold_map2 f init l1 l2 is to fold_map what List.map2 is to List.map.
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.
val fold_filter_map_i : ('acc -> int -> 'a -> 'acc * 'b option) -> 'acc -> 'a list -> 'acc * 'b listfold_filter_map_i f init l is a foldi-like function, but also generates a list of output in a way similar to filter_map.
fold_flat_map f init l is a fold_left-like function, but it also maps the list to a list of lists that is then flatten'd.
fold_flat_map_i f init l is a fold_left-like function, but it also maps the list to a list of lists that is then flatten'd.
count p l counts how many elements of l satisfy predicate p.
count_true_false p l returns a pair (int1,int2) where int1 is the number of elements in l that satisfy the predicate p, and int2 the number of elements that do not satisfy p.
val init : int -> (int -> 'a) -> 'a tinit len f is f 0; f 1; …; f (len-1).
combine [a1; …; an] [b1; …; bn] is [(a1,b1); …; (an,bn)]. Transform two lists into a list of pairs. Like List.combine but tail-recursive.
val combine_gen : 'a list -> 'b list -> ('a * 'b) gencombine_shortest [a1; …; am] [b1; …; bn] is [(a1,b1); …; (am,bm)] if m <= n. Like combine but stops at the shortest list rather than raising.
split [(a1,b1); …; (an,bn)] is ([a1; …; an], [b1; …; bn]). Transform a list of pairs into a pair of lists. A tail-recursive version of List.split.
compare cmp l1 l2 compares the two lists l1 and l2 using the given comparison function cmp.
compare_lengths l1 l2 compare the lengths of the two lists l1 and l2. Equivalent to compare (length l1) (length l2) but more efficient.
val compare_length_with : 'a t -> int -> intcompare_length_with l x compares the length of the list l to an integer x. Equivalent to compare (length l) x but more efficient.
equal p l1 l2 returns true if l1 and l2 are equal.
flat_map f l maps and flattens at the same time (safe). Evaluation order is not guaranteed.
flat_map_i f l maps with index and flattens at the same time (safe). Evaluation order is not guaranteed.
flatten [l1]; [l2]; … concatenates a list of lists. Safe version of List.flatten.
product comb l1 l2 computes the cartesian product of the two lists, with the given combinator comb.
fold_product f init l1 l2 applies the function f with the accumulator init on all the pair of elements of l1 and l2. Fold on the cartesian product.
cartesian_product [[l1]; [l2]; …; [ln]] produces the cartesian product of this list of lists, by returning all the ways of picking one element per sublist. NOTE the order of the returned list is unspecified. For example:
# cartesian_product [[1;2];[3];[4;5;6]] |> sort =
+CCList (containers.CCList) Module CCList
Complements to List
include module type of Stdlib.List
val empty : 'a tempty is [].
val is_empty : _ t -> boolis_empty l returns true iff l = [].
map f [a0; a1; …; an] applies function f in turn to a0; a1; …; an. Safe version of List.map.
append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.
cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.
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 l is preserved. Safe version of List.filter.
val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'bfold_right f [a1; …; an] b is f a1 (f a2 ( … (f an b) … )). Safe version of List.fold_right.
val fold_while : ('a -> 'b -> 'a * [ `Stop | `Continue ]) -> 'a -> 'b t -> 'afold_while f init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map f init l is a fold_left-like function, but it also maps the list to another list.
fold_map_i f init l is a foldi-like function, but it also maps the list to another list.
fold_on_map ~f ~reduce init l combines map f and fold_left reduce init in one operation.
scan_left f init l returns the list [init; f init x0; f (f init x0) x1; …] where x0, x1, etc. are the elements of l.
reduce f (hd::tl) returns Some (fold_left f hd tl). If l is empty, then None is returned.
reduce_exn is the unsafe version of reduce.
fold_map2 f init l1 l2 is to fold_map what List.map2 is to List.map.
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.
val fold_filter_map_i : ('acc -> int -> 'a -> 'acc * 'b option) -> 'acc -> 'a list -> 'acc * 'b listfold_filter_map_i f init l is a foldi-like function, but also generates a list of output in a way similar to filter_map.
fold_flat_map f init l is a fold_left-like function, but it also maps the list to a list of lists that is then flatten'd.
fold_flat_map_i f init l is a fold_left-like function, but it also maps the list to a list of lists that is then flatten'd.
count p l counts how many elements of l satisfy predicate p.
count_true_false p l returns a pair (int1,int2) where int1 is the number of elements in l that satisfy the predicate p, and int2 the number of elements that do not satisfy p.
val init : int -> (int -> 'a) -> 'a tinit len f is f 0; f 1; …; f (len-1).
combine [a1; …; an] [b1; …; bn] is [(a1,b1); …; (an,bn)]. Transform two lists into a list of pairs. Like List.combine but tail-recursive.
val combine_gen : 'a list -> 'b list -> ('a * 'b) gencombine_shortest [a1; …; am] [b1; …; bn] is [(a1,b1); …; (am,bm)] if m <= n. Like combine but stops at the shortest list rather than raising.
split [(a1,b1); …; (an,bn)] is ([a1; …; an], [b1; …; bn]). Transform a list of pairs into a pair of lists. A tail-recursive version of List.split.
compare cmp l1 l2 compares the two lists l1 and l2 using the given comparison function cmp.
compare_lengths l1 l2 compare the lengths of the two lists l1 and l2. Equivalent to compare (length l1) (length l2) but more efficient.
val compare_length_with : 'a t -> int -> intcompare_length_with l x compares the length of the list l to an integer x. Equivalent to compare (length l) x but more efficient.
equal p l1 l2 returns true if l1 and l2 are equal.
flat_map f l maps and flattens at the same time (safe). Evaluation order is not guaranteed.
flat_map_i f l maps with index and flattens at the same time (safe). Evaluation order is not guaranteed.
flatten [l1]; [l2]; … concatenates a list of lists. Safe version of List.flatten.
product comb l1 l2 computes the cartesian product of the two lists, with the given combinator comb.
fold_product f init l1 l2 applies the function f with the accumulator init on all the pair of elements of l1 and l2. Fold on the cartesian product.
cartesian_product [[l1]; [l2]; …; [ln]] produces the cartesian product of this list of lists, by returning all the ways of picking one element per sublist. NOTE the order of the returned list is unspecified. For example:
# cartesian_product [[1;2];[3];[4;5;6]] |> sort =
[[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 =
diff --git a/dev/containers/CCListLabels/index.html b/dev/containers/CCListLabels/index.html
index af6dde92..531cb256 100644
--- a/dev/containers/CCListLabels/index.html
+++ b/dev/containers/CCListLabels/index.html
@@ -1,5 +1,5 @@
-CCListLabels (containers.CCListLabels) Module CCListLabels
Complements to list
include module type of Stdlib.ListLabels
val empty : 'a tempty is [].
val is_empty : _ t -> boolis_empty l returns true iff l = [].
map ~f [a0; a1; …; an] applies function f in turn to [a0; a1; …; an]. Safe version of List.map.
append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.
cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.
filter ~f l returns all the elements of the list l that satisfy the predicate f. The order of the elements in the input list l is preserved. Safe version of List.filter.
val fold_right : f:('a -> 'b -> 'b) -> 'a t -> init:'b -> 'bfold_right ~f [a1; …; an] ~init is f a1 (f a2 ( … (f an init) … )). Safe version of List.fold_right.
val fold_while : f:('a -> 'b -> 'a * [ `Stop | `Continue ]) -> init:'a -> 'b t -> 'afold_while ~f ~init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map ~f ~init l is a fold_left-like function, but it also maps the list to another list.
val fold_map_i : f:('acc -> int -> 'a -> 'acc * 'b) -> init:'acc ->
+CCListLabels (containers.CCListLabels) Module CCListLabels
Complements to ListLabels
include module type of Stdlib.ListLabels
val empty : 'a tempty is [].
val is_empty : _ t -> boolis_empty l returns true iff l = [].
map ~f [a0; a1; …; an] applies function f in turn to [a0; a1; …; an]. Safe version of List.map.
append l1 l2 returns the list that is the concatenation of l1 and l2. Safe version of List.append.
cons' l x is the same as x :: l. This is convenient for fold functions such as List.fold_left or Array.fold_left.
filter ~f l returns all the elements of the list l that satisfy the predicate f. The order of the elements in the input list l is preserved. Safe version of List.filter.
val fold_right : f:('a -> 'b -> 'b) -> 'a t -> init:'b -> 'bfold_right ~f [a1; …; an] ~init is f a1 (f a2 ( … (f an init) … )). Safe version of List.fold_right.
val fold_while : f:('a -> 'b -> 'a * [ `Stop | `Continue ]) -> init:'a -> 'b t -> 'afold_while ~f ~init l folds until a stop condition via ('a, `Stop) is indicated by the accumulator.
fold_map ~f ~init l is a fold_left-like function, but it also maps the list to another list.
fold_map_i ~f ~init l is a foldi-like function, but it also maps the list to another list.
fold_on_map ~f ~reduce ~init l combines map ~f and fold_left ~reduce ~init in one operation.
scan_left ~f ~init l returns the list [init; f init x0; f (f init x0) x1; …] where x0, x1, etc. are the elements of l.
reduce f (hd::tl) returns Some (fold_left f hd tl). If l is empty, then None is returned.
reduce_exn is the unsafe version of reduce.
val fold_map2 : f:('acc -> 'a -> 'b -> 'acc * 'c) -> init:'acc ->
'a list -> 'b list -> 'acc * 'c listfold_map2 ~f ~init l1 l2 is to fold_map what List.map2 is to List.map.
val fold_filter_map : f:('acc -> 'a -> 'acc * 'b option) -> init:'acc ->
diff --git a/dev/containers/CCMap/index.html b/dev/containers/CCMap/index.html
index 8e4b0fa6..c7971ed5 100644
--- a/dev/containers/CCMap/index.html
+++ b/dev/containers/CCMap/index.html
@@ -1,2 +1,2 @@
-CCMap (containers.CCMap) Module CCMap
Extensions of Standard Map
Provide useful functions and iterators on Map.S
module type S = sig ... end
\ No newline at end of file
+CCMap (containers.CCMap) Module CCMap
Extensions of Standard Map
Provide useful functions and iterators on Map.S
module type S = sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCNativeint/index.html b/dev/containers/CCNativeint/index.html
index f479b308..934bb196 100644
--- a/dev/containers/CCNativeint/index.html
+++ b/dev/containers/CCNativeint/index.html
@@ -1,2 +1,2 @@
-CCNativeint (containers.CCNativeint) Module CCNativeint
Nativeint
Helpers for processor-native integers
This module provides operations on the type nativeint of signed 32-bit integers (on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). This integer type has exactly the same width as that of a pointer type in the C compiler. All arithmetic operations over nativeint are taken modulo 232 or 264 depending on the word size of the architecture.
Performance notice: values of type nativeint occupy more memory space than values of type int, and arithmetic operations on nativeint are generally slower than those on int. Use nativeint only when the application requires the extra bit of precision over the int type.
include module type of struct include Stdlib.Nativeint end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a native integer. Alias to Nativeint.of_string. Convert the given string to a native integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int it is converted to the signed integer CCInt64.min_int + input - CCNativeint.max_int - 1.
Raise Failure "Nativeint.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type nativeint.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.
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 >= bitsize.
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 >= bitsize.
\ No newline at end of file
+CCNativeint (containers.CCNativeint) Module CCNativeint
Helpers for processor-native integers
This module provides operations on the type nativeint of signed 32-bit integers (on 32-bit platforms) or signed 64-bit integers (on 64-bit platforms). This integer type has exactly the same width as that of a pointer type in the C compiler. All arithmetic operations over nativeint are taken modulo 232 or 264 depending on the word size of the architecture.
Performance notice: values of type nativeint occupy more memory space than values of type int, and arithmetic operations on nativeint are generally slower than those on int. Use nativeint only when the application requires the extra bit of precision over the int type.
include module type of struct include Stdlib.Nativeint end
val hash : t -> inthash x computes the hash of x. Like Stdlib.abs (to_int x).
val sign : t -> intsign x return 0 if x = 0, -1 if x < 0 and 1 if x > 0. Same as compare x zero.
pow base exponent returns base raised to the power of exponent. pow x y = x^y for positive integers x and y. Raises Invalid_argument if x = y = 0 or y < 0.
floor_div x n is integer division rounding towards negative infinity. It satisfies x = m * floor_div x n + rem x n.
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.
range i j iterates on integers from i to j included . It works both for decreasing and increasing ranges.
range' i j is like range but the second bound j is excluded. For instance range' 0 5 = Iter.of_list [0;1;2;3;4].
val random : t -> t random_genval random_small : t random_genval random_range : t -> t -> t random_genConversion
val of_string : string -> t optionof_string s is the safe version of of_string_exn. Like of_string_exn, but return None instead of raising.
val of_string_exn : string -> tof_string_exn s converts the given string s into a native integer. Alias to Nativeint.of_string. Convert the given string to a native integer. The string is read in decimal (by default, or if the string begins with 0u) or in hexadecimal, octal or binary if the string begins with 0x, 0o or 0b respectively.
The 0u prefix reads the input as an unsigned integer in the range [0, 2*CCNativeint.max_int+1]. If the input exceeds CCNativeint.max_int it is converted to the signed integer CCInt64.min_int + input - CCNativeint.max_int - 1.
Raise Failure "Nativeint.of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type nativeint.
val to_string_binary : t -> stringto_string_binary x returns the string representation of the integer x, in binary.
Printing
Infix Operators
module Infix : sig ... endinclude module type of Infix
x / y is the integer quotient of x and y. Integer division. Raise Division_by_zero if the second argument y is zero. This division rounds the real quotient of its arguments towards zero, as specified for Stdlib.(/).
x mod y is the integer remainder of x / y. If y <> zero, the result of x mod y satisfies the following properties: zero <= x mod y < abs y and x = ((x / y) * y) + (x mod y). If y = 0, x mod y raises Division_by_zero.
x lsl y shifts x to the left by y bits. The result is unspecified if y < 0 or y >= bitsize, where bitsize is 32 on a 32-bit platform and 64 on a 64-bit platform.
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 >= bitsize.
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 >= bitsize.
\ No newline at end of file
diff --git a/dev/containers/CCOpt/index.html b/dev/containers/CCOpt/index.html
index 48940ae4..081e9fb0 100644
--- a/dev/containers/CCOpt/index.html
+++ b/dev/containers/CCOpt/index.html
@@ -1,2 +1,2 @@
-CCOpt (containers.CCOpt) Module CCOpt
Option module
include module type of CCOption
val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
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 _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ('a -> unit) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
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.
val exists : ('a -> bool) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ('a -> bool) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : (unit -> 'a) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.
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.
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.
wrap2 ?handler f x y is similar to wrap but for binary functions.
Applicative
f <*> (Some x) returns Some (f x) and f <*> None returns None.
Alternatives
or_lazy ~else_ o is o if o is Some _, else_ () if o is None.
val return_if : bool -> 'a -> 'a treturn_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.
Infix Operators
module Infix : sig ... endLet operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a option
Conversion and IO
val to_list : 'a t -> 'a listto_list o returns [x] if o is Some x or the empty list [] if o is None.
val of_list : 'a list -> 'a tof_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.resultto_result e o returns Ok x if o is Some x, or Error e if o is None.
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a, 'e) Stdlib.resultto_result_lazy f o returns Ok x if o is Some x or Error f if o is None.
val of_result : ('a, _) Stdlib.result -> 'a tof_result result returns an option from a result.
val random : 'a random_gen -> 'a t random_genchoice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.
choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.
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.tto_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.
\ No newline at end of file
+CCOpt (containers.CCOpt) Module CCOpt
Previous Option module
include module type of CCOption
val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
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 _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ('a -> unit) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
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.
val exists : ('a -> bool) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ('a -> bool) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : (unit -> 'a) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.
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.
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.
wrap2 ?handler f x y is similar to wrap but for binary functions.
Applicative
f <*> (Some x) returns Some (f x) and f <*> None returns None.
Alternatives
or_lazy ~else_ o is o if o is Some _, else_ () if o is None.
val return_if : bool -> 'a -> 'a treturn_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.
Infix Operators
module Infix : sig ... endLet operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a option
Conversion and IO
val to_list : 'a t -> 'a listto_list o returns [x] if o is Some x or the empty list [] if o is None.
val of_list : 'a list -> 'a tof_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.resultto_result e o returns Ok x if o is Some x, or Error e if o is None.
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a, 'e) Stdlib.resultto_result_lazy f o returns Ok x if o is Some x or Error f if o is None.
val of_result : ('a, _) Stdlib.result -> 'a tof_result result returns an option from a result.
val random : 'a random_gen -> 'a t random_genchoice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.
choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.
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.tto_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.
\ No newline at end of file
diff --git a/dev/containers/CCOption/index.html b/dev/containers/CCOption/index.html
index b2e05402..216f5292 100644
--- a/dev/containers/CCOption/index.html
+++ b/dev/containers/CCOption/index.html
@@ -1,2 +1,2 @@
-CCOption (containers.CCOption) Module CCOption
Options
This module replaces `CCOpt`.
val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
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 _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ('a -> unit) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
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.
val exists : ('a -> bool) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ('a -> bool) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : (unit -> 'a) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.
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.
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.
wrap2 ?handler f x y is similar to wrap but for binary functions.
Applicative
f <*> (Some x) returns Some (f x) and f <*> None returns None.
Alternatives
or_lazy ~else_ o is o if o is Some _, else_ () if o is None.
val return_if : bool -> 'a -> 'a treturn_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.
Infix Operators
module Infix : sig ... endLet operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a option
Conversion and IO
val to_list : 'a t -> 'a listto_list o returns [x] if o is Some x or the empty list [] if o is None.
val of_list : 'a list -> 'a tof_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.resultto_result e o returns Ok x if o is Some x, or Error e if o is None.
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a, 'e) Stdlib.resultto_result_lazy f o returns Ok x if o is Some x or Error f if o is None.
val of_result : ('a, _) Stdlib.result -> 'a tof_result result returns an option from a result.
val random : 'a random_gen -> 'a t random_genchoice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.
choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.
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.tto_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.
\ No newline at end of file
+CCOption (containers.CCOption) Module CCOption
Basic operations on the option type.
This module replaces `CCOpt`.
val map_or : default:'b -> ('a -> 'b) -> 'a t -> 'bmap_or ~default f o is f x if o = Some x, default otherwise.
val map_lazy : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise.
val is_some : _ t -> boolis_some (Some x) returns true otherwise it returns false.
val is_none : _ t -> boolis_none None returns true otherwise it returns false.
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 _.
equal p o1 o2 tests for equality between option types o1 and o2, using a custom equality predicate p.
val return : 'a -> 'a treturn x is a monadic return, that is return x = Some x.
val none : 'a tAlias to None.
bind o f is f v if o is Some v, None otherwise. Monadic bind.
map2 f o1 o2 maps 'a option and 'b option to a 'c option using f.
val iter : ('a -> unit) -> 'a t -> unititer f o applies f to o. Iterate on 0 or 1 element.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afold f init o is f init x if o is Some x, or init if o is None. Fold on 0 or 1 element.
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.
val exists : ('a -> bool) -> 'a t -> boolexists f o returns true iff there exists an element for which the provided function f evaluates to true.
val for_all : ('a -> bool) -> 'a t -> boolfor_all f o returns true iff the provided function f evaluates to true for all elements.
val get_or : default:'a -> 'a t -> 'aget_or ~default o extracts the value from o, or returns default if o is None.
val value : 'a t -> default:'a -> 'avalue o ~default is similar to the Stdlib's Option.value and to get_or.
val get_exn : 'a t -> 'aget_exn o returns x if o is Some x or fails if o is None.
val get_exn_or : string -> 'a t -> 'aget_exn_or msg o returns x if o is Some x or fails with Invalid_argument msg if o is None.
val get_lazy : (unit -> 'a) -> 'a t -> 'aget_lazy default_fn o unwraps o, but if o is None it returns default_fn () instead.
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.
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.
wrap2 ?handler f x y is similar to wrap but for binary functions.
Applicative
f <*> (Some x) returns Some (f x) and f <*> None returns None.
Alternatives
or_lazy ~else_ o is o if o is Some _, else_ () if o is None.
val return_if : bool -> 'a -> 'a treturn_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.
Infix Operators
module Infix : sig ... endLet operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S with type 'a t_let := 'a option
Conversion and IO
val to_list : 'a t -> 'a listto_list o returns [x] if o is Some x or the empty list [] if o is None.
val of_list : 'a list -> 'a tof_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.resultto_result e o returns Ok x if o is Some x, or Error e if o is None.
val to_result_lazy : (unit -> 'e) -> 'a t -> ('a, 'e) Stdlib.resultto_result_lazy f o returns Ok x if o is Some x or Error f if o is None.
val of_result : ('a, _) Stdlib.result -> 'a tof_result result returns an option from a result.
val random : 'a random_gen -> 'a t random_genchoice_iter iter is similar to choice, but works on iter. It returns the first Some x occurring in iter, or None otherwise.
choice_seq seq works on Seq.t. It returns the first Some x occurring in seq, or None otherwise.
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.tto_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.
\ No newline at end of file
diff --git a/dev/containers/CCOrd/index.html b/dev/containers/CCOrd/index.html
index af4f0c40..58518de6 100644
--- a/dev/containers/CCOrd/index.html
+++ b/dev/containers/CCOrd/index.html
@@ -1,5 +1,5 @@
-CCOrd (containers.CCOrd) Module CCOrd
Comparisons
val poly : 'a tPolymorphic "magic" comparison. Use with care, as it will fail on some types.
val compare : 'a tPolymorphic "magic" comparison.
Opposite order. For example, opp cmp a b < 0 iff cmp b a > 0. This can be used to sort values in the opposite order, among other things.
val int : int tval string : string tval bool : bool tval float : float tLexicographic Combination
val (<?>) : int -> ('a t * 'a * 'a) -> intc1 <?> (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
+CCOrd (containers.CCOrd) Module CCOrd
Order combinators
Comparisons
val poly : 'a tPolymorphic "magic" comparison. Use with care, as it will fail on some types.
val compare : 'a tPolymorphic "magic" comparison.
Opposite order. For example, opp cmp a b < 0 iff cmp b a > 0. This can be used to sort values in the opposite order, among other things.
val int : int tval string : string tval bool : bool tval float : float tLexicographic Combination
val (<?>) : int -> ('a t * 'a * 'a) -> intc1 <?> (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
<?> (String.compare, "a", "b")
<?> (CCBool.compare, true, false)
Same example, using only CCOrd::
CCOrd.(int 1 3
<?> (string, "a", "b")
diff --git a/dev/containers/CCPair/index.html b/dev/containers/CCPair/index.html
index 06197420..cf3a7175 100644
--- a/dev/containers/CCPair/index.html
+++ b/dev/containers/CCPair/index.html
@@ -1,2 +1,2 @@
-CCPair (containers.CCPair) Module CCPair
Tuple Functions
val make : 'a -> 'b -> ('a, 'b) tMake a tuple from its components.
map_fst f (x, y) returns (f x, y). Renamed from map1 since 3.0.
map_snd f (x, y) returns (x, f y). Renamed from map2 since 3.0.
Synonym to ( *** ). Map on both sides of a tuple.
Like map but specialized for pairs with elements of the same type.
map2 f g (a,b) (x,y) return (f a x, g b y).
map_same2 f (a,b) (x,y) return (f a x, f b y).
Compose the given function with fst. Rename from map_fst since 3.0.
Compose the given function with snd. Rename from map_snd since 3.0.
f &&& g is fun x -> f x, g x. It splits the computations into two parts.
Synonym to merge.
dup_map f x = (x, f x). Duplicates the value and applies the function to the second copy.
Print tuple in a string
\ No newline at end of file
+CCPair (containers.CCPair) Module CCPair
Tuple Functions
val make : 'a -> 'b -> ('a, 'b) tMake a tuple from its components.
map_fst f (x, y) returns (f x, y). Renamed from map1 since 3.0.
map_snd f (x, y) returns (x, f y). Renamed from map2 since 3.0.
Synonym to ( *** ). Map on both sides of a tuple.
Like map but specialized for pairs with elements of the same type.
map2 f g (a,b) (x,y) return (f a x, g b y).
map_same2 f (a,b) (x,y) return (f a x, f b y).
Compose the given function with fst. Rename from map_fst since 3.0.
Compose the given function with snd. Rename from map_snd since 3.0.
f &&& g is fun x -> f x, g x. It splits the computations into two parts.
Synonym to merge.
dup_map f x = (x, f x). Duplicates the value and applies the function to the second copy.
Print tuple in a string
\ No newline at end of file
diff --git a/dev/containers/CCParse/index.html b/dev/containers/CCParse/index.html
index 7eef1fce..7c9b2306 100644
--- a/dev/containers/CCParse/index.html
+++ b/dev/containers/CCParse/index.html
@@ -1,5 +1,5 @@
-CCParse (containers.CCParse) Module CCParse
Very Simple Parser Combinators
These combinators can be used to write very simple parsers, for example to extract data from a line-oriented file, or as a replacement to Scanf.
A few examples
Some more advanced example(s) can be found in the /examples directory.
Parse a tree
open CCParse;;
+CCParse (containers.CCParse) Module CCParse
Very Simple Parser Combinators
These combinators can be used to write very simple parsers, for example to extract data from a line-oriented file, or as a replacement to Scanf.
A few examples
Some more advanced example(s) can be found in the /examples directory.
Parse a tree
open CCParse;;
type tree = L of int | N of tree * tree;;
diff --git a/dev/containers/CCRandom/index.html b/dev/containers/CCRandom/index.html
index c2874751..9a6fd392 100644
--- a/dev/containers/CCRandom/index.html
+++ b/dev/containers/CCRandom/index.html
@@ -1,5 +1,5 @@
-CCRandom (containers.CCRandom) Module CCRandom
Random Generators
include module type of struct include Stdlib.Random end
type 'a t = state -> 'aRandom generator for values of type 'a.
type 'a random_gen = 'a tval return : 'a -> 'a treturn x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).
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 ;;
+CCRandom (containers.CCRandom) Module CCRandom
Random Generators
include module type of struct include Stdlib.Random end
type 'a t = state -> 'aRandom generator for values of type 'a.
type 'a random_gen = 'a tval return : 'a -> 'a treturn x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).
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 ;;
delay (fun () ->
let name = gensym() in
diff --git a/dev/containers/CCRef/index.html b/dev/containers/CCRef/index.html
index 52c45b31..9e503b45 100644
--- a/dev/containers/CCRef/index.html
+++ b/dev/containers/CCRef/index.html
@@ -1,2 +1,2 @@
-CCRef (containers.CCRef) Module CCRef
References
val create : 'a -> 'a tAlias to ref.
val iter : ('a -> unit) -> 'a t -> unitCall the function on the content of the reference.
val update : ('a -> 'a) -> 'a t -> unitUpdate the reference's content with the given function.
val incr_then_get : int t -> intincr_then_get r increments r and returns its new value, think ++r.
val get_then_incr : int t -> intget_then_incr r increments r and returns its old value, think r++.
val to_list : 'a t -> 'a list
\ No newline at end of file
+CCRef (containers.CCRef) Module CCRef
Helpers for references
val create : 'a -> 'a tAlias to ref.
val iter : ('a -> unit) -> 'a t -> unitCall the function on the content of the reference.
val update : ('a -> 'a) -> 'a t -> unitUpdate the reference's content with the given function.
val incr_then_get : int t -> intincr_then_get r increments r and returns its new value, think ++r.
val get_then_incr : int t -> intget_then_incr r increments r and returns its old value, think r++.
val to_list : 'a t -> 'a list
\ No newline at end of file
diff --git a/dev/containers/CCResult/index.html b/dev/containers/CCResult/index.html
index 02187a42..5895a1d3 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.
Basics
val return : 'a -> ('a, 'err) tSuccessfully return a value.
val fail : 'err -> ('a, 'err) tFail with an error.
val of_exn : exn -> ('a, string) tof_exn e uses Printexc to print the exception as a string.
val of_exn_trace : exn -> ('a, string) tof_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 -> 'afail_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 -> 'afail_fprintf format uses format to obtain an error message and then returns Error msg.
add_ctx msg leaves Ok x untouched, but transforms Error s into Error s' where s' contains the additional context given by msg.
val add_ctxf : ('a, Stdlib.Format.formatter, unit, ('b, string) t -> ('b, string) t) Stdlib.format4 -> 'aadd_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)"
Like map, but also with a function that can transform the error message in case of failure.
val iter : ('a -> unit) -> ('a, _) t -> unitApply the function only in case of Ok.
val iter_err : ('err -> unit) -> (_, 'err) t -> unitApply the function in case of Error.
val get_exn : ('a, _) t -> 'aExtract the value x from Ok x, fails otherwise. You should be careful with this function, and favor other combinators whenever possible.
val get_or : ('a, _) t -> default:'a -> 'aget_or e ~default returns x if e = Ok x, default otherwise.
val get_or_failwith : ('a, string) t -> 'aget_or_failwith e returns x if e = Ok x, fails otherwise.
val get_lazy : ('b -> 'a) -> ('a, 'b) t -> 'aget_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.
val map_or : ('a -> 'b) -> ('a, 'c) t -> default:'b -> 'bmap_or f e ~default returns f x if e = Ok x, default otherwise.
val catch : ('a, 'err) t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'bcatch e ~ok ~err calls either ok or err depending on the value of e.
val fold : ok:('a -> 'b) -> error:('err -> 'b) -> ('a, 'err) t -> 'bfold ~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 -> 'afold_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.
val is_ok : ('a, 'err) t -> boolReturn true if Ok.
val is_error : ('a, 'err) t -> boolReturn true if Error.
Wrappers
val guard : (unit -> 'a) -> ('a, exn) tguard 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_trace : (unit -> 'a) -> ('a, string) tLike guard_str but uses of_exn_trace instead of of_exn so that the stack trace is printed.
val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) tLike guard but gives the function two arguments.
val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) tLike guard but gives the function three arguments.
Applicative
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.
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 ... endinclude module type of Infix
Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.
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
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a, 'e) result
Let operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a, 'e) result
Collections
Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.
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.
Misc
choose l selects a member of l that is a Ok _ value, or returns Error l otherwise, where l is the list of errors.
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 ... endConversions
val to_opt : ('a, _) t -> 'a optionConvert a result to an option.
val of_opt : 'a option -> ('a, string) tConvert an option to a result.
val to_seq : ('a, _) t -> 'a Stdlib.Seq.tRenamed from to_std_seq since 3.0.
IO
\ No newline at end of file
+CCResult (containers.CCResult) Module CCResult
Error Monad
Uses the new "result" type from OCaml 4.03.
Basics
val return : 'a -> ('a, 'err) tSuccessfully return a value.
val fail : 'err -> ('a, 'err) tFail with an error.
val of_exn : exn -> ('a, string) tof_exn e uses Printexc to print the exception as a string.
val of_exn_trace : exn -> ('a, string) tof_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 -> 'afail_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 -> 'afail_fprintf format uses format to obtain an error message and then returns Error msg.
add_ctx msg leaves Ok x untouched, but transforms Error s into Error s' where s' contains the additional context given by msg.
val add_ctxf : ('a, Stdlib.Format.formatter, unit, ('b, string) t -> ('b, string) t) Stdlib.format4 -> 'aadd_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)"
Like map, but also with a function that can transform the error message in case of failure.
val iter : ('a -> unit) -> ('a, _) t -> unitApply the function only in case of Ok.
val iter_err : ('err -> unit) -> (_, 'err) t -> unitApply the function in case of Error.
val get_exn : ('a, _) t -> 'aExtract the value x from Ok x, fails otherwise. You should be careful with this function, and favor other combinators whenever possible.
val get_or : ('a, _) t -> default:'a -> 'aget_or e ~default returns x if e = Ok x, default otherwise.
val get_or_failwith : ('a, string) t -> 'aget_or_failwith e returns x if e = Ok x, fails otherwise.
val get_lazy : ('b -> 'a) -> ('a, 'b) t -> 'aget_lazy default_fn x unwraps x, but if x = Error e it returns default_fr e instead.
val map_or : ('a -> 'b) -> ('a, 'c) t -> default:'b -> 'bmap_or f e ~default returns f x if e = Ok x, default otherwise.
val catch : ('a, 'err) t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'bcatch e ~ok ~err calls either ok or err depending on the value of e.
val fold : ok:('a -> 'b) -> error:('err -> 'b) -> ('a, 'err) t -> 'bfold ~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 -> 'afold_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.
val is_ok : ('a, 'err) t -> boolReturn true if Ok.
val is_error : ('a, 'err) t -> boolReturn true if Error.
Wrappers
val guard : (unit -> 'a) -> ('a, exn) tguard 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_trace : (unit -> 'a) -> ('a, string) tLike guard_str but uses of_exn_trace instead of of_exn so that the stack trace is printed.
val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) tLike guard but gives the function two arguments.
val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) tLike guard but gives the function three arguments.
Applicative
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.
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 ... endinclude module type of Infix
Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.
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
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a, 'e) result
Let operators on OCaml >= 4.08.0, nothing otherwise
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a, 'e) result
Collections
Same as map_l id: returns Ok [x1;…;xn] if l=[Ok x1; …; Ok xn], or the first error otherwise.
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.
Misc
choose l selects a member of l that is a Ok _ value, or returns Error l otherwise, where l is the list of errors.
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 ... endConversions
val to_opt : ('a, _) t -> 'a optionConvert a result to an option.
val of_opt : 'a option -> ('a, string) tConvert an option to a result.
val to_seq : ('a, _) t -> 'a Stdlib.Seq.tRenamed from to_std_seq since 3.0.
IO
\ No newline at end of file
diff --git a/dev/containers/CCSeq/index.html b/dev/containers/CCSeq/index.html
index 5edd9f2f..050d5471 100644
--- a/dev/containers/CCSeq/index.html
+++ b/dev/containers/CCSeq/index.html
@@ -1,2 +1,2 @@
-CCSeq (containers.CCSeq) Module CCSeq
Helpers for the standard Seq type
See oseq for a richer API.
Basics
type +'a t = unit -> 'a nodeval nil : 'a tval empty : 'a tval singleton : 'a -> 'a tval repeat : ?n:int -> 'a -> 'a trepeat ~n x repeats x n times then stops. If n is omitted, then x is repeated forever.
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a tunfold f acc calls f acc and:
- if
f acc = Some (x, acc'), yield x, continue with unfold f acc'. - if
f acc = None, stops.
val is_empty : 'a t -> boolval head : 'a t -> 'a optionHead of the list.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aFold on values.
val iter : ('a -> unit) -> 'a t -> unitval iteri : (int -> 'a -> unit) -> 'a t -> unitIterate with index (starts at 0).
val length : _ t -> intNumber of elements in the list. Will not terminate if the list if infinite: use (for instance) take to make the list finite if necessary.
Fair product of two (possibly infinite) lists into a new list. Lazy. The first parameter is used to combine each pair of elements.
Specialization of product_with producing tuples.
group eq l groups together consecutive elements that satisfy eq. Lazy. For instance group (=) [1;1;1;2;2;3;3;1] yields [1;1;1]; [2;2]; [3;3]; [1].
uniq eq l returns l but removes consecutive duplicates. Lazy. In other words, if several values that are equal follow one another, only the first of them is kept.
val for_all : ('a -> bool) -> 'a t -> boolfor_all p [a1; ...; an] checks if all elements of the sequence satisfy the predicate p. That is, it returns (p a1) && ... && (p an) for a non-empty list and true if the sequence is empty. It consumes the sequence until it finds an element not satisfying the predicate.
val exists : ('a -> bool) -> 'a t -> boolexists p [a1; ...; an] checks if at least one element of the sequence satisfies the predicate p. That is, it returns (p a1) || ... || (p an) for a non-empty sequence and false if the list is empty. It consumes the sequence until it finds an element satisfying the predicate.
val range : int -> int -> int tval (--) : int -> int -> int ta -- b is the range of integers containing a and b (therefore, never empty).
val (--^) : int -> int -> int ta -- b is the integer range from a to b, where b is excluded.
Operations on two Collections
Fold on two collections at once. Stop at soon as one of them ends.
Map on two collections at once. Stop as soon as one of the arguments is exhausted.
Iterate on two collections at once. Stop as soon as one of them ends.
Combine elements pairwise. Stop as soon as one of the lists stops.
Misc
Eager sort. Require the iterator to be finite. O(n ln(n)) time and space.
Eager sort that removes duplicate values. Require the iterator to be finite. O(n ln(n)) time and space.
Fair Combinations
Implementations
val return : 'a -> 'a tval pure : 'a -> 'a tInfix version of fair_flat_map.
Infix operators
module Infix : sig ... endmodule type MONAD = sig ... endConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listGather all values into a list.
val of_array : 'a array -> 'a tIterate on the array.
val to_array : 'a t -> 'a arrayConvert into array. Iterate twice.
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf s formats the sequence s on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
\ No newline at end of file
+CCSeq (containers.CCSeq) Module CCSeq
Helpers for the standard Seq type
See oseq for a richer API.
Basics
type +'a t = unit -> 'a nodeval nil : 'a tval empty : 'a tval singleton : 'a -> 'a tval repeat : ?n:int -> 'a -> 'a trepeat ~n x repeats x n times then stops. If n is omitted, then x is repeated forever.
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a tunfold f acc calls f acc and:
- if
f acc = Some (x, acc'), yield x, continue with unfold f acc'. - if
f acc = None, stops.
val is_empty : 'a t -> boolval head : 'a t -> 'a optionHead of the list.
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aFold on values.
val iter : ('a -> unit) -> 'a t -> unitval iteri : (int -> 'a -> unit) -> 'a t -> unitIterate with index (starts at 0).
val length : _ t -> intNumber of elements in the list. Will not terminate if the list if infinite: use (for instance) take to make the list finite if necessary.
Fair product of two (possibly infinite) lists into a new list. Lazy. The first parameter is used to combine each pair of elements.
Specialization of product_with producing tuples.
group eq l groups together consecutive elements that satisfy eq. Lazy. For instance group (=) [1;1;1;2;2;3;3;1] yields [1;1;1]; [2;2]; [3;3]; [1].
uniq eq l returns l but removes consecutive duplicates. Lazy. In other words, if several values that are equal follow one another, only the first of them is kept.
val for_all : ('a -> bool) -> 'a t -> boolfor_all p [a1; ...; an] checks if all elements of the sequence satisfy the predicate p. That is, it returns (p a1) && ... && (p an) for a non-empty list and true if the sequence is empty. It consumes the sequence until it finds an element not satisfying the predicate.
val exists : ('a -> bool) -> 'a t -> boolexists p [a1; ...; an] checks if at least one element of the sequence satisfies the predicate p. That is, it returns (p a1) || ... || (p an) for a non-empty sequence and false if the list is empty. It consumes the sequence until it finds an element satisfying the predicate.
val range : int -> int -> int tval (--) : int -> int -> int ta -- b is the range of integers containing a and b (therefore, never empty).
val (--^) : int -> int -> int ta -- b is the integer range from a to b, where b is excluded.
Operations on two Collections
Fold on two collections at once. Stop at soon as one of them ends.
Map on two collections at once. Stop as soon as one of the arguments is exhausted.
Iterate on two collections at once. Stop as soon as one of them ends.
Combine elements pairwise. Stop as soon as one of the lists stops.
Misc
Eager sort. Require the iterator to be finite. O(n ln(n)) time and space.
Eager sort that removes duplicate values. Require the iterator to be finite. O(n ln(n)) time and space.
Fair Combinations
Implementations
val return : 'a -> 'a tval pure : 'a -> 'a tInfix version of fair_flat_map.
Infix operators
module Infix : sig ... endmodule type MONAD = sig ... endConversions
val of_list : 'a list -> 'a tval to_list : 'a t -> 'a listGather all values into a list.
val of_array : 'a array -> 'a tIterate on the array.
val to_array : 'a t -> 'a arrayConvert into array. Iterate twice.
IO
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> 'a t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf s formats the sequence s on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
\ No newline at end of file
diff --git a/dev/containers/CCSet/index.html b/dev/containers/CCSet/index.html
index a6f45757..9e783edc 100644
--- a/dev/containers/CCSet/index.html
+++ b/dev/containers/CCSet/index.html
@@ -1,2 +1,2 @@
-CCSet (containers.CCSet) Module CCSet
Wrapper around Set
module type S = sig ... end
\ No newline at end of file
+CCSet (containers.CCSet) Module CCSet
Wrapper around Set
module type S = sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCSexp/index.html b/dev/containers/CCSexp/index.html
index 42f7da2b..2f1a15e9 100644
--- a/dev/containers/CCSexp/index.html
+++ b/dev/containers/CCSexp/index.html
@@ -1,2 +1,2 @@
-CCSexp (containers.CCSexp) Module CCSexp
Handling S-expressions
module type SEXP = CCSexp_intf.SEXPmodule type S = CCSexp_intf.SBasics
A simple, structural representation of S-expressions.
include S with type t := t
include CCSexp_intf.S0 with type t := t
type sexp = tRe-exports
val atom : string -> tMake an atom out of this string.
Constructors
val of_int : int -> tval of_bool : bool -> tval of_float : float -> tval of_unit : tof_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.
Printing
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval to_file_iter : string -> t CCSexp_intf.iter -> unitPrint the given iter of expressions to a file.
val to_chan : Stdlib.out_channel -> t -> unitval pp : Stdlib.Format.formatter -> t -> unitPretty-printer nice on human eyes (including indentation).
val pp_noindent : Stdlib.Format.formatter -> t -> unitRaw, direct printing as compact as possible.
Parsing
val parse_string : string -> t CCSexp_intf.or_errorParse a string.
val parse_string_list : string -> t list CCSexp_intf.or_errorParse a string into a list of S-exprs.
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_errorParse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).
val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.genParse a channel into a generator of S-expressions.
val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_errorval parse_file : string -> t CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val parse_file_list : string -> t list CCSexp_intf.or_errorOpen the file and read a S-exp from it.
Parsing
A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.
module Decoder : sig ... endval atom : string -> tBuild an atom directly from a string.
\ No newline at end of file
+CCSexp (containers.CCSexp) Module CCSexp
Handling S-expressions
module type SEXP = CCSexp_intf.SEXPmodule type S = CCSexp_intf.SBasics
A simple, structural representation of S-expressions.
include S with type t := t
include CCSexp_intf.S0 with type t := t
type sexp = tRe-exports
val atom : string -> tMake an atom out of this string.
Constructors
val of_int : int -> tval of_bool : bool -> tval of_float : float -> tval of_unit : tof_variant name args is used to encode algebraic variants into a S-expr. For instance of_variant "some" [of_int 1] represents the value Some 1.
Printing
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval to_file_iter : string -> t CCSexp_intf.iter -> unitPrint the given iter of expressions to a file.
val to_chan : Stdlib.out_channel -> t -> unitval pp : Stdlib.Format.formatter -> t -> unitPretty-printer nice on human eyes (including indentation).
val pp_noindent : Stdlib.Format.formatter -> t -> unitRaw, direct printing as compact as possible.
Parsing
val parse_string : string -> t CCSexp_intf.or_errorParse a string.
val parse_string_list : string -> t list CCSexp_intf.or_errorParse a string into a list of S-exprs.
val parse_chan : Stdlib.in_channel -> t CCSexp_intf.or_errorParse a S-expression from the given channel. Can read more data than necessary, so don't use this if you need finer-grained control (e.g. to read something else after the S-exp).
val parse_chan_gen : Stdlib.in_channel -> t CCSexp_intf.or_error CCSexp_intf.genParse a channel into a generator of S-expressions.
val parse_chan_list : Stdlib.in_channel -> t list CCSexp_intf.or_errorval parse_file : string -> t CCSexp_intf.or_errorOpen the file and read a S-exp from it.
val parse_file_list : string -> t list CCSexp_intf.or_errorOpen the file and read a S-exp from it.
Parsing
A parser of 'a can return Yield x when it parsed a value, or Fail e when a parse error was encountered, or End if the input was empty.
module Decoder : sig ... endval atom : string -> tBuild an atom directly from a string.
\ No newline at end of file
diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html
index 84e0ea0f..d9d5e844 100644
--- a/dev/containers/CCString/index.html
+++ b/dev/containers/CCString/index.html
@@ -1,3 +1,3 @@
-CCString (containers.CCString) Module CCString
Basic String Utils
include module type of struct include Stdlib.String end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unitblit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : ('a -> char -> 'a) -> 'a -> t -> 'afold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : ('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.
mem ~start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
val replace : ?which:[ `Left | `Right | `All ] -> sub:string -> by:string ->
+CCString (containers.CCString) Module CCString
Basic String Utils
include module type of struct include Stdlib.String end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unitblit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : ('a -> char -> 'a) -> 'a -> t -> 'afold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : ('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.
mem ~start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
replace ~which ~sub ~by s replaces some occurrences of sub by by in s.
is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.
chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.
chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.
val lines_gen : string -> string genlines_gen s returns the gen of the lines of s (splits along '\n').
val lines_iter : string -> string iterlines_iter s returns the iter of the lines of s (splits along '\n').
lines_seq s returns the Seq.t of the lines of s (splits along '\n').
val concat_gen : sep:string -> string gen -> stringconcat_gen ~sep gen concatenates all strings of gen, separated with sep.
concat_seq ~sep seq concatenates all strings of seq, separated with sep.
val concat_iter : sep:string -> string iter -> stringconcat_iter ~sep iter concatenates all strings of iter, separated with sep.
val unlines_gen : string gen -> stringunlines_gen gen concatenates all strings of gen, separated with '\n'.
val unlines_iter : string iter -> stringunlines_iter iter concatenates all strings of iter, separated with '\n'.
unlines_seq seq concatenates all strings of seq, separated with '\n'.
set s i c creates a new string which is a copy of s, except for index i, which becomes c.
iter f s applies function f on each character of s. Alias to String.iter.
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).
filter f s discards characters of s not satisfying f.
uniq eq s remove consecutive duplicate characters in s.
flat_map ~sep f s maps each chars of s to a string, then concatenates them all.
for_all f s is true iff all characters of s satisfy the predicate f.
exists f s is true iff some character of s satisfy the predicate f.
drop_while f s discards any characters of s starting from the left, up to the first character c not satisfying f c.
rdrop_while f s discards any characters of s starting from the right, up to the first character c not satisfying f c.
Operations on 2 strings
iter2 f s1 s2 iterates on pairs of chars.
iteri2 f s1 s2 iterates on pairs of chars with their index.
fold2 f init s1 s2 folds on pairs of chars.
for_all2 f s1 s2 returns true iff all pairs of chars satisfy the predicate f.
exists2 f s1 s2 returns true iff a pair of chars satisfy the predicate f.
Ascii functions
Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.
equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.
Finding
A relatively efficient algorithm for finding sub-strings.
module Find : sig ... endSplitting
module Split : sig ... endsplit_on_char by s splits the string s along the given char by.
split ~by s splits the string s along the given string by. Alias to Split.list_cpy.
Utils
compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.
compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order
edit_distance ~cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.
Infix operators
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCStringLabels/index.html b/dev/containers/CCStringLabels/index.html
index 3e42645b..a1102f1e 100644
--- a/dev/containers/CCStringLabels/index.html
+++ b/dev/containers/CCStringLabels/index.html
@@ -1,4 +1,4 @@
-CCStringLabels (containers.CCStringLabels) Module CCStringLabels
Basic String Utils
include module type of struct include Stdlib.StringLabels end
val to_seqi : t -> (int * char) Stdlib.Seq.tval unsafe_blit : src:string -> src_pos:int -> dst:bytes -> dst_pos:int -> len:int ->
+CCStringLabels (containers.CCStringLabels) Module CCStringLabels
Basic String Utils (Labeled version of CCString)
include module type of struct include Stdlib.StringLabels end
val to_seqi : t -> (int * char) Stdlib.Seq.tval length : t -> intlength s returns the length (number of characters) of the given string s.
val blit : src:t -> src_pos:int -> dst:Stdlib.Bytes.t -> dst_pos:int -> len:int -> unitblit ~src ~src_pos ~dst ~dst_pos ~len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.
val fold : f:('a -> char -> 'a) -> init:'a -> t -> 'afold ~f ~init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].
val foldi : f:('a -> int -> char -> 'a) -> 'a -> t -> 'afoldi ~f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.
Conversions
val to_seq : t -> char Stdlib.Seq.tto_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.
val to_list : t -> char listto_list s returns the list of characters contained in the string s.
val pp_buf : Stdlib.Buffer.t -> t -> unitpp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.
val pp : Stdlib.Format.formatter -> t -> unitpp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.
Strings
compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.
pad ?side ?c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.
val of_gen : char gen -> stringof_gen gen converts a gen of characters to a string.
val of_iter : char iter -> stringof_iter iter converts an iter of characters to a string.
of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.
to_array s returns the array of characters contained in the string s.
find ?start ~sub s returns the starting index of the first occurrence of sub within s or -1.
val find_all : ?start:int -> sub:string -> string -> int genfind_all ?start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.
find_all_l ?start ~sub s finds all occurrences of sub in s and returns them in a list.
mem ?start ~sub s is true iff sub is a substring of s.
rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.
replace ?which ~sub ~by s replaces some occurrences of sub by by in s.
is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.
chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.
chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.
val lines_gen : string -> string genlines_gen s returns a generator gen of the lines of s (splits along '\n').
val lines_iter : string -> string iterlines_iter s returns the iter of the lines of s (splits along '\n').
lines_seq s returns the Seq.t of the lines of s (splits along '\n').
val concat_iter : sep:string -> string iter -> stringconcat_iter ~sep iter concatenates all strings of iter, separated with sep.
val concat_gen : sep:string -> string gen -> stringconcat_gen ~sep gen concatenates all strings of gen, separated with sep.
concat_seq ~sep seq concatenates all strings of seq, separated with sep.
val unlines_gen : string gen -> stringunlines_gen gen concatenates all strings of gen, separated with '\n'.
val unlines_iter : string iter -> stringunlines_iter iter concatenates all strings of iter, separated with '\n'.
unlines_seq seq concatenates all strings of seq, separated with '\n'.
set s i c creates a new string which is a copy of s, except for index i, which becomes c.
iter ~f s applies function f on each character of s. Alias to String.iter.
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).
filter ~f s discards characters of s not satisfying f.
uniq ~eq s remove consecutive duplicate characters in s.
flat_map ?sep ~f s maps each chars of s to a string, then concatenates them all.
for_all ~f s is true iff all characters of s satisfy the predicate f.
exists ~f s is true iff some character of s satisfy the predicate f.
drop_while ~f s discards any characters of s starting from the left, up to the first character c not satisfying f c.
rdrop_while ~f s discards any characters of s starting from the right, up to the first character c not satisfying f c.
Operations on 2 strings
iter2 ~f s1 s2 iterates on pairs of chars.
iteri2 ~f s1 s2 iterates on pairs of chars with their index.
fold2 ~f ~init s1 s2 folds on pairs of chars.
for_all2 ~f s1 s2 returns true iff all pairs of chars satisfy the predicate f.
exists2 ~f s1 s2 returns true iff a pair of chars satisfy the predicate f.
Ascii functions
Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.
capitalize_ascii s returns a copy of s with the first character set to uppercase using the US-ASCII character set. See String.
uncapitalize_ascii s returns a copy of s with the first character set to lowercase using the US-ASCII character set. See String.
uppercase_ascii s returns a copy of s with all lowercase letters translated to uppercase using the US-ASCII character set. See String.
lowercase_ascii s returns a copy of s with all uppercase letters translated to lowercase using the US-ASCII character set. See String.
equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.
Finding
A relatively efficient algorithm for finding sub-strings.
module Find : sig ... endSplitting
module Split : sig ... endsplit_on_char ~by s splits the string s along the given char by.
split ~by s splits the string s along the given string by. Alias to Split.list_cpy.
Utils
compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.
compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order
edit_distance ?cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.
Infix operators
module Infix : sig ... end
\ No newline at end of file
diff --git a/dev/containers/CCUtf8_string/index.html b/dev/containers/CCUtf8_string/index.html
index 4f24e988..5697c0e9 100644
--- a/dev/containers/CCUtf8_string/index.html
+++ b/dev/containers/CCUtf8_string/index.html
@@ -1,2 +1,2 @@
-CCUtf8_string (containers.CCUtf8_string) Module CCUtf8_string
Unicode String, in UTF8
A unicode string represented by a utf8 bytestring. This representation is convenient for manipulating normal OCaml strings that are encoded in UTF8.
We perform only basic decoding and encoding between codepoints and bytestrings. For more elaborate operations, please use the excellent Uutf.
status: experimental
val hash : t -> intval pp : Stdlib.Format.formatter -> t -> unitval to_string : t -> stringIdentity.
Iter of unicode codepoints. Renamed from to_std_seq since 3.0.
val n_chars : t -> intNumber of characters.
val n_bytes : t -> intNumber of bytes.
val empty : tEmpty string.
concat sep l concatenates each string in l, inserting sep in between each string. Similar to String.concat.
Build a string from unicode codepoints Renamed from of_std_seq since 3.0.
Translate the unicode codepoint to a list of utf-8 bytes. This can be used, for example, in combination with Buffer.add_char on a pre-allocated buffer to add the bytes one by one (despite its name, Buffer.add_char takes individual bytes, not unicode codepoints).
val of_string_exn : string -> tValidate string by checking it is valid UTF8.
val of_string : string -> t optionSafe version of of_string_exn.
val unsafe_of_string : string -> tConversion from a string without validating. CAUTION this is unsafe and can break all the other functions in this module. Use only if you're sure the string is valid UTF8. Upon iteration, if an invalid substring is met, Malformed will be raised.
\ No newline at end of file
+CCUtf8_string (containers.CCUtf8_string) Module CCUtf8_string
Unicode String, in UTF8
A unicode string represented by a utf8 bytestring. This representation is convenient for manipulating normal OCaml strings that are encoded in UTF8.
We perform only basic decoding and encoding between codepoints and bytestrings. For more elaborate operations, please use the excellent Uutf.
status: experimental
val hash : t -> intval pp : Stdlib.Format.formatter -> t -> unitval to_string : t -> stringIdentity.
Iter of unicode codepoints. Renamed from to_std_seq since 3.0.
val n_chars : t -> intNumber of characters.
val n_bytes : t -> intNumber of bytes.
val empty : tEmpty string.
concat sep l concatenates each string in l, inserting sep in between each string. Similar to String.concat.
Build a string from unicode codepoints Renamed from of_std_seq since 3.0.
Translate the unicode codepoint to a list of utf-8 bytes. This can be used, for example, in combination with Buffer.add_char on a pre-allocated buffer to add the bytes one by one (despite its name, Buffer.add_char takes individual bytes, not unicode codepoints).
val of_string_exn : string -> tValidate string by checking it is valid UTF8.
val of_string : string -> t optionSafe version of of_string_exn.
val unsafe_of_string : string -> tConversion from a string without validating. CAUTION this is unsafe and can break all the other functions in this module. Use only if you're sure the string is valid UTF8. Upon iteration, if an invalid substring is met, Malformed will be raised.
\ No newline at end of file
diff --git a/dev/containers/CCVector/index.html b/dev/containers/CCVector/index.html
index 92d5b6c2..30c4cf7e 100644
--- a/dev/containers/CCVector/index.html
+++ b/dev/containers/CCVector/index.html
@@ -1,3 +1,3 @@
-CCVector (containers.CCVector) Module CCVector
Growable, mutable vector
Mutability is rw (read-write) or ro (read-only).
Create a new vector, the value is used to enforce the type the new vector.
val return : 'a -> ('a, 'mut) tSingleton vector.
val make : int -> 'a -> ('a, 'mut) tmake n x makes a vector of size n, filled with x.
val init : int -> (int -> 'a) -> ('a, 'mut) tInit the vector with the given function and size.
Clear the content of the vector. This ensures that length v = 0 but the underlying array is kept, and possibly references to former elements, which are therefore not garbage collectible.
Clear the content of the vector, and deallocate the underlying array, removing references to all the elements. The elements can be collected.
Hint to the vector that it should have at least the given capacity. This does not affect length v.
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 -> boolIs the vector empty?
resize_with vec f size resizes vector vec up to size, fills vector with calls to f on indexes [vec.size-1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.
resize_with_init vec init size resizes vector vec up to size, fills vector with calls to init on indexes [length vec -1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.
Append content of iterator. Renamed from append_std_seq since 3.0.
val top : ('a, _) t -> 'a optionTop element, if present.
val top_exn : ('a, _) t -> 'aTop element, if present.
Truncate to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size. truncate was called shrink.
val shrink_to_fit : ('a, _) t -> unitShrink internal array to fit the size of the vector
val member : eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> boolIs the element a member of the vector?
Sort the vector, returning a copy of it that is sorted w.r.t the given ordering. The vector itself is unchanged. The underlying array of the new vector can be smaller than the original one.
Sort the vector in place (modifying it). This function change the size of the underlying array.
Sort the array and remove duplicates, in place (e.g. modifying the vector itself).
val iter : ('a -> unit) -> ('a, _) t -> unitIterate on the vector's content.
val iteri : (int -> 'a -> unit) -> ('a, _) t -> unitIterate on the vector, with indexes.
map f v is just like map, but it also passes in the index of each element as the first argument to the function f.
val map_in_place : ('a -> 'a) -> ('a, _) t -> unitMap elements of the vector in place
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 fold : ('b -> 'a -> 'b) -> 'b -> ('a, _) t -> 'bFold on elements of the vector
val exists : ('a -> bool) -> ('a, _) t -> boolExistential test (is there an element that satisfies the predicate?).
val for_all : ('a -> bool) -> ('a, _) t -> boolUniversal test (do all the elements satisfy the predicate?).
val find : ('a -> bool) -> ('a, _) t -> 'a optionFind an element that satisfies the predicate.
val find_exn : ('a -> bool) -> ('a, _) t -> 'aFind an element that satisfies the predicate, or
val find_map : ('a -> 'b option) -> ('a, _) t -> 'b optionfind_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.
Map elements with a function, possibly filtering some of them out.
val filter_map_in_place : ('a -> 'a option) -> ('a, _) t -> unitFilter-map elements of the vector in place
Like flat_map, but using Seq for intermediate collections. Renamed from flat_map_std_seq since 3.0.
Like flat_map, but using list for intermediate collections.
All combinaisons of tuples from the two vectors are passed to the function.
val get : ('a, _) t -> int -> 'aAccess element by its index, or
remove_and_shift v i remove the i-th element from v. Move elements that are after the i-th in v, in linear time. Preserve the order of the elements in v. See remove_unordered for constant time removal function that doesn't preserve the order of elements.
remove_unordered v i remove the i-th element from v. Does NOT preserve the order of the elements in v (might swap with the last element). See remove_and_shift if you want to keep the ordering.
val rev_iter : ('a -> unit) -> ('a, _) t -> unitrev_iter f a is the same as iter f (rev a), only more efficient.
val size : ('a, _) t -> intNumber of elements in the vector.
val capacity : (_, _) t -> intNumber of elements the vector can contain without being resized.
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, 'mut) tRange 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, 'mut) tRange of integers, either ascending or descending, but excluding right. Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9].
val of_array : 'a array -> ('a, 'mut) tof_array a returns a vector corresponding to the array a. Operates in O(n) time.
val of_list : 'a list -> ('a, 'mut) tval to_array : ('a, _) t -> 'a arrayto_array v returns an array corresponding to the vector v.
val to_list : ('a, _) t -> 'a listReturn a list with the elements contained in the vector.
Convert an Iterator to a vector. Renamed from of_std_seq since 3.0.
to_iter_rev v returns the sequence of elements of v in reverse order, that is, the last elements of v are iterated on first.
val to_seq : ('a, _) t -> 'a Stdlib.Seq.tReturn an iterator with the elements contained in the vector. Renamed from to_std_seq since 3.0.
val to_seq_rev : ('a, _) t -> 'a Stdlib.Seq.tto_seq v returns the sequence of elements of v in reverse order, that is, the last elements of v are iterated on first. Renamed from to_std_seq since 3.0.
Vector as an array slice. By doing it we expose the internal array, so be careful!.
slice_iter v start len is the sequence of elements from v.(start) to v.(start+len-1).
val to_string : ?start:string -> ?stop:string -> ?sep:string ->
+CCVector (containers.CCVector) Module CCVector
Growable, mutable vector
Mutability is rw (read-write) or ro (read-only).
Create a new vector, the value is used to enforce the type the new vector.
val return : 'a -> ('a, 'mut) tSingleton vector.
val make : int -> 'a -> ('a, 'mut) tmake n x makes a vector of size n, filled with x.
val init : int -> (int -> 'a) -> ('a, 'mut) tInit the vector with the given function and size.
Clear the content of the vector. This ensures that length v = 0 but the underlying array is kept, and possibly references to former elements, which are therefore not garbage collectible.
Clear the content of the vector, and deallocate the underlying array, removing references to all the elements. The elements can be collected.
Hint to the vector that it should have at least the given capacity. This does not affect length v.
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 -> boolIs the vector empty?
resize_with vec f size resizes vector vec up to size, fills vector with calls to f on indexes [vec.size-1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.
resize_with_init vec init size resizes vector vec up to size, fills vector with calls to init on indexes [length vec -1.. size - 1]. The contents and size of vec are untouched if size is inferior or equal to length vec.
Append content of iterator. Renamed from append_std_seq since 3.0.
val top : ('a, _) t -> 'a optionTop element, if present.
val top_exn : ('a, _) t -> 'aTop element, if present.
Truncate to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size. truncate was called shrink.
val shrink_to_fit : ('a, _) t -> unitShrink internal array to fit the size of the vector
val member : eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> boolIs the element a member of the vector?
Sort the vector, returning a copy of it that is sorted w.r.t the given ordering. The vector itself is unchanged. The underlying array of the new vector can be smaller than the original one.
Sort the vector in place (modifying it). This function change the size of the underlying array.
Sort the array and remove duplicates, in place (e.g. modifying the vector itself).
val iter : ('a -> unit) -> ('a, _) t -> unitIterate on the vector's content.
val iteri : (int -> 'a -> unit) -> ('a, _) t -> unitIterate on the vector, with indexes.
map f v is just like map, but it also passes in the index of each element as the first argument to the function f.
val map_in_place : ('a -> 'a) -> ('a, _) t -> unitMap elements of the vector in place
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 fold : ('b -> 'a -> 'b) -> 'b -> ('a, _) t -> 'bFold on elements of the vector
val exists : ('a -> bool) -> ('a, _) t -> boolExistential test (is there an element that satisfies the predicate?).
val for_all : ('a -> bool) -> ('a, _) t -> boolUniversal test (do all the elements satisfy the predicate?).
val find : ('a -> bool) -> ('a, _) t -> 'a optionFind an element that satisfies the predicate.
val find_exn : ('a -> bool) -> ('a, _) t -> 'aFind an element that satisfies the predicate, or
val find_map : ('a -> 'b option) -> ('a, _) t -> 'b optionfind_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.
Map elements with a function, possibly filtering some of them out.
val filter_map_in_place : ('a -> 'a option) -> ('a, _) t -> unitFilter-map elements of the vector in place
Like flat_map, but using Seq for intermediate collections. Renamed from flat_map_std_seq since 3.0.
Like flat_map, but using list for intermediate collections.
All combinaisons of tuples from the two vectors are passed to the function.
val get : ('a, _) t -> int -> 'aAccess element by its index, or
remove_and_shift v i remove the i-th element from v. Move elements that are after the i-th in v, in linear time. Preserve the order of the elements in v. See remove_unordered for constant time removal function that doesn't preserve the order of elements.
remove_unordered v i remove the i-th element from v. Does NOT preserve the order of the elements in v (might swap with the last element). See remove_and_shift if you want to keep the ordering.
val rev_iter : ('a -> unit) -> ('a, _) t -> unitrev_iter f a is the same as iter f (rev a), only more efficient.
val size : ('a, _) t -> intNumber of elements in the vector.
val capacity : (_, _) t -> intNumber of elements the vector can contain without being resized.
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, 'mut) tRange 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, 'mut) tRange of integers, either ascending or descending, but excluding right. Example: 1 --^ 10 returns the vector [1;2;3;4;5;6;7;8;9].
val of_array : 'a array -> ('a, 'mut) tof_array a returns a vector corresponding to the array a. Operates in O(n) time.
val of_list : 'a list -> ('a, 'mut) tval to_array : ('a, _) t -> 'a arrayto_array v returns an array corresponding to the vector v.
val to_list : ('a, _) t -> 'a listReturn a list with the elements contained in the vector.
Convert an Iterator to a vector. Renamed from of_std_seq since 3.0.
to_iter_rev v returns the sequence of elements of v in reverse order, that is, the last elements of v are iterated on first.
val to_seq : ('a, _) t -> 'a Stdlib.Seq.tReturn an iterator with the elements contained in the vector. Renamed from to_std_seq since 3.0.
val to_seq_rev : ('a, _) t -> 'a Stdlib.Seq.tto_seq v returns the sequence of elements of v in reverse order, that is, the last elements of v are iterated on first. Renamed from to_std_seq since 3.0.
Vector as an array slice. By doing it we expose the internal array, so be careful!.
slice_iter v start len is the sequence of elements from v.(start) to v.(start+len-1).
val to_string : ?start:string -> ?stop:string -> ?sep:string ->
('a -> string) -> ('a, _) t -> stringPrint the vector in a string
val pp : ?pp_start:unit printer -> ?pp_stop:unit printer -> ?pp_sep:unit printer -> 'a printer -> ('a, _) t printerpp ~pp_start ~pp_stop ~pp_sep pp_item ppf v formats the vector v on ppf. Each element is formatted with pp_item, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ ").
Let operators on OCaml >= 4.08.0, nothing otherwise
\ No newline at end of file
diff --git a/dev/containers/Containers/index.html b/dev/containers/Containers/index.html
index f7e91647..a885b428 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 = CCArraymodule Bool = CCBoolmodule Char = CCCharmodule Equal = CCEqualmodule Either = CCEithermodule Float = CCFloatmodule Format = CCFormatmodule Fun = CCFunmodule Hash = CCHashmodule Hashtbl : sig ... endmodule Heap = CCHeapmodule Int = CCIntmodule Int32 = CCInt32module Int64 = CCInt64module IO = CCIOmodule List = CCListmodule Map = CCMapmodule Nativeint = CCNativeintmodule Option = CCOptionmodule Ord = CCOrdmodule Pair = CCPairmodule Parse = CCParsemodule Random = CCRandommodule Ref = CCRefmodule Result = CCResultmodule Seq = CCSeqmodule Set = CCSetmodule String = CCStringmodule Vector = CCVectormodule Monomorphic = CCMonomorphicmodule Utf8_string = CCUtf8_stringmodule Sexp = CCSexpmodule Sexp_intf = CCSexp_intfmodule Canonical_sexp = CCCanonical_sexpmodule Stdlib = CCShims_.Stdlibinclude module type of struct include Monomorphic end
Infix operators for Floats
Shadow Dangerous Operators
\ No newline at end of file
+Containers (containers.Containers) Module Containers
Drop-In replacement to Stdlib
module Array = CCArraymodule Bool = CCBoolmodule Char = CCCharmodule Equal = CCEqualmodule Either = CCEithermodule Float = CCFloatmodule Format = CCFormatmodule Fun = CCFunmodule Hash = CCHashmodule Hashtbl : sig ... endmodule Heap = CCHeapmodule Int = CCIntmodule Int32 = CCInt32module Int64 = CCInt64module IO = CCIOmodule List = CCListmodule Map = CCMapmodule Nativeint = CCNativeintmodule Option = CCOptionmodule Ord = CCOrdmodule Pair = CCPairmodule Parse = CCParsemodule Random = CCRandommodule Ref = CCRefmodule Result = CCResultmodule Seq = CCSeqmodule Set = CCSetmodule String = CCStringmodule Vector = CCVectormodule Monomorphic = CCMonomorphicmodule Utf8_string = CCUtf8_stringmodule Sexp = CCSexpmodule Sexp_intf = CCSexp_intfmodule Canonical_sexp = CCCanonical_sexpmodule Stdlib = CCShims_.Stdlibinclude module type of struct include Monomorphic end
Infix operators for Floats
Shadow Dangerous Operators
\ No newline at end of file
diff --git a/dev/containers/ContainersLabels/index.html b/dev/containers/ContainersLabels/index.html
index 9f052ad8..d2cf1e33 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 = CCArrayLabelsmodule Bool = CCBoolmodule Char = CCCharmodule Equal = CCEqualLabelsmodule Either = CCEithermodule Float = CCFloatmodule Format = CCFormatmodule Fun = CCFunmodule Hash = CCHashmodule Hashtbl : sig ... endmodule Heap = CCHeapmodule Int = CCIntmodule Int32 = CCInt32module Int64 = CCInt64module IO = CCIOmodule List = CCListLabelsmodule Map = CCMapmodule Nativeint = CCNativeintmodule Option = CCOptionmodule Ord = CCOrdmodule Pair = CCPairmodule Parse = CCParsemodule Random = CCRandommodule Ref = CCRefmodule Result = CCResultmodule Seq = CCSeqmodule Set = CCSetmodule String = CCStringLabelsmodule Vector = CCVectormodule Monomorphic = CCMonomorphicmodule Utf8_string = CCUtf8_stringmodule Sexp = CCSexpmodule Sexp_intf = CCSexp_intfmodule Stdlib = CCShims_.Stdlibinclude module type of struct include Monomorphic end
Infix operators for Floats
Shadow Dangerous Operators
\ No newline at end of file
+ContainersLabels (containers.ContainersLabels) Module ContainersLabels
Drop-In replacement to Stdlib
module Array = CCArrayLabelsmodule Bool = CCBoolmodule Char = CCCharmodule Equal = CCEqualLabelsmodule Either = CCEithermodule Float = CCFloatmodule Format = CCFormatmodule Fun = CCFunmodule Hash = CCHashmodule Hashtbl : sig ... endmodule Heap = CCHeapmodule Int = CCIntmodule Int32 = CCInt32module Int64 = CCInt64module IO = CCIOmodule List = CCListLabelsmodule Map = CCMapmodule Nativeint = CCNativeintmodule Option = CCOptionmodule Ord = CCOrdmodule Pair = CCPairmodule Parse = CCParsemodule Random = CCRandommodule Ref = CCRefmodule Result = CCResultmodule Seq = CCSeqmodule Set = CCSetmodule String = CCStringLabelsmodule Vector = CCVectormodule Monomorphic = CCMonomorphicmodule Utf8_string = CCUtf8_stringmodule Sexp = CCSexpmodule Sexp_intf = CCSexp_intfmodule Stdlib = CCShims_.Stdlibinclude module type of struct include Monomorphic end
Infix operators for Floats
Shadow Dangerous Operators
\ No newline at end of file
diff --git a/dev/containers/index.html b/dev/containers/index.html
index 764ab0bc..fc2d6efc 100644
--- a/dev/containers/index.html
+++ b/dev/containers/index.html
@@ -1,2 +1,2 @@
-index (containers.index) containers index
Library containers
This library exposes the following toplevel modules:
CCArray CCArrayLabels CCBool CCCanonical_sexp CCChar CCEither CCEqual CCEqualLabels CCFloat CCFormat CCFun CCHash CCHashtbl CCHeap CCIO CCInt CCInt32 CCInt64 CCList CCListLabels CCMap CCNativeint CCOpt Option moduleCCOption OptionsCCOrd CCPair CCParse CCRandom CCRef CCResult CCSeq CCSet CCSexp CCSexp_intf CCSexp_lex CCShimsArrayLabels_ CCShimsArray_ CCShimsFormat_ CCShimsFun_ CCShimsInt_ CCShimsList_ CCShimsMkLetList_ CCShimsMkLet_ CCShims_ CCString CCStringLabels CCUtf8_string CCVector Containers ContainersLabels
Library containers.codegen
The entry point of this library is the module: Containers_codegen.
Library containers.monomorphic
This library exposes the following toplevel modules:
Library containers.top
The entry point of this library is the module: Containers_top.
Library containers.unix
The entry point of this library is the module: CCUnix.
\ No newline at end of file
+index (containers.index) containers index
Library containers
This library exposes the following toplevel modules:
CCArray Array utilsCCArrayLabels Array utils (Labeled version of CCArray)CCBool Basic Bool functionsCCCanonical_sexp Canonical S-expressionsCCChar Utils around charCCEither Either MonadCCEqual Equality CombinatorsCCEqualLabels Equality Combinators (Labeled version of CCEqual)CCFloat Basic operations on floating-point numbersCCFormat Helpers for FormatCCFun Basic operations on FunctionsCCHash Hash combinatorsCCHashtbl Extension to the standard HashtblCCHeap Leftist HeapsCCIO 1 IO UtilsCCInt Basic Int functionsCCInt32 Helpers for 32-bit integers.CCInt64 Helpers for 64-bit integers.CCList Complements to ListCCListLabels Complements to ListLabelsCCMap Extensions of Standard MapCCNativeint Helpers for processor-native integersCCOpt Previous Option moduleCCOption Basic operations on the option type.CCOrd Order combinatorsCCPair Tuple FunctionsCCParse Very Simple Parser CombinatorsCCRandom Random GeneratorsCCRef Helpers for referencesCCResult Error MonadCCSeq Helpers for the standard Seq typeCCSet Wrapper around SetCCSexp Handling S-expressionsCCSexp_intf CCSexp_lex CCShimsArrayLabels_ CCShimsArray_ CCShimsFormat_ CCShimsFun_ CCShimsInt_ CCShimsList_ CCShimsMkLetList_ CCShimsMkLet_ CCShims_ CCString Basic String UtilsCCStringLabels Basic String Utils (Labeled version of CCString)CCUtf8_string Unicode String, in UTF8CCVector Growable, mutable vectorContainers Drop-In replacement to StdlibContainersLabels Drop-In replacement to Stdlib
Library containers.codegen
The entry point of this library is the module: Containers_codegen.
Library containers.monomorphic
This library exposes the following toplevel modules:
Library containers.top
The entry point of this library is the module: Containers_top.
Library containers.unix
The entry point of this library is the module: CCUnix.
\ No newline at end of file