RosettaCodeData/Task/Ackermann-function/OCaml/ackermann-function-3.ml

9 lines
155 B
OCaml
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let h = Hashtbl.create 4001
let a m n =
try Hashtbl.find h (m, n)
with Not_found ->
let res = a (m, n) in
Hashtbl.add h (m, n) res;
(res)