let pred = λ(n : Natural) → (Natural/fold n { prev : Natural, next : Natural } (λ(p : { prev : Natural, next : Natural }) → { prev : p.next, next : p.next + +1}) { prev : 0, next : 0 }).prev
in λ(x : Natural) → λ(y : Natural) → Natural/fold y Natural pred x
The Ackermann function: let iter = λ(f : Natural → Natural) → λ(n : Natural) → Natural/fold n Natural f (f (1))
in λ(m : Natural) → Natural/fold m (Natural → Natural) iter (+ +1)
Save the above to 'ack' and run the following:
$ dhall <<< './ack 10 10'
It's going to take a while before it finishes.This language is close to Turing complete.