-
batteries
-
batteriesThread
Library
Module
Module type
Parameter
Class
Class type
Capabilities for hashtables.
@documents Hashtbl.Cap
Constructors
val create : int -> ('a, 'b, _) t
Adopt a regular hashtable as a capability hashtble, allowing to decrease capabilities if necessary.
This operation involves no copying. In other words, in let cap = of_table a in ...
, any modification in a
will also have effect on cap
and reciprocally.
Return a capability hashtable as a regular hashtable.
This operation requires both read and write permissions on the capability table and involves no copying. In other words, in let a = of_table cap in ...
, any modification in a
will also have effect on cap
and reciprocally.
Drop to read-only permissions.
This operation involves no copying.
Drop to write-only permissions.
This operation involves no copying.
Base operations
val length : ('a, 'b, _) t -> int
val is_empty : ('a, 'b, _) t -> bool
val add : ('a, 'b, [> `Write ]) t -> 'a -> 'b -> unit
val remove : ('a, 'b, [> `Write ]) t -> 'a -> unit
val remove_all : ('a, 'b, [> `Write ]) t -> 'a -> unit
val replace : ('a, 'b, [> `Write ]) t -> 'a -> 'b -> unit
val clear : ('a, 'b, [> `Write ]) t -> unit
val stats : ('a, 'b, _) t -> statistics
Searching
val find : ('a, 'b, [> `Read ]) t -> 'a -> 'b
val find_all : ('a, 'b, [> `Read ]) t -> 'a -> 'b list
val find_default : ('a, 'b, [> `Read ]) t -> 'a -> 'b -> 'b
val find_option : ('a, 'b, [> `Read ]) t -> 'a -> 'b option
val exists : ('a -> 'b -> bool) -> ('a, 'b, [> `Read ]) t -> bool
val mem : ('a, 'b, [> `Read ]) t -> 'a -> bool
Traversing
val iter : ('a -> 'b -> unit) -> ('a, 'b, [> `Read ]) t -> unit
val for_all : ('a -> 'b -> bool) -> ('a, 'b, [> `Read ]) t -> bool
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b, [> `Read ]) t -> 'c -> 'c
val map_inplace : ('a -> 'b -> 'b) -> ('a, 'b, [> `Write ]) t -> unit
val filter_inplace : ('a -> bool) -> ('key, 'a, [> `Write ]) t -> unit
val filteri_inplace : ('key -> 'a -> bool) -> ('key, 'a, [> `Write ]) t -> unit
val filter_map_inplace :
('key -> 'a -> 'a option) ->
('key, 'a, [> `Write ]) t ->
unit
Conversions
val to_list : ('a, 'b, [> `Read ]) t -> ('a * 'b) list
val of_list : ('a * 'b) list -> ('a, 'b, _) t
Boilerplate code
Printing
val print :
?first:string ->
?last:string ->
?sep:string ->
?kvsep:string ->
('a BatInnerIO.output -> 'b -> unit) ->
('a BatInnerIO.output -> 'c -> unit) ->
'a BatInnerIO.output ->
('b, 'c, [> `Read ]) t ->
unit
Override modules
module Exceptionless : sig ... end
Operations on BatHashtbl.Cap
without exceptions.
module Labels : sig ... end
Operations on BatHashtbl.Cap
with labels.