Module Utils.Functions

val hash_pair : int -> int -> int

hash_pair x y returns a decent hash for the pair (x,y).

val pp_option : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a option -> unit

pp_option pp_some fmt opt prints pp_some fmt x when opt is Some x and "None" otherwise. This is a far more reasonable default than Format.pp_print_option.

val range_fold : (int -> 'a -> 'a) -> int -> 'a -> 'a

range_fold f n init is f 0 init |> f 1 |> ... |> f n

val list_of_hashtbl_keys : 'a PersistentArray.IntHashtable.t -> int list

returns the list of keys present in the hashtable