summaryrefslogblamecommitdiff
path: root/libs/util.ml
blob: cfa1619623befd4f18e4c6b0770a074f207f0cd4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                   





                                           





                                               
exception TypeError

module VarMap = Mapext.Make(String)

let rec fix equal f s =
  let fs = f s in
  if equal fs s
    then fs
    else fix equal f fs

let (@@) f x = f x

let print_list x l =
  Format.printf "%s: " x;
  let rec aux = function
    | [] -> ()
    | [a] -> Format.printf "%s" a
    | p::q -> Format.printf "%s, " p; aux q
  in
  Format.printf "["; aux l; Format.printf "]@."

let uid =
  let c = ref 0 in
  fun () -> c := !c + 1; string_of_int !c