RosettaCodeData/Task/Ackermann-function/Futhark/ackermann-function.futhark

5 lines
143 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
fun ackermann(m: int, n: int): int =
if m == 0 then n + 1
else if n == 0 then ackermann(m-1, 1)
else ackermann(m - 1, ackermann(m, n-1))