Source

opycaml / utils.ml

Full commit
module List = struct
  let iteri f list =
    let rec iteri f n = function
      | [] -> ()
      | x::xs -> f n x; iteri f (n+1) xs
    in
    iteri f 0 list
end

module Gc = struct
  let report () = 
    let stat = Gc.stat () in
    Format.eprintf "live_words: %d / maj-cor: %d@." stat.Gc.live_words stat.Gc.major_collections
end