1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 08:08:44 +03:00
juvix/tests/Compilation/positive/test029.juvix
Łukasz Czajka 2baad15a41 Remove old function syntax (#2305)
* Enables new function syntax in local let-declarations
* Closes #2251
2023-08-24 16:24:47 +02:00

19 lines
369 B
Plaintext

-- Ackermann function
module test029;
import Stdlib.Prelude open;
ack : Nat → Nat → Nat
| zero n := n + 1
| (suc m) zero := ack m 1
| (suc m) (suc n) := ack m (ack (suc m) n);
main : IO :=
printNatLn (ack 0 7)
>> printNatLn (ack 1 7)
>> printNatLn (ack 1 13)
>> printNatLn (ack 2 7)
>> printNatLn (ack 2 13)
>> printNatLn (ack 3 7);