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

Sourcetype key = H.t
Sourceval create : int -> 'a t
Sourceval length : 'a t -> int
Sourceval is_empty : 'a t -> bool
Sourceval clear : 'a t -> unit
Sourceval reset : 'a t -> unit
Sourceval copy : 'a t -> 'a t
Sourceval add : 'a t -> key -> 'a -> unit
Sourceval remove : 'a t -> key -> unit
Sourceval remove_all : 'a t -> key -> unit
Sourceval find : 'a t -> key -> 'a
Sourceval find_all : 'a t -> key -> 'a list
Sourceval find_default : 'a t -> key -> 'a -> 'a
Sourceval find_option : 'a t -> key -> 'a option
Sourceval find_opt : 'a t -> key -> 'a option
Sourceval replace : 'a t -> key -> 'a -> unit
Sourceval 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
Sourceval 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
Sourceval to_seq : 'a t -> (key * 'a) Seq.t
Sourceval to_seq_keys : _ t -> key Seq.t
Sourceval to_seq_values : 'a t -> 'a Seq.t
Sourceval add_seq : 'a t -> (key * 'a) Seq.t -> unit
Sourceval replace_seq : 'a t -> (key * 'a) Seq.t -> unit
Sourceval of_seq : (key * 'a) 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.