summaryrefslogtreecommitdiff
path: root/tests/typing
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-10 15:22:12 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-10 15:22:12 +0100
commit3a9435618cbb39e01fbea0d48769c8978e1e4224 (patch)
tree1846ca7c164053c6c7a2d73757db2cf4645a4bcc /tests/typing
parent6e6aad66c8c4bff2d94c099b29ba5ae4f4e82896 (diff)
downloadpetitcaml-3a9435618cbb39e01fbea0d48769c8978e1e4224.tar.gz
petitcaml-3a9435618cbb39e01fbea0d48769c8978e1e4224.tar.bz2
[petitcaml] Add new test (ackermann function)
Diffstat (limited to 'tests/typing')
-rw-r--r--tests/typing/funcs-rec-2args.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/typing/funcs-rec-2args.ml b/tests/typing/funcs-rec-2args.ml
new file mode 100644
index 0000000..39cd876
--- /dev/null
+++ b/tests/typing/funcs-rec-2args.ml
@@ -0,0 +1,7 @@
+(*
+ return : 0
+*)
+let rec ack m n =
+ if m = 0 then n + 1
+ else if n = 0 then ack (m - 1) 1
+ else ack (m - 1) (ack m (n - 1))