RosettaCodeData/Task/Mutual-recursion/OCaml/mutual-recursion.ocaml

8 lines
109 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
let rec f = function
| 0 -> 1
| n -> n - m(f(n-1))
and m = function
| 0 -> 0
| n -> n - f(m(n-1))
;;