diff --git a/dev/containers-data/CCBijection/Make/argument-1-L/index.html b/dev/containers-data/CCBijection/Make/argument-1-L/index.html deleted file mode 100644 index d5c400d7..00000000 --- a/dev/containers-data/CCBijection/Make/argument-1-L/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -
Make.LMake.RCCBijection.Makemodule L : OrderedTypemodule R : OrderedTypetype left = L.ttype right = R.tval empty : tval is_empty : t -> boolAdd left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.
val cardinal : t -> intNumber of bindings. O(n) time.
Remove the left, right binding if it exists. Return the same bijection otherwise.
Remove the binding with left key if it exists. Return the same bijection otherwise.
Remove the binding with right key if it exists. Return the same bijection otherwise.
CCBijection.OrderedTypeCCBijection.Sval empty : tval is_empty : t -> boolAdd left and right correspondence to bijection such that left and right are unique in their respective sets and only correspond to each other.
val cardinal : t -> intNumber of bindings. O(n) time.
Remove the left, right binding if it exists. Return the same bijection otherwise.
Remove the binding with left key if it exists. Return the same bijection otherwise.
Remove the binding with right key if it exists. Return the same bijection otherwise.
Make._CCBitField.MakeCreate a new bitfield type
module _ : sig ... endGenerative type of bitfields. Each instantiation of the functor should create a new, incompatible type
val empty : tEmpty bitfields (all bits 0).
val mk_field : unit -> fieldMake a new field.
Prevent new fields from being added. From now on, creating a field will raise Frozen.
CCBitField.SGenerative type of bitfields. Each instantiation of the functor should create a new, incompatible type
val empty : tEmpty bitfields (all bits 0).
val mk_field : unit -> fieldMake a new field.
Prevent new fields from being added. From now on, creating a field will raise Frozen.
CCGraph.Dottype attribute = [ | `Color of string| `Shape of string| `Weight of int| `Style of string| `Label of string| `Other of string * string ]Dot attribute
val pp :
- tbl:('v, vertex_state) table ->
- eq:('v -> 'v -> bool) ->
- ?attrs_v:('v -> attribute list) ->
- ?attrs_e:('e -> attribute list) ->
- ?name:string ->
- graph:('v, 'e) t ->
- Stdlib.Format.formatter ->
- 'v ->
- unitPrint the graph, starting from given vertex, on the formatter.
CCGraph.Itertype 'a t = 'a iterval return : 'a -> 'a tval iter : ('a -> unit) -> 'a t -> unitval fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval to_list : 'a t -> 'a listCCGraph.Lazy_treeval fold_v : ('acc -> 'v -> 'acc) -> 'acc -> ('v, _) t -> 'accCCGraph.Mapval empty : 'a tRemove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.
Traverse.Eventval get_vertex : ('v, 'e) t -> ('v * [ `Enter | `Exit ]) optionval get_enter : ('v, 'e) t -> 'v optionval get_exit : ('v, 'e) t -> 'v optionval get_edge : ('v, 'e) t -> ('v * 'e * 'v) optionCCGraph.TraverseTraversal of the given graph, starting from a sequence of vertices, using the given bag to choose the next vertex to explore. Each vertex is visited at most once.
val generic_tag :
- tags:'v tag_set ->
- bag:'v bag ->
- graph:('v, 'e) t ->
- 'v iter ->
- 'v iter_onceOne-shot traversal of the graph using a tag set and the given bag.
val dijkstra :
- tbl:'v set ->
- ?dist:('e -> int) ->
- graph:('v, 'e) t ->
- 'v iter ->
- ('v * int * ('v, 'e) path) iter_onceDijkstra algorithm, traverses a graph in increasing distance order. Yields each vertex paired with its distance to the set of initial vertices (the smallest distance needed to reach the node from the initial vertices).
module Event : sig ... endCCGraph.MAPval empty : 'a tRemove the vertex and all its outgoing edges. Edges that point to the vertex are NOT removed, they must be manually removed with remove_edge.
Make.ECCHashSet.Maketype elt = E.tval create : int -> tcreate n makes a new set with the given capacity n.
val clear : t -> unitclear s removes all elements from s.
val cardinal : t -> intcardinal s returns the number of elements in s.
CCHashSet.ELEMENTCCHashSet.Sval create : int -> tcreate n makes a new set with the given capacity n.
val clear : t -> unitclear s removes all elements from s.
val cardinal : t -> intcardinal s returns the number of elements in s.
Make.KCCHashTrie.Maketype key = K.tval empty : 'a tval is_empty : _ t -> boolupdate k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.
val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a tadd_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).
val remove_mut : id:Transient.t -> key -> 'a t -> 'a tSame as remove, but modifies in place whenever possible.
val update_mut :
- id:Transient.t ->
- key ->
- f:('a option -> 'a option) ->
- 'a t ->
- 'a tSame as update but with mutability.
val cardinal : _ t -> intval add_list_mut : id:Transient.t -> 'a t -> (key * 'a) list -> 'a tval add_iter_mut : id:Transient.t -> 'a t -> (key * 'a) iter -> 'a tval add_gen_mut : id:Transient.t -> 'a t -> (key * 'a) gen -> 'a tCCHashTrie.TransientIdentifiers for transient modifications. A transient modification is uniquely identified by a Transient.t. Once Transient.freeze r is called, r cannot be used to modify the structure again.
val create : unit -> tCreate a new, active ID.
val frozen : t -> boolfrozen i returns true if freeze i was called before. In this case, the ID cannot be used for modifications again.
val active : t -> boolactive i is not (frozen i).
val freeze : t -> unitfreeze i makes i unusable for new modifications. The values created with i will now be immutable.
val with_ : (t -> 'a) -> 'awith_ f creates a transient ID i, calls f i, freezes the ID i and returns the result of f i.
CCHashTrie.KEYCCHashTrie.Sval empty : 'a tval is_empty : _ t -> boolupdate k ~f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.
val add_mut : id:Transient.t -> key -> 'a -> 'a t -> 'a tadd_mut ~id k v m behaves like add k v m, except it will mutate in place whenever possible. Changes done with an id might affect all versions of the structure obtained with the same id (but not other versions).
val remove_mut : id:Transient.t -> key -> 'a t -> 'a tSame as remove, but modifies in place whenever possible.
val update_mut :
- id:Transient.t ->
- key ->
- f:('a option -> 'a option) ->
- 'a t ->
- 'a tSame as update but with mutability.
val cardinal : _ t -> intval add_list_mut : id:Transient.t -> 'a t -> (key * 'a) list -> 'a tval add_iter_mut : id:Transient.t -> 'a t -> (key * 'a) iter -> 'a tval add_gen_mut : id:Transient.t -> 'a t -> (key * 'a) gen -> 'a tCCHet.KeyKeys with a type witness.
A key of type 'a t is used to access the portion of the map or table that associates keys of type 'a to values.
val create : unit -> 'a tMake a new key. This is generative, so calling create () twice with the same return type will produce incompatible keys that cannot see each other's bindings.
CCHet.MapCCHet.TblKeyval create : ?size:int -> unit -> tval length : t -> intval clear : t -> unitclear the table (like Hashtbl.clear)
val reset : t -> unitreset the table (like Hashtbl.reset)
CCKTree.Dottype attribute = [ | `Color of string| `Shape of string| `Weight of int| `Style of string| `Label of string| `Id of stringUnique ID in the graph. Allows sharing.
*)| `Other of string * string ]Dot attributes for nodes
A dot graph is a name, plus a list of trees labelled with attributes
val mk_id : ('a, Stdlib.Buffer.t, unit, attribute) Stdlib.format4 -> 'aUsing a formatter string, build an ID.
val mk_label : ('a, Stdlib.Buffer.t, unit, attribute) Stdlib.format4 -> 'aUsing a formatter string, build a label.
val print_to_file : string -> graph -> unitprint_to_file filename g prints g into a file whose name is filename.
CCKTree.psetAbstract Set structure
method add : 'a -> 'a psetCCLazy_list.InfixMake.XCCMixmap.Maketype key = X.tA map containing values of different types, indexed by key.
val empty : tEmpty map.
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 cardinal : t -> intNumber of bindings.
All the bindings that come from the corresponding injection.
CCMixmap.ORDCCMixmap.SA map containing values of different types, indexed by key.
val empty : tEmpty map.
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 cardinal : t -> intNumber of bindings.
All the bindings that come from the corresponding injection.
Make.KMake.VCCMultiMap.Makemodule K : OrderedTypemodule V : OrderedTypetype key = K.ttype value = V.tval empty : tEmpty multimap.
val is_empty : t -> boolEmpty multimap?
val size : t -> intNumber of keys.
MakeBidir.LMakeBidir.RCCMultiMap.MakeBidirmodule L : OrderedTypemodule R : OrderedTypetype left = L.ttype right = R.tval empty : tval is_empty : t -> boolval cardinal_left : t -> intNumber of distinct left keys.
val cardinal_right : t -> intNumber of distinct right keys.
Like find_right but returns at most one value.
CCMultiMap.BIDIRval empty : tval is_empty : t -> boolval cardinal_left : t -> intNumber of distinct left keys.
val cardinal_right : t -> intNumber of distinct right keys.
Like find_right but returns at most one value.
CCMultiMap.OrderedTypeCCMultiMap.Sval empty : tEmpty multimap.
val is_empty : t -> boolEmpty multimap?
val size : t -> intNumber of keys.
CCMultiSet.Makeval empty : tval is_empty : t -> boolremove_mult set x n removes at most n occurrences of x from set.
update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.
union a b contains as many occurrences of an element x as count a x + count b x.
meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).
intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).
val cardinal : t -> intNumber of distinct elements.
CCMultiSet.Sval empty : tval is_empty : t -> boolremove_mult set x n removes at most n occurrences of x from set.
update set x f calls f n where n is the current multiplicity of x in set (0 to indicate its absence); the result of f n is the new multiplicity of x.
union a b contains as many occurrences of an element x as count a x + count b x.
meet a b is a multiset such that count (meet a b) x = max (count a x) (count b x).
intersection a b is a multiset such that count (intersection a b) x = min (count a x) (count b x).
val cardinal : t -> intNumber of distinct elements.
Make.Xval idx : t -> intIndex in heap. return -1 if never set
val set_idx : t -> int -> unitUpdate index in heap
CCMutHeap.Maketype elt = X.tType of elements
val create : unit -> tCreate a heap
val in_heap : elt -> boolval size : t -> intNumber of integers within the heap
val is_empty : t -> boolval clear : t -> unitClear the content of the heap
CCMutHeap_intf.RANKEDval idx : t -> intIndex in heap. return -1 if never set
val set_idx : t -> int -> unitUpdate index in heap
CCMutHeap_intf.Sval create : unit -> tCreate a heap
val in_heap : elt -> boolval size : t -> intNumber of integers within the heap
val is_empty : t -> boolval clear : t -> unitClear the content of the heap
Make.HCCPersistentHashtbl.Makemodule H : HashedTypetype key = H.tval empty : unit -> 'a tEmpty table. The table will be allocated at the first binding.
val create : int -> 'a tCreate a new hashtable, with the given initial capacity.
val is_empty : 'a t -> boolIs the table empty?
val length : _ t -> intNumber of bindings.
Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.
Add the binding to the table, returning a new table. This erases the current binding for key, if any.
update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.
Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.
val merge :
- f:(key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) ->
- 'a t ->
- 'b t ->
- 'c tMerge two tables together into a new table. The function's argument correspond to values associated with the key (if present); if the function returns None the key will not appear in the result.
val stats : _ t -> Stdlib.Hashtbl.statisticsStatistics on the internal table.
CCPersistentHashtbl.HashedTypeCCPersistentHashtbl.Sval empty : unit -> 'a tEmpty table. The table will be allocated at the first binding.
val create : int -> 'a tCreate a new hashtable, with the given initial capacity.
val is_empty : 'a t -> boolIs the table empty?
val length : _ t -> intNumber of bindings.
Add the binding to the table, returning a new table. The old binding for this key, if it exists, is shadowed and will be restored upon remove tbl k.
Add the binding to the table, returning a new table. This erases the current binding for key, if any.
update tbl key f calls f None if key doesn't belong in tbl, f (Some v) if key -> v otherwise; If f returns None then key is removed, else it returns Some v' and key -> v' is added.
Fresh copy of the table; the underlying structure is not shared anymore, so using both tables alternatively will be efficient.
val merge :
- f:(key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) ->
- 'a t ->
- 'b t ->
- 'c tMerge two tables together into a new table. The function's argument correspond to values associated with the key (if present); if the function returns None the key will not appear in the result.
val stats : _ t -> Stdlib.Hashtbl.statisticsStatistics on the internal table.
CCRAL.Infixval (--^) : int -> int -> int ta --^ b is the integer range from a to b, where b is excluded.
Array.ByteEfficient array version for the char type
val dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
Make.Eltval dummy : tArray.MakeMakes an array given an arbitrary element type
module Elt : sig ... endtype elt = Elt.tThe element type
type t = Elt.t arrayThe type of an array instance
val dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
CCRingBuffer.ArrayThe abstract type for arrays
module type S = sig ... endEfficient array version for the char type
Array.Sval dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
CCRingBuffer.ByteAn efficient byte based ring buffer
module Array = Array.ByteThe module type of Array for this ring buffer
val create : int -> tcreate size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.
val capacity : t -> intLength of the inner buffer.
val length : t -> intNumber of elements currently stored in the buffer.
val is_full : t -> booltrue if pushing an element would erase another element.
blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.
blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.
append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.
val clear : t -> unitClear the content of the buffer
val is_empty : t -> boolIs the buffer empty (i.e. contains no elements)?
val junk_front : t -> unitDrop the front element from t.
val junk_back : t -> unitDrop the back element from t.
val skip : t -> int -> unitskip b len removes len elements from the front of b.
iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.
get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.
get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.
Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.
Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).
Make.ArrayThe module type of Array for this ring buffer
type elt = X.tThe element type
type t = X.t arrayThe type of an array instance
val dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
Make.Xval dummy : tCCRingBuffer.MakeBuffer using regular arrays
module X : sig ... endThe module type of Array for this ring buffer
val create : int -> tcreate size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.
val capacity : t -> intLength of the inner buffer.
val length : t -> intNumber of elements currently stored in the buffer.
val is_full : t -> booltrue if pushing an element would erase another element.
blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.
blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.
append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.
val clear : t -> unitClear the content of the buffer
val is_empty : t -> boolIs the buffer empty (i.e. contains no elements)?
val junk_front : t -> unitDrop the front element from t.
val junk_back : t -> unitDrop the back element from t.
val skip : t -> int -> unitskip b len removes len elements from the front of b.
iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.
get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.
get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.
Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.
Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).
MakeFromArray.Aval dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
CCRingBuffer.MakeFromArrayMakes a ring buffer module with the given array type
module Array = AThe module type of Array for this ring buffer
val create : int -> tcreate size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.
val capacity : t -> intLength of the inner buffer.
val length : t -> intNumber of elements currently stored in the buffer.
val is_full : t -> booltrue if pushing an element would erase another element.
blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.
blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.
append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.
val clear : t -> unitClear the content of the buffer
val is_empty : t -> boolIs the buffer empty (i.e. contains no elements)?
val junk_front : t -> unitDrop the front element from t.
val junk_back : t -> unitDrop the back element from t.
val skip : t -> int -> unitskip b len removes len elements from the front of b.
iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.
get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.
get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.
Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.
Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).
S.ArrayThe module type of Array for this ring buffer
val dummy : eltA dummy element used for empty slots in the array
val create : int -> tMake an array of the given size, filled with dummy elements.
val length : t -> intlength t gets the total number of elements currently in t.
blit t s arr i len copies len elements from arr starting at i to position s from t.
CCRingBuffer.SThe abstract ring buffer type, made concrete by choice of ARRAY module implementation
val create : int -> tcreate size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.
val capacity : t -> intLength of the inner buffer.
val length : t -> intNumber of elements currently stored in the buffer.
val is_full : t -> booltrue if pushing an element would erase another element.
blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.
blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.
append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.
val clear : t -> unitClear the content of the buffer
val is_empty : t -> boolIs the buffer empty (i.e. contains no elements)?
val junk_front : t -> unitDrop the front element from t.
val junk_back : t -> unitDrop the back element from t.
val skip : t -> int -> unitskip b len removes len elements from the front of b.
iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.
get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.
get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.
Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.
Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).
CCSimple_queue.InfixMake.WCCTrie.Maketype char_ = W.char_type key = W.tval empty : 'a tval is_empty : _ t -> boollongest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.
Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".
Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.
Fold on key/value bindings. Will use WORD.of_list to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.
MakeArray.XCCTrie.MakeArraytype char_ = X.ttype key = X.t arrayval empty : 'a tval is_empty : _ t -> boollongest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.
Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".
Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.
Fold on key/value bindings. Will use WORD.of_list to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.
MakeList.XCCTrie.MakeListtype char_ = X.ttype key = X.t listval empty : 'a tval is_empty : _ t -> boollongest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.
Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".
Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.
Fold on key/value bindings. Will use WORD.of_list to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.
CCTrie.Stringval empty : 'a tval is_empty : _ t -> boollongest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.
Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".
Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.
Fold on key/value bindings. Will use WORD.of_list to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.
CCTrie.ORDEREDCCTrie.Sval empty : 'a tval is_empty : _ t -> boollongest_prefix k m finds the longest prefix of k that leads to at least one path in m (it does not mean that the prefix is bound to a value.
Example: if m has keys "abc0" and "abcd", then longest_prefix "abc2" m will return "abc".
Update the binding for the given key. The function is given None if the key is absent, or Some v if key is bound to v; if it returns None the key is removed, otherwise it returns Some y and key becomes bound to y.
Fold on key/value bindings. Will use WORD.of_list to rebuild keys.
Map values, giving both key and value. Will use WORD.of_list to rebuild keys.
val fold_values : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bMore efficient version of fold, that doesn't keep keys.
val iter_values : ('a -> unit) -> 'a t -> unitMerge two tries together. The function is used in case of conflicts, when a key belongs to both tries.
val size : _ t -> intNumber of bindings.
All bindings whose key is bigger or equal to the given key, in ascending order.
CCTrie.WORDMake.XCCWBTree.Maketype key = X.tval empty : 'a tval is_empty : _ t -> boolnth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).
get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.
update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.
val cardinal : _ t -> intval weight : _ t -> intMap values, giving both key and value. Will use WORD.of_list to rebuild keys.
split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.
Like Map.S.merge.
extract_min m returns k, v, m' where k,v is the pair with the smallest key in m, and m' does not contain k.
extract_max m returns k, v, m' where k,v is the pair with the highest key in m, and m' does not contain k.
Randomly choose a (key,value) pair within the tree, using weights as probability weights.
MakeFull.XCCWBTree.MakeFullUse the custom X.weight function
type key = X.tval empty : 'a tval is_empty : _ t -> boolnth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).
get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.
update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.
val cardinal : _ t -> intval weight : _ t -> intMap values, giving both key and value. Will use WORD.of_list to rebuild keys.
split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.
Like Map.S.merge.
extract_min m returns k, v, m' where k,v is the pair with the smallest key in m, and m' does not contain k.
extract_max m returns k, v, m' where k,v is the pair with the highest key in m, and m' does not contain k.
Randomly choose a (key,value) pair within the tree, using weights as probability weights.
CCWBTree.KEYCCWBTree.ORDCCWBTree.Sval empty : 'a tval is_empty : _ t -> boolnth i m returns the i-th key, value in the ascending order. Complexity is O(log (cardinal m)).
get_rank k m looks for the rank of k in m, i.e. the index of k in the sorted list of bindings of m. let (`At n) = get_rank k m in nth_exn n m = get m k should hold.
update k f m calls f (Some v) if get k m = Some v, f None otherwise. Then, if f returns Some v' it binds k to v', if f returns None it removes k.
val cardinal : _ t -> intval weight : _ t -> intMap values, giving both key and value. Will use WORD.of_list to rebuild keys.
split k t returns l, o, r where l is the part of the map with keys smaller than k, r has keys bigger than k, and o = Some v if k, v belonged to the map.
Like Map.S.merge.
extract_min m returns k, v, m' where k,v is the pair with the smallest key in m, and m' does not contain k.
extract_max m returns k, v, m' where k,v is the pair with the highest key in m, and m' does not contain k.
Randomly choose a (key,value) pair within the tree, using weights as probability weights.
CCLock.LockRefType allowing to manipulate the lock as a reference.
Fut.InfixMake.FutThe futures are registration points for callbacks, storing a state, that are executed in the pool using run.
type 'a future = 'a tval return : 'a -> 'a tFuture that is already computed.
val fail : exn -> 'a tFuture that fails immediately.
val make : (unit -> 'a) -> 'a tCreate a future, representing a value that will be computed by the function. If the function raises, the future will fail.
val make1 : ('a -> 'b) -> 'a -> 'b tval make2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c tval get : 'a t -> 'aBlocking get: wait for the future to be evaluated, and get the value, or the exception that failed the future is returned. Raise e if the future failed with e.
val is_done : 'a t -> boolIs the future evaluated (success/failure)?
val on_success : 'a t -> ('a -> unit) -> unitAttach a handler to be called upon success. The handler should not call functions on the future. Might be evaluated now if the future is already done.
val on_failure : _ t -> (exn -> unit) -> unitAttach a handler to be called upon failure. The handler should not call any function on the future. Might be evaluated now if the future is already done.
Attach a handler to be called when the future is evaluated. The handler should not call functions on the future. Might be evaluated now if the future is already done.
Wait for the first future to succeed, then launch the second.
Future that waits for all previous futures to terminate. If any future in the array fails, sequence_a l fails too.
map_a f a maps f on every element of a, and will return the array of every result if all calls succeed, or an error otherwise.
Future that waits for all previous futures to terminate. If any future in the list fails, sequence_l l fails too.
map_l f l maps f on every element of l, and will return the list of every result if all calls succeed, or an error otherwise.
Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.
Choose among those futures (the first to terminate). Behaves like the first future that terminates, by failing if the future fails.
Map the value inside the future, to be computed in a separated job.
Cartesian product of the content of these futures.
app_async f x applies the result of f to the result of x, in a separated job scheduled in the pool.
val sleep : float -> unit tFuture that returns with success in the given amount of seconds. Blocks the thread! If you need to wait on many events, consider using CCTimer.
module Infix : sig ... endinclude module type of InfixMake.PCCPool.MakeAfter calling stop (), most functions will raise Stopped. This has the effect of preventing new tasks from being executed.
module Fut : sig ... endCCPool.PARAMCCThread.Arrval spawn : int -> (int -> 'a) -> t arrayArr.spawn n f creates an array res of length n, such that res.(i) = spawn (fun () -> f i).
val join : t array -> unitArr.join a joins every thread in a.
CCThread.Barrierval create : unit -> tCreate a barrier.
val reset : t -> unitReset to initial (non-triggered) state.
val wait : t -> unitwait b waits for barrier b to be activated by activate b. All threads calling this wait until activate b is called. If b is already activated, wait b does nothing.
val activate : t -> unitactivate b unblocks all threads that were waiting on b.
val activated : t -> boolactivated b returns true iff activate b was called, and reset b was not called since. In other words, activated b = true means wait b will not block.
CCArray.FloatarrayCCArray.Infixval (--) : 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
CCArray.MONO_ARRAYCCArrayLabels.FloatarrayCCArrayLabels.Infixval (--) : 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
CCArrayLabels.MONO_ARRAYMake.Sexpval atom : string -> tCCCanonical_sexp.Maketype t = Sexp.ttype sexp = tval atom : string -> tMake an atom out of this string.
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.
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.
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.
CCChar.InfixCCEqual.InfixCCEqualLabels.InfixCCFloat.InfixCCFormat.ANSI_codesANSI escape codes. This contains lower level functions for them.
A style. Styles can be composed in a list.
clear_line is an escape code to clear the current line. It is very useful for progress bars; for example:
let pp_progress i =
- Printf.printf "%sprogress at %d%!" ANSI_codes.clear_line iif called repeatedly this will print successive progress messages on a single line.
val string_of_style : style -> stringstring_of_style st is an escape code to set the current style to st. It can be printed as is on any output that is a compatible terminal.
val string_of_style_list : style list -> stringstring_of_style_list styles is an escape code for multiple styles at once. For example string_of_style_list ANSI_codes.([`FG `Red; `BG `Green; `Bold]) is a very shiny style.
CCFormat.Dumptype 'a t = 'a printerval unit : unit tval int : int tval string : string tval bool : bool tval float : float tval char : char tval int32 : int32 tval int64 : int64 tval nativeint : nativeint tval to_string : 'a t -> 'a -> stringAlias to CCFormat.to_string.
CCFormat.InfixCCFun.Infix(f %> g) x or (%>) f g x is g (f x). Alias to compose.
Monad.XCCFun.Monadmodule X : sig ... endtype 'a t = X.t -> 'aval return : 'a -> 'a tMonadic return.
CCHashtbl.Makeget 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).
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
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.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
val values_list : 'a t -> 'a listvalues_list t is the list of values in t.
Add the corresponding pairs to the table, using Hashtbl.add.
Add 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.
Add 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.
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.
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.
add_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 of_std_seq_count since 3.0.
Like 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.
of_list l builds a table from the given list l of bindings k_i -> v_i. 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 ->
- key printer ->
- 'a printer ->
- 'a 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.
CCHashtbl.Polyget 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.
val of_seq_with :
- f:('a -> 'b -> 'b -> 'b) ->
- ('a * 'b) Stdlib.Seq.t ->
- ('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.
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.
CCHashtbl.Sget 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).
add_list tbl x y adds y to the list x is bound to. If x is not bound, it becomes bound to y.
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.
keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.
val values_list : 'a t -> 'a listvalues_list t is the list of values in t.
Add the corresponding pairs to the table, using Hashtbl.add.
Add 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.
Add 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.
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.
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.
add_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 of_std_seq_count since 3.0.
Like 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.
of_list l builds a table from the given list l of bindings k_i -> v_i. 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 ->
- key printer ->
- 'a printer ->
- 'a 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.
Make.ECCHeap.Makemodule E : PARTIAL_ORDtype elt = E.tval empty : tempty returns the empty heap.
val is_empty : t -> boolis_empty h returns true if the heap h is empty.
filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.
take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.
delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.
delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.
iter f h iterates over the heap h invoking f with the current element.
val size : t -> intsize h is the number of elements in the heap h. Linear complexity.
to_list_sorted h returns the elements of the heap h in increasing order.
add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.
add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.
of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.
to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.
to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.
to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.
to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).
val pp :
- ?pp_start:unit printer ->
- ?pp_stop:unit printer ->
- ?pp_sep:unit printer ->
- elt printer ->
- t printerpp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0
Make_from_compare.ECCHeap.Make_from_compareA convenient version of Make that take a TOTAL_ORD instead of a partially ordered module. It allow to directly pass modules that implement compare without implementing leq explicitly
type elt = E.tval empty : tempty returns the empty heap.
val is_empty : t -> boolis_empty h returns true if the heap h is empty.
filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.
take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.
delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.
delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.
iter f h iterates over the heap h invoking f with the current element.
val size : t -> intsize h is the number of elements in the heap h. Linear complexity.
to_list_sorted h returns the elements of the heap h in increasing order.
add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.
add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.
of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.
to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.
to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.
to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.
to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).
val pp :
- ?pp_start:unit printer ->
- ?pp_stop:unit printer ->
- ?pp_sep:unit printer ->
- elt printer ->
- t printerpp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0
CCHeap.PARTIAL_ORDCCHeap.Sval empty : tempty returns the empty heap.
val is_empty : t -> boolis_empty h returns true if the heap h is empty.
filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.
take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.
delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.
delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.
iter f h iterates over the heap h invoking f with the current element.
val size : t -> intsize h is the number of elements in the heap h. Linear complexity.
to_list_sorted h returns the elements of the heap h in increasing order.
add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.
add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.
of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.
to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.
to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.
to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.
to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).
val pp :
- ?pp_start:unit printer ->
- ?pp_stop:unit printer ->
- ?pp_sep:unit printer ->
- elt printer ->
- t printerpp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, 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 ",@ "). Renamed from print since 2.0
CCHeap.TOTAL_ORDCCIO.FileA file should be represented by its absolute path, but currently this is not enforced.
val to_string : t -> stringval make : string -> tBuild a file representation from a path (absolute or relative).
val exists : t -> boolval is_directory : t -> boolval remove_exn : t -> unitremove_exn path tries to remove the file at path from the file system.
val remove_noerr : t -> unitLike remove_exn but do not raise any exception on failure.
read_dir d returns a sequence of files and directory contained in the directory d (or an empty stream if d is not a directory).
val read_exn : t -> stringRead the content of the given file, or raises some exception.
val append_exn : t -> string -> unitAppend the given string into the given file, possibly raising.
val write_exn : t -> string -> unitWrite the given string into the given file, possibly raising.
type walk_item = [ `File | `Dir ] * tLike read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including symlinks, etc.)
Like walk but returns a list (therefore it's eager and might take some time on large directories).
val show_walk_item : walk_item -> stringval with_temp :
- ?temp_dir:string ->
- prefix:string ->
- suffix:string ->
- (string -> 'a) ->
- 'awith_temp ~prefix ~suffix f will call f with the name of a new temporary file (located in temp_dir). After f returns, the file is deleted. Best to be used in combination with with_out. See Filename.temp_file.
CCInt.InfixCCInt32.Infixx / 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.
CCInt64.Infixx / 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.
CCList.Assocval get : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b optionget ~eq k alist returns Some v if the given key k is present into alist, or None if not present.
val get_exn : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'bget_exn ~eq k alist returns v if the element k is present into alist. Like get, but unsafe.
set ~eq k v alist adds the binding k, v into the list alist (erase it if already present).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> boolmem ?eq k alist returns true iff k is a key in alist.
val update :
- eq:('a -> 'a -> bool) ->
- f:('b option -> 'b option) ->
- 'a ->
- ('a, 'b) t ->
- ('a, 'b) tupdate ~eq ~f k alist updates alist on the key k, by calling f (get k alist) and removing k if it returns None, mapping k to v' if it returns Some v'.
remove ~eq k alist returns the alist without the first pair with key k, if any.
val keys : ('a, 'b) t -> 'a listkeys alist returns a list of all keys of alist.
val values : ('a, 'b) t -> 'b listvalues alist returns a list of all values of alist.
CCList.Infixval (--) : int -> int -> int ti -- j is the infix alias for range. Bounds included.
val (--^) : int -> int -> int ti --^ j is the infix alias for range'. Second bound j excluded.
(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.
# let f xs ys zs =
- let+ x = xs
- and& y = ys
- and& z = zs in
- x + y + z;;
-val f : int list -> int list -> int list -> int list = <fun>
-# f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]CCList.Refval push : 'a t -> 'a -> unitpush rlist e adds an element e at the head of rlist.
val pop : 'a t -> 'a optionpop rlist removes and returns Some e (the first element of rlist) or None if the rlist is empty
val pop_exn : 'a t -> 'apop_exn rlist removes and returns the first element of rlist. Unsafe version of pop.
val create : unit -> 'a tcreate () creates a new empty reference list.
val clear : _ t -> unitclear rlist removes all elements of rlist.
val lift : ('a list -> 'b) -> 'a t -> 'blift f rlist applies a list function f to the content of rlist.
val push_list : 'a t -> 'a list -> unitpush_list rlist l adds elements of the list l at the beginning of the list ref rlist. Elements at the end of the list l will be at the beginning of the list ref rlist.
Traverse.Mval return : 'a -> 'a treturn is the Monadic return.
CCList.TraverseThis allows the traversal of a 'a t list where _ t is also a monad.
For example, a 'a option list will be traversed by extracting a value from each option, returning Some [x1;…;x_n]; but if one of the option is None then the whole result is None.
Another example is with result: ('a, 'err) result list can be transformed into ('a list, 'err) result by returning the first error, or Ok [x1; …; xn] if all the elements were successful.
This describes the behavior of sequence_m; map_m is a combination of map and sequence_m; map_m_par is like map_m but useful for some pseudo monads like Lwt.
Fold a function with a monadic effect through a list.
map_m_par f (x :: l) is like map_m but f x and f l are evaluated "in parallel" before combining their result (for instance in Lwt).
Basically, when encoutering x :: tl, this computes f x and map_m_par f tl, and only then is M.(>>=) used to combine the two results into a new list.
CCList.MONADval return : 'a -> 'a treturn is the Monadic return.
CCListLabels.Assocval get : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'b optionget ~eq k alist returns Some v if the given key k is present into alist, or None if not present.
val get_exn : eq:('a -> 'a -> bool) -> 'a -> ('a, 'b) t -> 'bget_exn ~eq k alist returns v if the element k is present into alist. Like get, but unsafe.
set ~eq k v alist adds the binding k, v into the list alist (erase it if already present).
val mem : ?eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> boolmem ?eq k alist returns true iff k is a key in alist.
val update :
- eq:('a -> 'a -> bool) ->
- f:('b option -> 'b option) ->
- 'a ->
- ('a, 'b) t ->
- ('a, 'b) tupdate ~eq ~f k alist updates alist on the key k, by calling f (get alist k) and removing k if it returns None, mapping k to v' if it returns Some v'.
remove ~eq k alist returns the alist without the first pair with key k, if any.
val keys : ('a, 'b) t -> 'a listkeys alist returns a list of all keys of alist.
val values : ('a, 'b) t -> 'b listvalues alist returns a list of all values of alist.
CCListLabels.Infixl >|= f is the infix version of map with reversed arguments.
l1 @ l2 concatenates two lists l1 and l2. As append.
funs <*> l is product (fun f x -> f x) funs l.
val (--) : int -> int -> int CCList.ti -- j is the infix alias for range. Bounds included.
val (--^) : int -> int -> int CCList.ti --^ j is the infix alias for range'. Second bound j excluded.
(and&) is combine_shortest. It allows to perform a synchronized product between two lists, stopping gently at the shortest. Usable both with let+ and let*.
# let f xs ys zs =
- let+ x = xs
- and& y = ys
- and& z = zs in
- x + y + z;;
-val f : int list -> int list -> int list -> int list = <fun>
-# f [1;2] [5;6;7] [10;10];;
-- : int list = [16; 18]CCListLabels.Refval push : 'a t -> 'a -> unitpush rlist e adds an element e at the head of rlist.
val pop : 'a t -> 'a optionpop rlist removes and returns Some e (the first element of rlist) or None if the rlist is empty
val pop_exn : 'a t -> 'apop_exn rlist removes and returns the first element of rlist. Unsafe version of pop.
val create : unit -> 'a tcreate () creates a new empty reference list.
val clear : _ t -> unitclear rlist removes all elements of rlist.
val lift : ('a list -> 'b) -> 'a t -> 'blift f rlist applies a list function f to the content of rlist.
val push_list : 'a t -> 'a list -> unitpush_list rlist l adds elements of the list l at the beginning of the list ref rlist. Elements at the end of the list l will be at the beginning of the list ref rlist.
Traverse.Mval return : 'a -> 'a treturn is the Monadic return.
CCListLabels.TraverseCCListLabels.MONADval return : 'a -> 'a treturn is the Monadic return.
CCMap.Makeget k m returns Some v if the current binding of k in m is v, or None if the key k is not present. Safe version of find.
get_or k m ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in m).
update k f m calls f (Some v) if find k m = v, otherwise it calls f None. In any case, if the result is None k is removed from m, and if the result is Some v' then add k v' m is returned.
choose_opt m returns one binding of the given map m, or None if m is empty. Safe version of choose.
min_binding_opt m returns the smallest binding of the given map m, or None if m is empty. Safe version of min_binding.
max_binding_opt m returns the largest binding of the given map m, or None if m is empty. Safe version of max_binding.
find_opt k m returns Some v if the current binding of k in m is v, or None if the key k is not present. Safe version of find.
find_first f m where f is a monotonically increasing function, returns the binding of m with the lowest key k such that f k, or raises Not_found if no such key exists. See Map.S.find_first.
find_first_opt f m where f is a monotonically increasing function, returns an option containing the binding of m with the lowest key k such that f k, or None if no such key exists. Safe version of find_first.
val merge_safe :
- f:(key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) ->
- 'a t ->
- 'b t ->
- 'c tmerge_safe ~f a b merges the maps a and b together.
add_seq m seq adds the given Seq.t of bindings to the map m. Like add_list. Renamed from add_std_seq since 3.0.
add_seq ~f m l adds the given seq l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
of_seq seq builds a map from the given Seq.t of bindings. Like of_list. Renamed from of_std_seq since 3.0.
of_seq_with ~f l builds a map from the given seq l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
add_iter m iter adds the given iter of bindings to the map m. Like add_list.
add_iter ~f m l adds the given iter l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
of_iter iter builds a map from the given iter of bindings. Like of_list.
of_iter_with ~f l builds a map from the given iter l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the iter than v2.
to_iter m iterates on the whole map m, creating an iter of bindings. Like to_list.
of_list l builds a map from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, only its last binding will be present in the result.
of_list_with ~f l builds a map from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the list than v2.
add_list m l adds the given list l of bindings to the map m.
add_list ~f m l adds the given list l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
to_list m builds a list of the bindings of the given map m. The order is unspecified.
CCMap.Sget k m returns Some v if the current binding of k in m is v, or None if the key k is not present. Safe version of find.
get_or k m ~default returns the value associated to k if present, and returns default otherwise (if k doesn't belong in m).
update k f m calls f (Some v) if find k m = v, otherwise it calls f None. In any case, if the result is None k is removed from m, and if the result is Some v' then add k v' m is returned.
choose_opt m returns one binding of the given map m, or None if m is empty. Safe version of choose.
min_binding_opt m returns the smallest binding of the given map m, or None if m is empty. Safe version of min_binding.
max_binding_opt m returns the largest binding of the given map m, or None if m is empty. Safe version of max_binding.
find_opt k m returns Some v if the current binding of k in m is v, or None if the key k is not present. Safe version of find.
find_first f m where f is a monotonically increasing function, returns the binding of m with the lowest key k such that f k, or raises Not_found if no such key exists. See Map.S.find_first.
find_first_opt f m where f is a monotonically increasing function, returns an option containing the binding of m with the lowest key k such that f k, or None if no such key exists. Safe version of find_first.
val merge_safe :
- f:(key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) ->
- 'a t ->
- 'b t ->
- 'c tmerge_safe ~f a b merges the maps a and b together.
add_seq m seq adds the given Seq.t of bindings to the map m. Like add_list. Renamed from add_std_seq since 3.0.
add_seq ~f m l adds the given seq l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
of_seq seq builds a map from the given Seq.t of bindings. Like of_list. Renamed from of_std_seq since 3.0.
of_seq_with ~f l builds a map from the given seq l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
add_iter m iter adds the given iter of bindings to the map m. Like add_list.
add_iter ~f m l adds the given iter l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
of_iter iter builds a map from the given iter of bindings. Like of_list.
of_iter_with ~f l builds a map from the given iter l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the iter than v2.
to_iter m iterates on the whole map m, creating an iter of bindings. Like to_list.
of_list l builds a map from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, only its last binding will be present in the result.
of_list_with ~f l builds a map from the given list l of bindings k_i -> v_i, added in order using add. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the list than v2.
add_list m l adds the given list l of bindings to the map m.
add_list ~f m l adds the given list l of bindings to the map m, using f to combine values that have the same key. If a key occurs several times, all its bindings are combined using the function f, with f key v1 v2 being called with v1 occurring later in the seq than v2.
to_list m builds a list of the bindings of the given map m. The order is unspecified.
CCNativeint.Infixx / 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.
CCOpt.Infixf <*> o returns Some (f x) if o is Some x and None if o is None.
Let operators on OCaml >= 4.08.0, nothing otherwise
CCOption.Infixf <*> o returns Some (f x) if o is Some x and None if o is None.
Let operators on OCaml >= 4.08.0, nothing otherwise
CCOrd.Infixval (<?>) : 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.
CCParse.Debug_Debugging utils. EXPERIMENTAL
trace_fail name p behaves like p, but prints the error message of p on stderr whenever p fails.
trace_success name ~print p behaves like p, but prints successful runs of p using print.
CCParse.Errorval line_and_column : t -> int * intLine and column numbers of the error position.
val msg : t -> stringval to_string : t -> stringPrints the error
val pp : Stdlib.Format.formatter -> t -> unitPretty prints the error
CCParse.InfixAlias to map. p >|= f parses an item x using p, and returns f x.
Alias to bind. p >>= f results in a new parser which behaves as p then, in case of success, applies f to the result.
a <* b parses a into x, parses b and ignores its result, and returns x.
a *> b parses a, then parses b into x, and returns x. The result of a is ignored.
Alias to or_.
a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a.
a <?> msg behaves like a, but if a fails, a <?> msg fails with msg instead. Useful as the last choice in a series of <|>. For example: a <|> b <|> c <?> "expected one of a, b, c".
Alias to both. a ||| b parses a, then b, then returns the pair of their results.
Let operators on OCaml >= 4.08.0, nothing otherwise
CCParse.Positiontype t = positionval line : t -> intLine number, 0 based
val column : t -> intColumn number, 0 based
val line_and_column : t -> int * intLine and column number
val pp : Stdlib.Format.formatter -> t -> unitUnspecified pretty-printed version of the position.
CCParse.SliceFunctions on slices.
type t = sliceval is_empty : t -> boolIs the slice empty?
val length : t -> intLength of the slice
val to_string : t -> stringConvert the slice into a string. Linear time and memory in length slice
CCParse.UThis is useful to parse OCaml-like values in a simple way. All the parsers are whitespace-insensitive (they skip whitespace).
list p parses a list of p, with the OCaml conventions for start token "[", stop token "]" and separator ";". Whitespace between items are skipped.
val int : int tParse an int in decimal representation.
in_parens_opt p parses p in an arbitrary number of nested parenthesis (possibly 0).
option p parses "Some <x>" into Some x if p parses "<x>" into x, and parses "None" into None.
val hexa_int : int tParse an int int hexadecimal format. Accepts an optional 0x prefix, and ignores capitalization.
val word : string tNon empty string of alpha num, start with alpha.
val bool : bool tAccepts "true" or "false"
Parse a pair using OCaml syntactic conventions. The default is "(a, b)".
CCResult.InfixMonadic 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.
Traverse.Mval return : 'a -> 'a tMonadic return.
CCResult.TraverseCCResult.MONADval return : 'a -> 'a tMonadic return.
CCSeq.InfixTraverse.MCCSeq.TraverseCCSeq.MONADCCSet.MakeSafe version of find_first.
CCSet.SSafe version of find_first.
CCSexp.Decoderval of_lexbuf : Stdlib.Lexing.lexbuf -> tval next : t -> sexp parse_resultParse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.
val to_list : t -> sexp list CCSexp_intf.or_errorRead all the values from this decoder.
Make.Decoderval of_lexbuf : Stdlib.Lexing.lexbuf -> tval next : t -> sexp parse_resultParse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.
val to_list : t -> sexp list CCSexp_intf.or_errorRead all the values from this decoder.
Make.Sexpval make_loc : ((int * int) -> (int * int) -> string -> loc) optionIf provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename
CCSexp.MakeThis builds a parser and printer for S-expressions represented as in the Sexp argument.
include CCSexp_intf.S0 with type t = Sexp.ttype t = Sexp.ttype sexp = tval atom : string -> tMake an atom out of this string.
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.
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.
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.
type loc = Sexp.locLocations for the S-expressions.
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 ... endCCSexp_intf.BASIC_SEXPval atom : string -> tS.Decoderval of_lexbuf : Stdlib.Lexing.lexbuf -> tval next : t -> sexp parse_resultParse the next S-expression or return an error if the input isn't long enough or isn't a proper S-expression.
CCSexp_intf.Sinclude S0type sexp = tval atom : string -> tMake an atom out of this string.
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.
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval 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.
Parse 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).
Parse a channel into a generator of S-expressions.
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 ... endCCSexp_intf.S0type sexp = tval atom : string -> tMake an atom out of this string.
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.
val to_buf : Stdlib.Buffer.t -> t -> unitval to_string : t -> stringval to_file : string -> t -> unitval 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.
Parse 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).
Parse a channel into a generator of S-expressions.
CCSexp_intf.SEXPval make_loc : ((int * int) -> (int * int) -> string -> loc) optionIf provided, builds a location from a pair of (line,column) positions, and a (possibly dummy) filename
CCShims_syntax.LETLet operators on OCaml >= 4.08.0, nothing otherwise
CCString.Findval compile : string -> [ `Direct ] patternval rcompile : string -> [ `Reverse ] patternval find : ?start:int -> pattern:[ `Direct ] pattern -> string -> intfind ~start ~pattern s searches for pattern in the string s, left-to-right.
val rfind : ?start:int -> pattern:[ `Reverse ] pattern -> string -> intrfind ~start ~pattern s searches for pattern in the string s, right-to-left.
CCString.InfixCCString.SplitSpecification of what to do with empty blocks, as in split ~by:"-" "-a-b-".
{first=false; last=false} will return ""; "a"; "b"; ""{first=true; last=false} will return "a"; "b" ""{first=false; last=true} will return ""; "a"; "b"{first=true; last=true} will return "a"; "b"The default value of all remaining functions is Drop_none.
val no_drop : drop_if_emptyno_drop does not drop any group, even empty and on borders.
val list_ :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) listlist_ ~drop ~by s splits the given string s along the given separator by. Should only be used with very small separators, otherwise use Containers_string.KMP.
val gen :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) gengen ~drop ~by s splits the given string s along the given separator by. Returns a gen of slices.
val iter :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) iteriter ~drop ~by s splits the given string s along the given separator by. Returns an iter of slices.
val seq :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) Stdlib.Seq.tseq ~drop ~by s splits the given string s along the given separator by. Returns a Seq.t of slices. Renamed from std_seq since 3.0.
Those split functions actually copy the substrings, which can be more convenient but less efficient in general.
val list_cpy : ?drop:drop_if_empty -> by:string -> string -> string listlist_cpy ~drop ~by s splits the given string s along the given separator by. Returns a list of strings.
val gen_cpy : ?drop:drop_if_empty -> by:string -> string -> string gengen_cpy ~drop ~by s splits the given string s along the given separator by. Returns a gen of strings.
val iter_cpy : ?drop:drop_if_empty -> by:string -> string -> string iteriter_cpy ~drop ~by s splits the given string s along the given separator by. Returns an iter of strings.
val seq_cpy : ?drop:drop_if_empty -> by:string -> string -> string Stdlib.Seq.tseq_cpy ~drop ~by s splits the given string s along the given separator by. Returns a Seq.t of strings. Renamed from std_seq_cpy since 3.0.
left ~by s splits on the first occurrence of by from the leftmost part of the string s.
left_exn ~by s splits on the first occurrence of by from the leftmost part of the string s.
right ~by s splits on the first occurrence of by from the rightmost part of the string s.
CCStringLabels.Findval compile : string -> [ `Direct ] patternval rcompile : string -> [ `Reverse ] patternval find : ?start:int -> pattern:[ `Direct ] pattern -> string -> intfind ?start ~pattern s searches for pattern in the string s, left-to-right.
val rfind : ?start:int -> pattern:[ `Reverse ] pattern -> string -> intrfind ?start ~pattern s searches for pattern in the string s, right-to-left.
CCStringLabels.InfixCCStringLabels.SplitSpecification of what to do with empty blocks, as in split ~by:"-" "-a-b-".
{first=false; last=false} will return ""; "a"; "b"; ""{first=true; last=false} will return "a"; "b" ""{first=false; last=true} will return ""; "a"; "b"{first=true; last=true} will return "a"; "b"The default value of all remaining functions is Drop_none.
val no_drop : drop_if_emptyno_drop does not drop any group, even empty and on borders.
val list_ :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) listlist_ ?drop ~by s splits the given string s along the given separator by. Should only be used with very small separators, otherwise use Containers_string.KMP.
val gen :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) gengen ?drop ~by s splits the given string s along the given separator by. Returns a gen of slices.
val iter :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) iteriter ?drop ~by s splits the given string s along the given separator by. Returns an iter of slices.
val seq :
- ?drop:drop_if_empty ->
- by:string ->
- string ->
- (string * int * int) Stdlib.Seq.tseq ?drop ~by s splits the given string s along the given separator by. Returns a Seq.t of slices. Renamed from std_seq since 3.0.
Those split functions actually copy the substrings, which can be more convenient but less efficient in general.
val list_cpy : ?drop:drop_if_empty -> by:string -> string -> string listlist_cpy ?drop ~by s splits the given string s along the given separator by. Returns a list of strings.
val gen_cpy : ?drop:drop_if_empty -> by:string -> string -> string gengen_cpy ?drop ~by s splits the given string s along the given separator by. Returns a gen of strings.
val iter_cpy : ?drop:drop_if_empty -> by:string -> string -> string iteriter_cpy ?drop ~by s splits the given string s along the given separator by. Returns an iter of strings.
val seq_cpy : ?drop:drop_if_empty -> by:string -> string -> string Stdlib.Seq.tseq_cpy ?drop ~by s splits the given string s along the given separator by. Returns a Seq.t of strings. Renamed from std_seq_cpy since 3.0.
left ~by s splits on the first occurrence of by from the leftmost part of the string s.
left_exn ~by s splits on the first occurrence of by from the leftmost part of the string s.
right ~by s splits on the first occurrence of by from the rightmost part of the string s.
CCUnix.Infixval (?|) : ('a, Stdlib.Buffer.t, unit, call_result) Stdlib.format4 -> 'aInfix version of call.
val (?|&) : ('a, Stdlib.Buffer.t, unit, async_call_result) Stdlib.format4 -> 'aInfix version of async_call.
Hashtbl.Makeval create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__Hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tMakeSeeded.HHashtbl.MakeSeededmodule H : SeededHashedTypetype key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tContainers.Hashtblinclude module type of Stdlib.Hashtbl
- with type statistics = Stdlib.Hashtbl.statistics
- and module Make = Stdlib.Hashtbl.Make
- and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.tval create : ?random:bool -> int -> ('a, 'b) tval clear : ('a, 'b) t -> unitval reset : ('a, 'b) t -> unitval add : ('a, 'b) t -> 'a -> 'b -> unitval find : ('a, 'b) t -> 'a -> 'bval find_opt : ('a, 'b) t -> 'a -> 'b optionval find_all : ('a, 'b) t -> 'a -> 'b listval mem : ('a, 'b) t -> 'a -> boolval remove : ('a, 'b) t -> 'a -> unitval replace : ('a, 'b) t -> 'a -> 'b -> unitval iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unitval filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unitval fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'cval length : ('a, 'b) t -> intval stats : ('a, 'b) t -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly endget 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 CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.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) CCHashtbl.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) CCHashtbl.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) CCHashtbl.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) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order.
val of_iter_with :
- f:('a -> 'b -> 'b -> 'b) ->
- ('a * 'b) CCHashtbl.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.
val of_seq_with :
- f:('a -> 'b -> 'b -> 'b) ->
- ('a * 'b) Stdlib.Seq.t ->
- ('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.
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.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 CCHashtbl.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 CCHashtbl.printer ->
- ?pp_stop:unit CCHashtbl.printer ->
- ?pp_sep:unit CCHashtbl.printer ->
- ?pp_arrow:unit CCHashtbl.printer ->
- 'a CCHashtbl.printer ->
- 'b CCHashtbl.printer ->
- ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.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.
module type S' = CCHashtbl.Smodule Make' = CCHashtbl.MakeHashtbl.HashedTypeHashtbl.Sval create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tHashtbl.SeededHashedTypeHashtbl.SeededSval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tHashtbl.Makeval create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> Stdlib__Hashtbl.statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tMakeSeeded.HHashtbl.MakeSeededmodule H : SeededHashedTypetype key = H.tval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tContainersLabels.Hashtblinclude module type of Stdlib.Hashtbl
- with type statistics = Stdlib.Hashtbl.statistics
- and module Make = Stdlib.Hashtbl.Make
- and type ('a, 'b) t = ('a, 'b) Stdlib.Hashtbl.tval create : ?random:bool -> int -> ('a, 'b) tval clear : ('a, 'b) t -> unitval reset : ('a, 'b) t -> unitval add : ('a, 'b) t -> 'a -> 'b -> unitval find : ('a, 'b) t -> 'a -> 'bval find_opt : ('a, 'b) t -> 'a -> 'b optionval find_all : ('a, 'b) t -> 'a -> 'b listval mem : ('a, 'b) t -> 'a -> boolval remove : ('a, 'b) t -> 'a -> unitval replace : ('a, 'b) t -> 'a -> 'b -> unitval iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unitval filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unitval fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'cval length : ('a, 'b) t -> intval stats : ('a, 'b) t -> statisticsval to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.tval to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.tval to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.tval replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unitmodule type HashedType = sig ... endmodule type S = sig ... endmodule type SeededHashedType = sig ... endmodule type SeededS = sig ... endmodule MakeSeeded (H : SeededHashedType) : sig ... endinclude module type of struct include CCHashtbl.Poly endget 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 CCHashtbl.iterkeys tbl f iterates on keys (similar order as Hashtbl.iter).
val values : ('a, 'b) Stdlib.Hashtbl.t -> 'b CCHashtbl.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) CCHashtbl.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) CCHashtbl.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) CCHashtbl.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) CCHashtbl.iter -> ('a, 'b) Stdlib.Hashtbl.tFrom the given bindings, added in order.
val of_iter_with :
- f:('a -> 'b -> 'b -> 'b) ->
- ('a * 'b) CCHashtbl.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.
val of_seq_with :
- f:('a -> 'b -> 'b -> 'b) ->
- ('a * 'b) Stdlib.Seq.t ->
- ('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.
val add_iter_count : ('a, int) Stdlib.Hashtbl.t -> 'a CCHashtbl.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 CCHashtbl.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 CCHashtbl.printer ->
- ?pp_stop:unit CCHashtbl.printer ->
- ?pp_sep:unit CCHashtbl.printer ->
- ?pp_arrow:unit CCHashtbl.printer ->
- 'a CCHashtbl.printer ->
- 'b CCHashtbl.printer ->
- ('a, 'b) Stdlib.Hashtbl.t CCHashtbl.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.
module type S' = CCHashtbl.Smodule Make' = CCHashtbl.MakeHashtbl.HashedTypeHashtbl.Sval create : int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tHashtbl.SeededHashedTypeHashtbl.SeededSval create : ?random:bool -> int -> 'a tval clear : 'a t -> unitval reset : 'a t -> unitval length : 'a t -> intval stats : 'a t -> statisticsval to_seq_values : 'a t -> 'a Stdlib.Seq.tContainers_bencode.DecodeDecoding
Containers_bencode.EncodeEncoding
val to_string : t -> stringval to_buffer : Stdlib.Buffer.t -> t -> unitval to_chan : Stdlib.out_channel -> t -> unitval to_fmt : Stdlib.Format.formatter -> t -> unitContainers_bencode.Str_mapContainers_codegen.Bitfieldval make : ?emit_failure_if_too_wide:bool -> name:string -> unit -> tMake a new bitfield with the given name.
val field_bit : t -> string -> unitfield_bit ty name adds a field of size 1 to the bitfield ty, with name name. The generate code will provide get/set for a boolean.
val field_int : t -> width:int -> string -> unitfield_int ty name ~width adds a field of size width to the bitfield with name name. The accessors will be for integers of width bits, and the setter might assert that the provided integer fits.
val total_width : t -> intTotal width in bits of the given bitfield.
Containers_codegen.Codetype t = codeval pp : t Fmt.printerval to_string : t -> stringval mk_pp : unit Fmt.printer -> tval mk_str : string -> tMake.AContainers_scc.MakeContainers_scc.ARGS.AContainers_scc.S0&&(t="."===(t=e)?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r,n=e.parser,a=t[4],i=t[5],o=lt(t[0]),s="atom"===o.type&&"open"===o.family?sn(o.text):null,l=lt(t[1]),h="atom"===l.type&&"close"===l.family?sn(l.text):null,m=Ut(t[2],"size"),c=null;r=!!m.isBlank||(c=m.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var d=Ut(p.body[0],"textord");u=on[Number(d.text)]}}else p=Ut(p,"textord"),u=on[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:i,continued:!1,hasBarLine:r,barSize:c,leftDelim:s,rightDelim:h,size:u}},htmlBuilder:nn,mathmlBuilder:an}),ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser,n=(e.funcName,e.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Ut(t[0],"size").value,token:n}}}),ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Ut(t[1],"infix").size),i=t[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:nn,mathmlBuilder:an});var ln=function(e,t){var r,n,a=t.style;"supsub"===e.type?(r=e.sup?wt(e.sup,t.havingStyle(a.sup()),t):wt(e.sub,t.havingStyle(a.sub()),t),n=Ut(e.base,"horizBrace")):n=Ut(e,"horizBrace");var i,o=wt(n.base,t.havingBaseStyle(x.DISPLAY)),s=Gt(n,t);if(n.isOver?(i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Ke.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t);i=n.isOver?Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):Ke.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t)};ot({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:ln,mathmlBuilder:function(e,t){var r=Vt(e.label);return new Tt.MathNode(e.isOver?"mover":"munder",[Rt(e.base,t),r])}}),ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=Ut(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:ht(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=It(e.body,t);return r instanceof zt||(r=new zt("mrow",[r])),r.setAttribute("href",e.href),r}}),ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Ut(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],i=0;i0&&(u+=M,p-=M)}var z=[{type:"elem",elem:a,shift:p,marginRight:y,marginLeft:w},{type:"elem",elem:n,shift:-u,marginRight:y}];v=Ke.makeVList({positionType:"individualShift",children:z},t)}else if(a){p=Math.max(p,c.sub1,a.height-.8*c.xHeight);var A=[{type:"elem",elem:a,marginLeft:w,marginRight:y}];v=Ke.makeVList({positionType:"shift",positionData:p,children:A},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,n.depth+.25*c.xHeight),v=Ke.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:y}]},t)}var T=yt(m,"right")||"mord";return Ke.makeSpan([T],[m,Ke.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,i=[Rt(e.base,t)];if(e.sub&&i.push(Rt(e.sub,t)),e.sup&&i.push(Rt(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===x.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===x.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===x.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===x.DISPLAY)?"munder":"msub"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===x.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===x.DISPLAY)?"mover":"msup"}return new Tt.MathNode(a,i)}}),st({type:"atom",htmlBuilder:function(e,t){return Ke.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[Bt(e.text,e.mode)]);if("bin"===e.family){var n=qt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var kn={mi:"italic",mn:"normal",mtext:"normal"};st({type:"mathord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mi",[Bt(e.text,e.mode,t)]),n=qt(e,t)||"italic";return n!==kn[r.type]&&r.setAttribute("mathvariant",n),r}}),st({type:"textord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r,n=Bt(e.text,e.mode,t),a=qt(e,t)||"normal";return r="text"===e.mode?new Tt.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new Tt.MathNode("mn",[n]):"\\prime"===e.text?new Tt.MathNode("mo",[n]):new Tt.MathNode("mi",[n]),a!==kn[r.type]&&r.setAttribute("mathvariant",a),r}});var Sn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};st({type:"spacing",htmlBuilder:function(e,t){if(Mn.hasOwnProperty(e.text)){var r=Mn[e.text].className||"";if("text"===e.mode){var a=Ke.makeOrd(e,t,"textord");return a.classes.push(r),a}return Ke.makeSpan(["mspace",r],[Ke.mathsym(e.text,e.mode,t)],t)}if(Sn.hasOwnProperty(e.text))return Ke.makeSpan(["mspace",Sn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!Mn.hasOwnProperty(e.text)){if(Sn.hasOwnProperty(e.text))return new Tt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return new Tt.MathNode("mtext",[new Tt.TextNode("\xa0")])}});var zn=function(){var e=new Tt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};st({type:"tag",mathmlBuilder:function(e,t){var r=new Tt.MathNode("mtable",[new Tt.MathNode("mtr",[zn(),new Tt.MathNode("mtd",[It(e.body,t)]),zn(),new Tt.MathNode("mtd",[It(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var An={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Tn={"\\textbf":"textbf","\\textmd":"textmd"},Bn={"\\textit":"textit","\\textup":"textup"},Cn=function(e,t){var r=e.font;return r?An[r]?t.withTextFontFamily(An[r]):Tn[r]?t.withTextFontWeight(Tn[r]):t.withTextFontShape(Bn[r]):t};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:ht(a),font:n}},htmlBuilder:function(e,t){var r=Cn(e,t),n=ft(e.body,r,!0);return Ke.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Cn(e,t);return It(e.body,r)}}),ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"underline",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=Ke.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","underline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("munder",[Rt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){return{type:"vcenter",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return Ke.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new Tt.MathNode("mpadded",[Rt(e.body,t)],["vcenter"])}}),ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=qn(e),n=[],a=t.havingStyle(t.style.text()),i=0;i