Advertisement
Guest User

Untitled

a guest
Jul 8th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.37 KB | None | 0 0
  1. open Base
  2. let hash_equal (h1: ('a, 'b) Hashtbl.t) (h2: ('a, 'b) Hashtbl.t) : bool =
  3.   if Hashtbl.length h1 <> Hashtbl.length h2 then false
  4.   else Hashtbl.for_alli
  5.   ~f:(fun ~key ~data ->
  6.     if Hashtbl.mem h1 key then
  7.      match Hashtbl.find h2 key with
  8.         | Some data_ -> if d = data then true else false
  9.         | None -> false
  10.     else false     
  11.     )
  12.     h2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement