From 1e22a55ff25612753665a76eb3b83628379334a0 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 3 Nov 2010 09:50:25 -0700 Subject: Code sketch and comment notes on textual crate signatures. --- src/boot/util/common.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/boot/util') diff --git a/src/boot/util/common.ml b/src/boot/util/common.ml index 838caa73..7a95573c 100644 --- a/src/boot/util/common.ml +++ b/src/boot/util/common.ml @@ -218,6 +218,15 @@ let sorted_htab_keys (tab:('a, 'b) Hashtbl.t) : 'a array = keys ;; +let sorted_htab_iter + (f:'a -> 'b -> unit) + (tab:('a, 'b) Hashtbl.t) + : unit = + Array.iter + (fun k -> f k (Hashtbl.find tab k)) + (sorted_htab_keys tab) +;; + let htab_vals (htab:('a,'b) Hashtbl.t) : ('b list) = Hashtbl.fold (fun _ v accum -> v :: accum) htab [] ;; -- cgit v1.2.3