let count hist k = Option.try_with (fun () -> count_exn hist k)