]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/extlib/hExtlib.ml
added flatten_map
[helm.git] / helm / software / components / extlib / hExtlib.ml
index 8a0c8cf7d69fb5578d2a851e921d73d5a6546554..b36a4d89db2630f5d0d192454f706d86fa1054d3 100644 (file)
@@ -27,7 +27,7 @@
 
 (** PROFILING *)
 
-let profiling_enabled = ComponentsConf.profiling
+let profiling_enabled = false ;; (* ComponentsConf.profiling *)
 
 let something_profiled = ref false
 
@@ -135,6 +135,10 @@ let is_alphanum c = is_alpha c || is_digit c
 
 (** {2 List processing} *)
 
+let flatten_map f l =
+  List.flatten (List.map f l)
+;;
+
 let rec list_uniq ?(eq=(=)) = function 
   | [] -> []
   | h::[] -> [h]
@@ -365,3 +369,7 @@ let raise_localized_exception ~offset floc exn =
    { flocb with Lexing.pos_cnum = x }, { floce with Lexing.pos_cnum = y }
  in
   raise (Localized (floc, exn))
+
+let estimate_size x = 
+  4 * (String.length (Marshal.to_string x [])) / 1024
+