RosettaCodeData/Task/Ackermann-function/Agda/ackermann-function-1.agda

13 lines
241 B
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open import Data.Nat
open import Data.Nat.Show
open import IO
module Ackermann where
ack : -> ->
ack zero n = n + 1
ack (suc m) zero = ack m 1
ack (suc m) (suc n) = ack m (ack (suc m) n)
main = run (putStrLn (show (ack 3 9)))