CCIntMap
Map specialized for Int keys
status: stable
val empty : 'a t
val is_empty : _ t -> bool
Is the map empty?
val singleton : int -> 'a -> 'a t
val doubleton : int -> 'a -> int -> 'a -> 'a t
val mem : int -> _ t -> bool
val find : int -> 'a t -> 'a option
equal ~eq a b
checks whether a
and b
have the same set of pairs (key, value), comparing values with eq
.
Total order between maps; the precise order is unspecified.
Filter-map values using the given function
val cardinal : _ t -> int
Number of bindings in the map. Linear time.
val iter : ( int -> 'a -> unit ) -> 'a t -> unit
val fold : ( int -> 'a -> 'b -> 'b ) -> 'a t -> 'b -> 'b
val choose : 'a t -> (int * 'a) option
val choose_exn : 'a t -> int * 'a
val merge :
f:( int -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option ) ->
'a t ->
'b t ->
'c t
merge ~f m1 m2
merges m1
and m2
together, calling f
once on every key that occurs in at least one of m1
and m2
. if f k binding = Some c
then k -> c
is part of the result, else k
is not part of the result.
val of_list : (int * 'a) list -> 'a t
val to_list : 'a t -> (int * 'a) list
val of_seq : (int * 'a) Stdlib.Seq.t -> 'a t
val to_seq : 'a t -> (int * 'a) Stdlib.Seq.t
type 'a tree = unit -> [ `Nil | `Node of 'a * 'a tree list ]
Helpers