package batteries

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module BatHashtbl.MakeSource

Functor building an implementation of the hashtable structure. The functor Hashtbl.Make returns a structure containing a type key of keys and a type 'a t of hash tables associating data of type 'a to keys of type key. The operations perform similarly to those of the generic interface, but use the hashing and equality functions specified in the functor argument H instead of generic equality and hashing.

Parameters

module H : HashedType

Signature

type key = H.t
type 'a t = 'a Stdlib.Hashtbl.Make(H).t
val create : int -> 'a t
Sourceval length : 'a t -> int
Sourceval is_empty : 'a t -> bool
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
Sourceval remove_all : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
Sourceval find_default : 'a t -> key -> 'a -> 'a
Sourceval find_option : 'a t -> key -> 'a option
val find_opt : 'a t -> key -> 'a option
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
Sourceval iter : (key -> 'a -> unit) -> 'a t -> unit
Sourceval for_all : (key -> 'a -> bool) -> 'a t -> bool
Sourceval fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
Sourceval exists : (key -> 'a -> bool) -> 'a t -> bool
Sourceval map : (key -> 'b -> 'c) -> 'b t -> 'c t
Sourceval map_inplace : (key -> 'a -> 'a) -> 'a t -> unit
Sourceval filter : ('a -> bool) -> 'a t -> 'a t
Sourceval filter_inplace : ('a -> bool) -> 'a t -> unit
Sourceval filteri : (key -> 'a -> bool) -> 'a t -> 'a t
Sourceval filteri_inplace : (key -> 'a -> bool) -> 'a t -> unit
Sourceval filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
Sourceval modify : key -> ('a -> 'a) -> 'a t -> unit
Sourceval modify_def : 'a -> key -> ('a -> 'a) -> 'a t -> unit
Sourceval modify_opt : key -> ('a option -> 'a option) -> 'a t -> unit
Sourceval merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
Sourceval merge_all : (key -> 'a list -> 'b list -> 'c list) -> 'a t -> 'b t -> 'c t
Sourceval stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : _ t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
Sourceval keys : 'a t -> key BatEnum.t
Sourceval values : 'a t -> 'a BatEnum.t
Sourceval enum : 'a t -> (key * 'a) BatEnum.t
Sourceval to_list : 'a t -> (key * 'a) list
Sourceval of_enum : (key * 'a) BatEnum.t -> 'a t
Sourceval of_list : (key * 'a) list -> 'a t
Sourceval print : ?first:string -> ?last:string -> ?sep:string -> ('a BatInnerIO.output -> key -> unit) -> ('a BatInnerIO.output -> 'b -> unit) -> 'a BatInnerIO.output -> 'b t -> unit

Override modules

The following modules replace functions defined in Hashtbl with functions behaving slightly differently but having the same name. This is by design: the functions meant to override the corresponding functions of Hashtbl.

Sourcemodule Exceptionless : sig ... end

Operations on Hashtbl without exceptions.

Sourcemodule Infix : sig ... end

Infix operators over a BatHashtbl

Sourcemodule Labels : sig ... end

Operations on Hashtbl with labels.

OCaml

Innovation. Community. Security.