From 29b63c7186fdcbb4fc3010191edd509947c87808 Mon Sep 17 00:00:00 2001 From: FardaleM Date: Sat, 17 Sep 2022 19:36:37 +0000 Subject: [PATCH] deploy: 15c91527951258023d7fe310d48541ca5a8200e7 --- dev/containers/CCHashtbl/Make/index.html | 2 +- dev/containers/CCHashtbl/module-type-S/index.html | 2 +- dev/containers/CCRandom/index.html | 2 +- dev/containers/CCString/index.html | 2 +- dev/containers/CCStringLabels/index.html | 2 +- dev/containers/Containers/Hashtbl/index.html | 2 +- dev/containers/ContainersLabels/Hashtbl/index.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/containers/CCHashtbl/Make/index.html b/dev/containers/CCHashtbl/Make/index.html index 2be6989f..2fa64c3b 100644 --- a/dev/containers/CCHashtbl/Make/index.html +++ b/dev/containers/CCHashtbl/Make/index.html @@ -1,7 +1,7 @@ Make (containers.CCHashtbl.Make)

Module CCHashtbl.Make

Parameters

module X : Stdlib.Hashtbl.HashedType

Signature

include Stdlib.Hashtbl.S with type key = X.t - with type 'a t = 'a Stdlib.Hashtbl.Make(X).t
type key = X.t
type 'a t = 'a Stdlib.Hashtbl.Make(X).t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : ( key -> 'a -> unit ) -> 'a t -> unit
val filter_map_inplace : ( key -> 'a -> 'a option ) -> 'a t -> unit
val fold : ( key -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

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

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

  • since 0.16
val add_list : 'a list t -> key -> 'a -> unit

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

  • since 0.16
val incr : ?by:int -> int t -> key -> unit

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> int t -> key -> unit

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.

  • since 0.16
val keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : 'a t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

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

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

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

  • since 2.8
val add_iter_with : + with type 'a t = 'a Stdlib.Hashtbl.Make(X).t
type key = X.t
type 'a t = 'a Stdlib.Hashtbl.Make(X).t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : ( key -> 'a -> unit ) -> 'a t -> unit
val filter_map_inplace : ( key -> 'a -> 'a option ) -> 'a t -> unit
val fold : ( key -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib__Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

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

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

  • since 0.16
val add_list : 'a list t -> key -> 'a -> unit

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

  • since 0.16
val incr : ?by:int -> int t -> key -> unit

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> int t -> key -> unit

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.

  • since 0.16
val keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : 'a t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

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

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

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

  • since 2.8
val add_iter_with : f:( key -> 'a -> 'a -> 'a ) -> 'a t -> (key * 'a) iter -> diff --git a/dev/containers/CCHashtbl/module-type-S/index.html b/dev/containers/CCHashtbl/module-type-S/index.html index 211cbc52..1038f2b4 100644 --- a/dev/containers/CCHashtbl/module-type-S/index.html +++ b/dev/containers/CCHashtbl/module-type-S/index.html @@ -1,5 +1,5 @@ -S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Stdlib.Hashtbl.S
type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : ( key -> 'a -> unit ) -> 'a t -> unit
val filter_map_inplace : ( key -> 'a -> 'a option ) -> 'a t -> unit
val fold : ( key -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

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

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

  • since 0.16
val add_list : 'a list t -> key -> 'a -> unit

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

  • since 0.16
val incr : ?by:int -> int t -> key -> unit

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> int t -> key -> unit

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.

  • since 0.16
val keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : 'a t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

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

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

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

  • since 2.8
val add_iter_with : +S (containers.CCHashtbl.S)

Module type CCHashtbl.S

include Stdlib.Hashtbl.S
type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : ( key -> 'a -> unit ) -> 'a t -> unit
val filter_map_inplace : ( key -> 'a -> 'a option ) -> 'a t -> unit
val fold : ( key -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Stdlib__Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val get : 'a t -> key -> 'a option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

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

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

  • since 0.16
val add_list : 'a list t -> key -> 'a -> unit

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

  • since 0.16
val incr : ?by:int -> int t -> key -> unit

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> int t -> key -> unit

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.

  • since 0.16
val keys : 'a t -> key iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : 'a t -> 'a iter

values tbl f iterates on values in the table.

val keys_list : _ t -> key list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : 'a t -> 'a list

values_list t is the list of values in t.

  • since 0.8
val map_list : ( key -> 'a -> 'b ) -> 'a t -> 'b list

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

val to_iter : 'a t -> (key * 'a) iter

Iterate on bindings in the table.

  • since 2.8
val add_iter : 'a t -> (key * 'a) iter -> unit

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

  • since 2.8
val add_iter_with : f:( key -> 'a -> 'a -> 'a ) -> 'a t -> (key * 'a) iter -> diff --git a/dev/containers/CCRandom/index.html b/dev/containers/CCRandom/index.html index 5cb9fac2..354bbdba 100644 --- a/dev/containers/CCRandom/index.html +++ b/dev/containers/CCRandom/index.html @@ -1,5 +1,5 @@ -CCRandom (containers.CCRandom)

Module CCRandom

Random Generators

include module type of struct include Stdlib.Random end
val init : int -> unit
val full_init : int array -> unit
val self_init : unit -> unit
val bits : unit -> int
val full_int : int -> int
val int32 : Stdlib.Int32.t -> Stdlib.Int32.t
val nativeint : Stdlib.Nativeint.t -> Stdlib.Nativeint.t
val int64 : Stdlib.Int64.t -> Stdlib.Int64.t
val bool : unit -> bool
module State = Stdlib__Random.State
val get_state : unit -> State.t
val set_state : State.t -> unit
type state = Stdlib.Random.State.t
type 'a t = state -> 'a

Random generator for values of type 'a.

type 'a random_gen = 'a t
val return : 'a -> 'a t

return x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).

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

flat_map f g st is f (g st) st.

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

Monadic bind.

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

map f g st is f (g st).

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

Delay evaluation. Useful for side-effectful generators that need some code to run for every call. Example:

let gensym = let r = ref 0 in fun () -> incr r; !r ;;
+CCRandom (containers.CCRandom)

Module CCRandom

Random Generators

include module type of struct include Stdlib.Random end
val init : int -> unit
val full_init : int array -> unit
val self_init : unit -> unit
val bits : unit -> int
val full_int : int -> int
val int32 : Stdlib.Int32.t -> Stdlib.Int32.t
val nativeint : Stdlib.Nativeint.t -> Stdlib.Nativeint.t
val int64 : Stdlib.Int64.t -> Stdlib.Int64.t
val bool : unit -> bool
val bits32 : unit -> Stdlib.Int32.t
val bits64 : unit -> Stdlib.Int64.t
val nativebits : unit -> Stdlib.Nativeint.t
module State = Stdlib__Random.State
val get_state : unit -> State.t
val set_state : State.t -> unit
type state = Stdlib.Random.State.t
type 'a t = state -> 'a

Random generator for values of type 'a.

type 'a random_gen = 'a t
val return : 'a -> 'a t

return x is the generator that always returns x. Example: let random_int = return 4 (* fair dice roll *).

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

flat_map f g st is f (g st) st.

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

Monadic bind.

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

map f g st is f (g st).

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

Delay evaluation. Useful for side-effectful generators that need some code to run for every call. Example:

let gensym = let r = ref 0 in fun () -> incr r; !r ;;
 
 delay (fun () ->
   let name = gensym() in
diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html
index dc1af23a..b0e2abbd 100644
--- a/dev/containers/CCString/index.html
+++ b/dev/containers/CCString/index.html
@@ -1,5 +1,5 @@
 
-CCString (containers.CCString)

Module CCString

Basic String Utils

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.String end
type t = string
val make : int -> char -> string
val init : int -> ( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : string -> string list -> string
val cat : string -> string -> string
val equal : t -> t -> bool
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> int -> int -> string
val map : ( char -> char ) -> string -> string
val mapi : ( int -> char -> char ) -> string -> string
val fold_left : ( 'a -> char -> 'a ) -> 'a -> string -> 'a
val fold_right : ( char -> 'a -> 'a ) -> string -> 'a -> 'a
val trim : string -> string
val escaped : string -> string
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val iteri : ( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> int -> int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : string -> int -> bytes -> int -> int -> unit
val unsafe_fill : bytes -> int -> int -> char -> unit
val length : t -> int

length s returns the length (number of characters) of the given string s.

val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unit

blit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.

  • raises Invalid_argument

    if indices are not valid.

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

fold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].

  • since 0.7
val foldi : ( 'a -> int -> char -> 'a ) -> 'a -> t -> 'a

foldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.

  • since 3.3

Conversions

val to_gen : t -> char gen

to_gen s returns the gen of characters contained in the string s.

val to_iter : t -> char iter

to_iter s returns the iter of characters contained in the string s.

  • since 2.8
val to_seq : t -> char Stdlib.Seq.t

to_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.

  • since 3.0
val to_list : t -> char list

to_list s returns the list of characters contained in the string s.

val pp_buf : Stdlib.Buffer.t -> t -> unit

pp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.

val pp : Stdlib.Format.formatter -> t -> unit

pp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.

val compare : string -> string -> int

compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.

val is_empty : string -> bool

is_empty s returns true iff s is empty (i.e. its length is 0).

  • since 1.5
val hash : string -> int

hash s returns the hash value of s.

val rev : string -> string

rev s returns the reverse of s.

  • since 0.17
val pad : ?side:[ `Left | `Right ] -> ?c:char -> int -> string -> string

pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.

  • parameter side

    determines where padding occurs (default: `Left).

  • parameter c

    the char used to pad (default: ' ').

  • since 0.17
val of_char : char -> string

of_char 'a' is "a".

  • since 0.19
val of_gen : char gen -> string

of_gen gen converts a gen of characters to a string.

val of_iter : char iter -> string

of_iter iter converts an iter of characters to a string.

  • since 2.8
val of_seq : char Stdlib.Seq.t -> string

of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_list : char list -> string

of_list lc converts a list of characters lc to a string.

val of_array : char array -> string

of_array ac converts an array of characters ac to a string.

val to_array : string -> char array

to_array s returns the array of characters contained in the string s.

val find : ?start:int -> sub:string -> string -> int

find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.

  • parameter start

    starting position in s.

val find_all : ?start:int -> sub:string -> string -> int gen

find_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.

  • parameter start

    starting position in s.

  • since 0.17
val find_all_l : ?start:int -> sub:string -> string -> int list

find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.

  • parameter start

    starting position in s.

  • since 0.17
val mem : ?start:int -> sub:string -> string -> bool

mem ~start ~sub s is true iff sub is a substring of s.

  • since 0.12
val rfind : sub:string -> string -> int

rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.

  • since 0.12
val replace : +CCString (containers.CCString)

Module CCString

Basic String Utils

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.String end
type t = string
val make : int -> char -> string
val init : int -> ( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : string -> string list -> string
val cat : string -> string -> string
val equal : t -> t -> bool
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> int -> int -> string
val map : ( char -> char ) -> string -> string
val mapi : ( int -> char -> char ) -> string -> string
val fold_left : ( 'a -> char -> 'a ) -> 'a -> string -> 'a
val fold_right : ( char -> 'a -> 'a ) -> string -> 'a -> 'a
val trim : string -> string
val escaped : string -> string
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val iteri : ( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val get_utf_8_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_8 : t -> bool
val get_utf_16be_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16be : t -> bool
val get_utf_16le_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16le : t -> bool
val create : int -> bytes
val copy : string -> string
val fill : bytes -> int -> int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : string -> int -> bytes -> int -> int -> unit
val unsafe_fill : bytes -> int -> int -> char -> unit
val length : t -> int

length s returns the length (number of characters) of the given string s.

val blit : t -> int -> Stdlib.Bytes.t -> int -> int -> unit

blit src src_pos dst dst_pos len copies len characters from string src starting at character indice src_pos, to the Bytes sequence dst starting at character indice dst_pos. Like String.blit. Compatible with the -safe-string option.

  • raises Invalid_argument

    if indices are not valid.

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

fold f init s folds on chars by increasing index. Computes f(… (f (f init s.[0]) s.[1]) …) s.[n-1].

  • since 0.7
val foldi : ( 'a -> int -> char -> 'a ) -> 'a -> t -> 'a

foldi f init s is just like fold, but it also passes in the index of each chars as second argument to the folded function f.

  • since 3.3

Conversions

val to_gen : t -> char gen

to_gen s returns the gen of characters contained in the string s.

val to_iter : t -> char iter

to_iter s returns the iter of characters contained in the string s.

  • since 2.8
val to_seq : t -> char Stdlib.Seq.t

to_seq s returns the Seq.t of characters contained in the string s. Renamed from to std_seq since 3.0.

  • since 3.0
val to_list : t -> char list

to_list s returns the list of characters contained in the string s.

val pp_buf : Stdlib.Buffer.t -> t -> unit

pp_buf buf s prints s to the buffer buf. Renamed from pp since 2.0.

val pp : Stdlib.Format.formatter -> t -> unit

pp f s prints the string s within quotes to the formatter f. Renamed from print since 2.0.

val compare : string -> string -> int

compare s1 s2 compares the strings s1 and s2 and returns an integer that indicates their relative position in the sort order.

val is_empty : string -> bool

is_empty s returns true iff s is empty (i.e. its length is 0).

  • since 1.5
val hash : string -> int

hash s returns the hash value of s.

val rev : string -> string

rev s returns the reverse of s.

  • since 0.17
val pad : ?side:[ `Left | `Right ] -> ?c:char -> int -> string -> string

pad ~side ~c n s ensures that the string s is at least n bytes long, and pads it on the side with c if it's not the case.

  • parameter side

    determines where padding occurs (default: `Left).

  • parameter c

    the char used to pad (default: ' ').

  • since 0.17
val of_char : char -> string

of_char 'a' is "a".

  • since 0.19
val of_gen : char gen -> string

of_gen gen converts a gen of characters to a string.

val of_iter : char iter -> string

of_iter iter converts an iter of characters to a string.

  • since 2.8
val of_seq : char Stdlib.Seq.t -> string

of_seq seq converts a seq of characters to a string. Renamed from of_std_seq since 3.0.

  • since 3.0
val of_list : char list -> string

of_list lc converts a list of characters lc to a string.

val of_array : char array -> string

of_array ac converts an array of characters ac to a string.

val to_array : string -> char array

to_array s returns the array of characters contained in the string s.

val find : ?start:int -> sub:string -> string -> int

find ~start ~sub s returns the starting index of the first occurrence of sub within s or -1.

  • parameter start

    starting position in s.

val find_all : ?start:int -> sub:string -> string -> int gen

find_all ~start ~sub s finds all occurrences of sub in s, even overlapping instances and returns them in a generator gen.

  • parameter start

    starting position in s.

  • since 0.17
val find_all_l : ?start:int -> sub:string -> string -> int list

find_all_l ~sub s finds all occurrences of sub in s and returns them in a list.

  • parameter start

    starting position in s.

  • since 0.17
val mem : ?start:int -> sub:string -> string -> bool

mem ~start ~sub s is true iff sub is a substring of s.

  • since 0.12
val rfind : sub:string -> string -> int

rfind ~sub s finds sub in string s from the right, returns its first index or -1. Should only be used with very small sub.

  • since 0.12
val replace : ?which:[ `Left | `Right | `All ] -> sub:string -> by:string -> diff --git a/dev/containers/CCStringLabels/index.html b/dev/containers/CCStringLabels/index.html index 7c02015f..b920f900 100644 --- a/dev/containers/CCStringLabels/index.html +++ b/dev/containers/CCStringLabels/index.html @@ -1,5 +1,5 @@ -CCStringLabels (containers.CCStringLabels)

Module CCStringLabels

Basic String Utils (Labeled version of CCString)

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.StringLabels end
type t = string
val make : int -> char -> string
val init : int -> f:( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : sep:string -> string list -> string
val cat : string -> string -> string
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> pos:int -> len:int -> string
val map : f:( char -> char ) -> string -> string
val mapi : f:( int -> char -> char ) -> string -> string
val fold_left : f:( 'a -> char -> 'a ) -> init:'a -> string -> 'a
val fold_right : f:( char -> 'a -> 'a ) -> string -> init:'a -> 'a
val trim : string -> string
val escaped : string -> string
val iteri : f:( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val create : int -> bytes
val copy : string -> string
val fill : bytes -> pos:int -> len:int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : +CCStringLabels (containers.CCStringLabels)

Module CCStringLabels

Basic String Utils (Labeled version of CCString)

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

Fast internal iterator.

  • since 2.8
type 'a gen = unit -> 'a option
include module type of struct include Stdlib.StringLabels end
type t = string
val make : int -> char -> string
val init : int -> f:( int -> char ) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val get : string -> int -> char
val concat : sep:string -> string list -> string
val cat : string -> string -> string
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> pos:int -> len:int -> string
val map : f:( char -> char ) -> string -> string
val mapi : f:( int -> char -> char ) -> string -> string
val fold_left : f:( 'a -> char -> 'a ) -> init:'a -> string -> 'a
val fold_right : f:( char -> 'a -> 'a ) -> string -> init:'a -> 'a
val trim : string -> string
val escaped : string -> string
val iteri : f:( int -> char -> unit ) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seqi : t -> (int * char) Stdlib.Seq.t
val get_utf_8_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_8 : t -> bool
val get_utf_16be_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16be : t -> bool
val get_utf_16le_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16le : t -> bool
val create : int -> bytes
val copy : string -> string
val fill : bytes -> pos:int -> len:int -> char -> unit
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
val unsafe_blit : src:string -> src_pos:int -> dst:bytes -> diff --git a/dev/containers/Containers/Hashtbl/index.html b/dev/containers/Containers/Hashtbl/index.html index a5b57295..c6205a8d 100644 --- a/dev/containers/Containers/Hashtbl/index.html +++ b/dev/containers/Containers/Hashtbl/index.html @@ -2,7 +2,7 @@ Hashtbl (containers.Containers.Hashtbl)

Module Containers.Hashtbl

  • since 0.14
include 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.t
type (!'a, !'b) t = ( 'a, 'b ) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ( 'a, 'b ) t
val clear : ( 'a, 'b ) t -> unit
val reset : ( 'a, 'b ) t -> unit
val copy : ( 'a, 'b ) t -> ( 'a, 'b ) t
val add : ( 'a, 'b ) t -> 'a -> 'b -> unit
val find : ( 'a, 'b ) t -> 'a -> 'b
val find_opt : ( 'a, 'b ) t -> 'a -> 'b option
val find_all : ( 'a, 'b ) t -> 'a -> 'b list
val mem : ( 'a, 'b ) t -> 'a -> bool
val remove : ( 'a, 'b ) t -> 'a -> unit
val replace : ( 'a, 'b ) t -> 'a -> 'b -> unit
val iter : ( 'a -> 'b -> unit ) -> ( 'a, 'b ) t -> unit
val filter_map_inplace : ( 'a -> 'b -> 'b option ) -> ( 'a, 'b ) t -> unit
val fold : ( 'a -> 'b -> 'c -> 'c ) -> ( 'a, 'b ) t -> 'c -> 'c
val length : ( 'a, 'b ) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ( 'a, 'b ) t -> ( 'a, 'b ) t
type statistics = Stdlib.Hashtbl.statistics = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
bucket_histogram : int array;
}
val stats : ( 'a, 'b ) t -> statistics
val to_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ( 'a, 'b ) t -> 'a Stdlib.Seq.t
val to_seq_values : ( 'a, 'b ) t -> 'b Stdlib.Seq.t
val replace_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : Stdlib__Hashtbl.HashedType) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

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

  • since 0.16
val keys : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ( 'a -> 'b -> 'c ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

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

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ( 'a, int ) Stdlib.Hashtbl.t -> 'a -> unit

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.

  • since 0.16
val to_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ( 'a, 'b list ) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

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

  • since 0.16
val add_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

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

  • since 2.8
val add_iter_with : + and type ('a, 'b) t = ( 'a, 'b ) Stdlib.Hashtbl.t
type (!'a0, !'b0) t = ( 'a, 'b ) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ( 'a, 'b ) t
val clear : ( 'a, 'b ) t -> unit
val reset : ( 'a, 'b ) t -> unit
val copy : ( 'a, 'b ) t -> ( 'a, 'b ) t
val add : ( 'a, 'b ) t -> 'a -> 'b -> unit
val find : ( 'a, 'b ) t -> 'a -> 'b
val find_opt : ( 'a, 'b ) t -> 'a -> 'b option
val find_all : ( 'a, 'b ) t -> 'a -> 'b list
val mem : ( 'a, 'b ) t -> 'a -> bool
val remove : ( 'a, 'b ) t -> 'a -> unit
val replace : ( 'a, 'b ) t -> 'a -> 'b -> unit
val iter : ( 'a -> 'b -> unit ) -> ( 'a, 'b ) t -> unit
val filter_map_inplace : ( 'a -> 'b -> 'b option ) -> ( 'a, 'b ) t -> unit
val fold : ( 'a -> 'b -> 'c -> 'c ) -> ( 'a, 'b ) t -> 'c -> 'c
val length : ( 'a, 'b ) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ( 'a, 'b ) t -> ( 'a, 'b ) t
type statistics = Stdlib.Hashtbl.statistics = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
bucket_histogram : int array;
}
val stats : ( 'a, 'b ) t -> statistics
val to_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ( 'a, 'b ) t -> 'a Stdlib.Seq.t
val to_seq_values : ( 'a, 'b ) t -> 'b Stdlib.Seq.t
val replace_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : Stdlib__Hashtbl.HashedType) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

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

  • since 0.16
val keys : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ( 'a -> 'b -> 'c ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

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

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ( 'a, int ) Stdlib.Hashtbl.t -> 'a -> unit

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.

  • since 0.16
val to_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ( 'a, 'b list ) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

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

  • since 0.16
val add_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

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

  • since 2.8
val add_iter_with : f:( 'a -> 'b -> 'b -> 'b ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> diff --git a/dev/containers/ContainersLabels/Hashtbl/index.html b/dev/containers/ContainersLabels/Hashtbl/index.html index ffef43b8..12eaa84f 100644 --- a/dev/containers/ContainersLabels/Hashtbl/index.html +++ b/dev/containers/ContainersLabels/Hashtbl/index.html @@ -2,7 +2,7 @@ Hashtbl (containers.ContainersLabels.Hashtbl)

Module ContainersLabels.Hashtbl

  • since 0.14
include 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.t
type (!'a, !'b) t = ( 'a, 'b ) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ( 'a, 'b ) t
val clear : ( 'a, 'b ) t -> unit
val reset : ( 'a, 'b ) t -> unit
val copy : ( 'a, 'b ) t -> ( 'a, 'b ) t
val add : ( 'a, 'b ) t -> 'a -> 'b -> unit
val find : ( 'a, 'b ) t -> 'a -> 'b
val find_opt : ( 'a, 'b ) t -> 'a -> 'b option
val find_all : ( 'a, 'b ) t -> 'a -> 'b list
val mem : ( 'a, 'b ) t -> 'a -> bool
val remove : ( 'a, 'b ) t -> 'a -> unit
val replace : ( 'a, 'b ) t -> 'a -> 'b -> unit
val iter : ( 'a -> 'b -> unit ) -> ( 'a, 'b ) t -> unit
val filter_map_inplace : ( 'a -> 'b -> 'b option ) -> ( 'a, 'b ) t -> unit
val fold : ( 'a -> 'b -> 'c -> 'c ) -> ( 'a, 'b ) t -> 'c -> 'c
val length : ( 'a, 'b ) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ( 'a, 'b ) t -> ( 'a, 'b ) t
type statistics = Stdlib.Hashtbl.statistics = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
bucket_histogram : int array;
}
val stats : ( 'a, 'b ) t -> statistics
val to_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ( 'a, 'b ) t -> 'a Stdlib.Seq.t
val to_seq_values : ( 'a, 'b ) t -> 'b Stdlib.Seq.t
val replace_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : Stdlib__Hashtbl.HashedType) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

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

  • since 0.16
val keys : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ( 'a -> 'b -> 'c ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

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

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ( 'a, int ) Stdlib.Hashtbl.t -> 'a -> unit

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.

  • since 0.16
val to_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ( 'a, 'b list ) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

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

  • since 0.16
val add_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

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

  • since 2.8
val add_iter_with : + and type ('a, 'b) t = ( 'a, 'b ) Stdlib.Hashtbl.t
type (!'a0, !'b0) t = ( 'a, 'b ) Stdlib.Hashtbl.t
val create : ?random:bool -> int -> ( 'a, 'b ) t
val clear : ( 'a, 'b ) t -> unit
val reset : ( 'a, 'b ) t -> unit
val copy : ( 'a, 'b ) t -> ( 'a, 'b ) t
val add : ( 'a, 'b ) t -> 'a -> 'b -> unit
val find : ( 'a, 'b ) t -> 'a -> 'b
val find_opt : ( 'a, 'b ) t -> 'a -> 'b option
val find_all : ( 'a, 'b ) t -> 'a -> 'b list
val mem : ( 'a, 'b ) t -> 'a -> bool
val remove : ( 'a, 'b ) t -> 'a -> unit
val replace : ( 'a, 'b ) t -> 'a -> 'b -> unit
val iter : ( 'a -> 'b -> unit ) -> ( 'a, 'b ) t -> unit
val filter_map_inplace : ( 'a -> 'b -> 'b option ) -> ( 'a, 'b ) t -> unit
val fold : ( 'a -> 'b -> 'c -> 'c ) -> ( 'a, 'b ) t -> 'c -> 'c
val length : ( 'a, 'b ) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ( 'a, 'b ) t -> ( 'a, 'b ) t
type statistics = Stdlib.Hashtbl.statistics = {
num_bindings : int;
num_buckets : int;
max_bucket_length : int;
bucket_histogram : int array;
}
val stats : ( 'a, 'b ) t -> statistics
val to_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ( 'a, 'b ) t -> 'a Stdlib.Seq.t
val to_seq_values : ( 'a, 'b ) t -> 'b Stdlib.Seq.t
val replace_seq : ( 'a, 'b ) t -> ('a * 'b) Stdlib.Seq.t -> unit
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : Stdlib__Hashtbl.HashedType) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
include module type of struct include CCHashtbl.Poly end
val get : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> 'b option

get tbl k finds a binding for the key k if present, or returns None if no value is found. Safe version of Hashtbl.find.

val get_or : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a -> default:'b -> 'b

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

  • since 0.16
val keys : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a CCHashtbl.iter

keys tbl f iterates on keys (similar order as Hashtbl.iter).

val values : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b CCHashtbl.iter

values tbl f iterates on values in the table tbl.

val keys_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'a list

keys_list tbl is the list of keys in tbl. If the key is in the Hashtable multiple times, all occurrences will be returned.

  • since 0.8
val values_list : ( 'a, 'b ) Stdlib.Hashtbl.t -> 'b list

values_list tbl is the list of values in tbl.

  • since 0.8
val map_list : ( 'a -> 'b -> 'c ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> 'c list

map_list f tbl maps on a tbl's items. Collect into a list.

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

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

  • parameter by

    if specified, the int value is incremented by by rather than 1.

  • since 0.16
val decr : ?by:int -> ( 'a, int ) Stdlib.Hashtbl.t -> 'a -> unit

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.

  • since 0.16
val to_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter

Iterate on bindings in the table.

  • since 2.8
val add_list : ( 'a, 'b list ) Stdlib.Hashtbl.t -> 'a -> 'b -> unit

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

  • since 0.16
val add_iter : ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter -> unit

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

  • since 2.8
val add_iter_with : f:( 'a -> 'b -> 'b -> 'b ) -> ( 'a, 'b ) Stdlib.Hashtbl.t -> ('a * 'b) CCHashtbl.iter ->