bap-primus

The BAP Microexecution Framework
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library bap_primus
Module Bap_primus . Std . Primus . Lisp . Closure . Make . Machine . Id . Table
include Core_kernel.Hashtbl_intf.S with type ('a, 'b) hashtbl = ( 'a, 'b ) Core_kernel.Hashtbl.t with type key = t
include Core_kernel.Hashtbl_intf.S_plain with type ('a, 'b) hashtbl = ( 'a, 'b ) Core_kernel.Hashtbl.t with type key = t
type key = t
type ('a, 'b) hashtbl = ( 'a, 'b ) Core_kernel.Hashtbl.t
type 'b t = ( key, 'b ) hashtbl
val sexp_of_t : ( 'b -> Ppx_sexp_conv_lib.Sexp.t ) -> 'b t -> Ppx_sexp_conv_lib.Sexp.t
type ('a, 'b) t_ = 'b t
type 'a key_ = key
include Base.Invariant.S1 with type 'b t := 'b t
val invariant : ( 'a -> unit ) -> 'a t -> unit
val create : ( 'a key_, 'b, unit -> ( 'a, 'b ) t_ ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val of_alist : ( 'a key_, 'b, ('a key_ * 'b) list -> [ `Duplicate_key of 'a key_ | `Ok of ( 'a, 'b ) t_ ] ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val of_alist_report_all_dups : ( 'a key_, 'b, ('a key_ * 'b) list -> [ `Duplicate_keys of 'a key_ list | `Ok of ( 'a, 'b ) t_ ] ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val of_alist_or_error : ( 'a key_, 'b, ('a key_ * 'b) list -> ( 'a, 'b ) t_ Base.Or_error.t ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val of_alist_exn : ( 'a key_, 'b, ('a key_ * 'b) list -> ( 'a, 'b ) t_ ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val of_alist_multi : ( 'a key_, 'b list, ('a key_ * 'b) list -> ( 'a, 'b list ) t_ ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val create_mapped : ( 'a key_, 'b, get_key:( 'r -> 'a key_ ) -> get_data:( 'r -> 'b ) -> 'r list -> [ `Duplicate_keys of 'a key_ list | `Ok of ( 'a, 'b ) t_ ] ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val create_with_key : ( 'a key_, 'r, get_key:( 'r -> 'a key_ ) -> 'r list -> [ `Duplicate_keys of 'a key_ list | `Ok of ( 'a, 'r ) t_ ] ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val create_with_key_or_error : ( 'a key_, 'r, get_key:( 'r -> 'a key_ ) -> 'r list -> ( 'a, 'r ) t_ Base.Or_error.t ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val create_with_key_exn : ( 'a key_, 'r, get_key:( 'r -> 'a key_ ) -> 'r list -> ( 'a, 'r ) t_ ) Core_kernel.Hashtbl_intf.create_options_without_hashable
val group : ( 'a key_, 'b, get_key:( 'r -> 'a key_ ) -> get_data:( 'r -> 'b ) -> combine:( 'b -> 'b -> 'b ) -> 'r list -> ( 'a, 'b ) t_ ) Core_kernel.Hashtbl_intf.create_options_without_hashable
include Core_kernel.Hashtbl_intf.Accessors with type ('a, 'b) t := ( 'a, 'b ) t_ with type 'a key := 'a key_

Accessors

val sexp_of_key : ( 'a, _ ) t_ -> 'a key_ -> Base.Sexp.t
val clear : ( _, _ ) t_ -> unit
val copy : ( 'a, 'b ) t_ -> ( 'a, 'b ) t_
val fold : ( 'a, 'b ) t_ -> init:'c -> f:( key:'a key_ -> data:'b -> 'c -> 'c ) -> 'c

Attempting to modify (set, remove, etc.) the hashtable during iteration (fold, iter, iter_keys, iteri) will raise an exception.

val iter_keys : ( 'a, _ ) t_ -> f:( 'a key_ -> unit ) -> unit
val iter : ( _, 'b ) t_ -> f:( 'b -> unit ) -> unit
val iteri : ( 'a, 'b ) t_ -> f:( key:'a key_ -> data:'b -> unit ) -> unit

Iterates over both keys and values.

Example:

      let h = Hashtbl.of_alist_exn (module Int) [(1, 4); (5, 6)] in
      Hashtbl.iteri h ~f:(fun ~key ~data ->
        print_endline (Printf.sprintf "%d-%d" key data));;
      1-4
      5-6
      - : unit = ()
val existsi : ( 'a, 'b ) t_ -> f:( key:'a key_ -> data:'b -> bool ) -> bool
val exists : ( _, 'b ) t_ -> f:( 'b -> bool ) -> bool
val for_alli : ( 'a, 'b ) t_ -> f:( key:'a key_ -> data:'b -> bool ) -> bool
val for_all : ( _, 'b ) t_ -> f:( 'b -> bool ) -> bool
val counti : ( 'a, 'b ) t_ -> f:( key:'a key_ -> data:'b -> bool ) -> int
val count : ( _, 'b ) t_ -> f:( 'b -> bool ) -> int
val length : ( _, _ ) t_ -> int
val is_empty : ( _, _ ) t_ -> bool
val mem : ( 'a, _ ) t_ -> 'a key_ -> bool
val remove : ( 'a, _ ) t_ -> 'a key_ -> unit
val set : ( 'a, 'b ) t_ -> key:'a key_ -> data:'b -> unit

Sets the given key to data.

val add : ( 'a, 'b ) t_ -> key:'a key_ -> data:'b -> [ `Ok | `Duplicate ]

add and add_exn leave the table unchanged if the key was already present.

val add_exn : ( 'a, 'b ) t_ -> key:'a key_ -> data:'b -> unit
val change : ( 'a, 'b ) t_ -> 'a key_ -> f:( 'b option -> 'b option ) -> unit

change t key ~f changes t's value for key to be f (find t key).

val update : ( 'a, 'b ) t_ -> 'a key_ -> f:( 'b option -> 'b ) -> unit

update t key ~f is change t key ~f:(fun o -> Some (f o)).

val map : ( 'a, 'b ) t_ -> f:( 'b -> 'c ) -> ( 'a, 'c ) t_

map t f returns a new table with values replaced by the result of applying f to the current values.

Example:

      let h = Hashtbl.of_alist_exn (module Int) [(1, 4); (5, 6)] in
      let h' = Hashtbl.map h ~f:(fun x -> x * 2) in
      Hashtbl.to_alist h';;
      - : (int * int) list = [(5, 12); (1, 8)]
val mapi : ( 'a, 'b ) t_ -> f:( key:'a key_ -> data:'b -> 'c ) -> ( 'a, 'c ) t_

Like map, but the function f takes both key and data as arguments.

val filter_map : ( 'a, 'b ) t_ -> f:( 'b -> 'c option ) -> ( 'a, 'c ) t_

Returns a new table by filtering the given table's values by f